## Towards Effective Evaluation of General Logic Programs (1993)

Venue: | in the Proceedings of the 12th PODS |

Citations: | 20 - 10 self |

### BibTeX

@TECHREPORT{Chen93towardseffective,

author = {Weidong Chen and David S. Warren},

title = {Towards Effective Evaluation of General Logic Programs},

institution = {in the Proceedings of the 12th PODS},

year = {1993}

}

### Years of Citing Articles

### OpenURL

### Abstract

SLD resolution with negation as finite failure (or SLDNF) reflects the procedural interpretation of Horn-clause predicate logic as a programming language and forms the computational basis for Prolog systems. Despite its advantages in memory management, SLDNF is often not appropriate for query evaluation for three reasons: a) it may not terminate due to infinite positive recursion; b) it may not terminate due to infinite recursion through negation; and c) it may repeatedly evaluate the same clause body literal, leading to unacceptable performance. We address all three problems for goal-oriented query evaluation of arbitrary programs by presenting an extension of SLDNF, called SLG resolution, with the following distinctive features: (i) SLG resolution is a partial deduction procedure, consisting of several transformations. Each query is transformed step by step into a set of answer clauses; (ii) SLG resolution is sound and search space complete for all non-floundering queries with respec...

### Citations

1855 |
Foundations of Logic Programming
- Lloyd
- 1987
(Show Context)
Citation Context ...f implementation details. 2 Three-Valued Stable Models This section reviews the notion of three-valued stable model semantics of logic programs [27]. We assume the basic terminology of logic programs =-=[18]. An-=- atom is of the form p(t 1 ; :::; t n ), where p is an n-ary predicate symbol and t 1 ; :::; t n are terms. A literal is either an atom A or its negation ��A. The existential closure of a literal ... |

1492 | The stable model semantics for logic programming
- Gelfond, Lifschitz
- 1988
(Show Context)
Citation Context ... explored, but with a bigger negative context, namely the current negative context augmented with the selected negative literal. Example 1.2 Consider the game-playing program by Gelfond and Lifschitz =-=[13]: wi-=-n(X) / move(X;Y ); ��win(Y ): with the following moves: move(a; b): move(a; c): move(b; a): The SLDNF tree for the goal / win(a) is infinite due to recursion through negation. Figure 2 depicts the... |

960 |
Negation as failure
- Clark
- 1978
(Show Context)
Citation Context ...rmalized as SLD resolution (Linear resolution with Selection function for Definite programs), which is sound and complete with respect to the least model semantics of definite programs [2, 37]. Clark =-=[11]-=- extended SLD resolution to SLDNF resolution, i.e., SLD resolution with the negation-as-finite-failure rule. A ground negative literal succeeds if its positive counterpart finitely fails, and fails if... |

844 | The well-founded semantics for general logic programs
- Gelder, Ross, et al.
- 1991
(Show Context)
Citation Context ...nements of SLDNF resolution, including SLS resolution [26] and global SLS resolution [25, 30]. These are ideal procedures for computing the perfect model semantics [26] and the well founded semantics =-=[39]-=-. However, they often do not terminate due to infinite positive and negative loops. Non-termination prevents SLDNF resolution from being used directly for query evaluation in data and knowledge bases.... |

709 | The semantics of predicate logic as a programming language
- Emden, Kowalski
- 1976
(Show Context)
Citation Context ... Modularly Stratified Programs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 34 7 Termination and Data Complexity 36 8 Related Work 37 9 Conclusion 39 i 1 Introduction The seminal work of =-=[2, 37]-=- provided a foundation for both the declarative and the procedural semantics of logic programs. According to [37], a program clause can be viewed as a procedure declaration, and each literal in the bo... |

610 |
Towards a theory of declarative knowledge
- Apt, Blair, et al.
- 1988
(Show Context)
Citation Context ...been applied and the selected atom is completed, the active clause can be disposed of. 6.2 Locally Stratified Programs Stratified programs are programs in which there is no negation through recursion =-=[1]-=-. Przymusinski [24] extended the class of stratified programs to a wider class, called locally stratified programs, and introduced the notion of a perfect model of a logic program. There is no infinit... |

530 | The complexity of relational query languages - Vardi - 1982 |

332 | An efficient unification algorithm
- Martelli, Montanari
- 1982
(Show Context)
Citation Context ...valuation, and to separate the logical issues from the procedural ones. Recall that unification can be viewed as a process of transforming a system of equations from a general form into a solved form =-=[21]-=-. Each transformation preserves all solutions or unifiers. We follow a similar approach to query evaluation, which is considered as a process of transforming a system of general clauses into one that ... |

298 |
Magic Sets and Other Strange Ways to Implement Logic Programs
- Bancilhon, Maier, et al.
- 1986
(Show Context)
Citation Context ...on to top-down approaches that use negative contexts for negative loop checking. Techniques for effective set-at-a-time query evaluation have been studied in deductive databases, including magic sets =-=[4, 5]-=-, magic templates [28] and Alexander templates [33]. The central idea is to simulate top-down SLD resolution to avoid generation of irrelevant tuples. In fact, tuples of magic predicates correspond to... |

254 |
On the declarative semantics of deductive databases and logic programs
- Przymusinski
- 1988
(Show Context)
Citation Context ...he selected atom is completed, the active clause can be disposed of. 6.2 Locally Stratified Programs Stratified programs are programs in which there is no negation through recursion [1]. Przymusinski =-=[24]-=- extended the class of stratified programs to a wider class, called locally stratified programs, and introduced the notion of a perfect model of a logic program. There is no infinite recursion through... |

244 | On the power of magic
- Beeri, Ramakrishnan
- 1987
(Show Context)
Citation Context ...on to top-down approaches that use negative contexts for negative loop checking. Techniques for effective set-at-a-time query evaluation have been studied in deductive databases, including magic sets =-=[4, 5]-=-, magic templates [28] and Alexander templates [33]. The central idea is to simulate top-down SLD resolution to avoid generation of irrelevant tuples. In fact, tuples of magic predicates correspond to... |

239 |
Partial evaluation in logic programming
- Lloyd, Shepherdson
- 1991
(Show Context)
Citation Context ... 3 Query Evaluation as Partial Deduction Partial deduction is a program transformation technique that specializes a logic program with respect to a goal to produce a more efficient or simpler program =-=[17, 19]-=-. The new program should be equivalent to the original one as far as the goal is concerned. Applications of partial deduction (or partial evaluation), especially to meta programming, have been investi... |

218 |
OLD resolution with tabulation
- Tamaki, Sato
- 1986
(Show Context)
Citation Context ...on properties of SLDNF resolution and to avoid redundant computation of subgoals. Several extensions of SLD resolution with memoing have been studied, including extension tables [12], OLDT resolution =-=[36]-=-, and QSQR [41]. These techniques have been generalized to stratified programs [16, 34] and modularly stratified programs [32]. Example 1.1 Consider the following program: e(a; b): e(b; c): e(b; a): t... |

191 |
Autoepistemic logic
- Marek, Truszczyński
- 1991
(Show Context)
Citation Context ...ther specific three-valued stable models. The latter can be carried out by further processing of the set of answer clauses of the initial subgoal. However, it has been shown by Marek and Truszczynski =-=[20]-=- that for propositional general logic programs P , determining whether P has a (two-valued) stable model is NP-complete. Several implementations of SLG resolution have been carried out in Quintus Prol... |

184 |
Contributions to the theory of logic programming
- Apt, Emden
- 1982
(Show Context)
Citation Context ... Modularly Stratified Programs : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 34 7 Termination and Data Complexity 36 8 Related Work 37 9 Conclusion 39 i 1 Introduction The seminal work of =-=[2, 37]-=- provided a foundation for both the declarative and the procedural semantics of logic programs. According to [37], a program clause can be viewed as a procedure declaration, and each literal in the bo... |

137 | Every logic program has a natural strati cation and an iterated least xed point model
- Przymusinski
- 1989
(Show Context)
Citation Context ...monly used in Prolog systems. Significant progress has been made in understanding negation, leading to several refinements of SLDNF resolution, including SLS resolution [26] and global SLS resolution =-=[25, 30]-=-. These are ideal procedures for computing the perfect model semantics [26] and the well founded semantics [39]. However, they often do not terminate due to infinite positive and negative loops. Non-t... |

135 | The well-founded semantics coincides with the threevalued stable semantics
- Przymusinski
- 1990
(Show Context)
Citation Context ...l transformations are identified that can be applied to transform each query, step by step, into a set of answer clauses. It is shown that each transformation preserves all three-valued stable models =-=[27]-=-, including the well founded partial model as a special case. SLG resolution can be used for computing the well founded semantics and as the first step in computing three-valued stable models. SLG res... |

129 |
Negation as failure using tight derivations for general logic programs
- Gelder
- 1988
(Show Context)
Citation Context ... similar to the proof of Theorem 6.2. 2 7 Termination and Data Complexity SLG resolution terminates for all function-free programs, or more generally, all programs with the bounded-term-size property =-=[38]-=-. The following definition is adopted from [38]. Definition 7.1 (Bounded-Term-Size Property) The size of a term is defined recursively as follows: ffl The size of a variable or a constant is 1. ffl Th... |

117 | Magic templates: a spellbinding approach to logic programs - Ramakrishnan - 1991 |

72 |
Recursive query processing: The power of logic
- Vieille
- 1989
(Show Context)
Citation Context ...not necessary since all answer X-clauses have been generated. This restriction of SLG resolution to definite programs results in a query evaluation strategy that is equivalent to OLDT [36] and SLD-AL =-=[42]-=-, modulo differences in variant checking or subsumption checking of subgoals. Practically, if a subgoal is known to be completely evaluated, there is no need for a choice point for potentially new ans... |

64 | On the declarative and procedural semantics of logic programs
- Przymusinski
- 1995
(Show Context)
Citation Context ...y management and is what is commonly used in Prolog systems. Significant progress has been made in understanding negation, leading to several refinements of SLDNF resolution, including SLS resolution =-=[26]-=- and global SLS resolution [25, 30]. These are ideal procedures for computing the perfect model semantics [26] and the well founded semantics [39]. However, they often do not terminate due to infinite... |

55 |
Query evaluation in recursive databases: bottom-up and top-down reconciled
- Bry
- 1990
(Show Context)
Citation Context ...wn SLD resolution to avoid generation of irrelevant tuples. In fact, tuples of magic predicates correspond to subgoals that are maintained in OLDT resolution. For definite programs, it has been shown =-=[8, 33]-=- that the top-down with memoing and the set-at-a-time approach are essentially equivalent. Methods of query processing have been investigated for stratified and modularly stratified programs [3, 29, 3... |

55 |
Extension tables: Memo relations in logic programming
- Dietrich
- 1987
(Show Context)
Citation Context ... improve the termination properties of SLDNF resolution and to avoid redundant computation of subgoals. Several extensions of SLD resolution with memoing have been studied, including extension tables =-=[12]-=-, OLDT resolution [36], and QSQR [41]. These techniques have been generalized to stratified programs [16, 34] and modularly stratified programs [32]. Example 1.1 Consider the following program: e(a; b... |

54 | A procedural semantics for well founded negation in logic programming
- Ross
- 1989
(Show Context)
Citation Context ...monly used in Prolog systems. Significant progress has been made in understanding negation, leading to several refinements of SLDNF resolution, including SLS resolution [26] and global SLS resolution =-=[25, 30]-=-. These are ideal procedures for computing the perfect model semantics [26] and the well founded semantics [39]. However, they often do not terminate due to infinite positive and negative loops. Non-t... |

47 |
Weakly perfect model semantics for logic programs
- Przymusinska, Przymusinski
- 1988
(Show Context)
Citation Context ...iterals must be delayed before their truth or falsity is known. Example 4.3 Assume that a left-most computation rule is used and that / s is to be solved with respect to the following program is from =-=[23]: s / ��p; ��q; -=-��r: p / ��q; r: q / ��r; p: r / ��p; q: Delaying transformations must be applied before the falsity of p, q, and r is derived. We introduce transformations for simplifying literals in... |

42 | On the power of Alexander templates - Seki - 1989 |

38 |
A Goal-Oriented Approach to Computing the Well-Founded Semantics
- Chen, Warren
- 1993
(Show Context)
Citation Context ... but also avoids redundant computation of identical subgoals. Mechanisms for detecting and handling negative loops in this framework have also been studied, including WELL! [6] and XOLDTNF resolution =-=[10]-=-. Imagine a negative looping branch in an SLDNF tree. The key idea to detect negative loops is to maintain for each subgoal the set of ground negative literals that have been encountered along a branc... |

32 | Magic sets and bottom-up evaluation of well-founded models
- Kemp, Stuckey, et al.
- 1991
(Show Context)
Citation Context ... dependency information, and handles programs with left-to-right modularly stratified negation. For general programs, the magic-sets transformation does not always preserve the well founded semantics =-=[14]-=-. Methods proposed in [14, 15] to solve this problem, called well founded magic sets techniques, tend to make too many magic facts true, which means that more calls are evaluated than necessary. A ref... |

31 | Controlling the search in bottom-up evaluation
- Ramakrishnan, Srivastava, et al.
- 1992
(Show Context)
Citation Context ...n [8, 33] that the top-down with memoing and the set-at-a-time approach are essentially equivalent. Methods of query processing have been investigated for stratified and modularly stratified programs =-=[3, 29, 32]-=-. With negation, the major issue becomes maintaining dependencies among magic tuples (or subgoals) so as to ensure that a positive subgoal is fully evaluated before its negative counterpart is resolve... |

29 |
A database-complete proof procedure based on sldresolution
- Vieille
- 1987
(Show Context)
Citation Context ...f SLDNF resolution and to avoid redundant computation of subgoals. Several extensions of SLD resolution with memoing have been studied, including extension tables [12], OLDT resolution [36], and QSQR =-=[41]-=-. These techniques have been generalized to stratified programs [16, 34] and modularly stratified programs [32]. Example 1.1 Consider the following program: e(a; b): e(b; c): e(b; a): tc(X; Y ) / e(X;... |

22 |
Efficient bottom-up computation of queries on stratified databases
- Balbin, Port, et al.
- 1991
(Show Context)
Citation Context ...n [8, 33] that the top-down with memoing and the set-at-a-time approach are essentially equivalent. Methods of query processing have been investigated for stratified and modularly stratified programs =-=[3, 29, 32]-=-. With negation, the major issue becomes maintaining dependencies among magic tuples (or subgoals) so as to ensure that a positive subgoal is fully evaluated before its negative counterpart is resolve... |

22 |
An alternating fixpoint tailored to magic programs
- Morishita
- 1993
(Show Context)
Citation Context ... false answers and the other for deriving possibly true or false answers. However, it makes too many magic facts true, which means that more subgoals are evaluated than necessary. Recently, Morishita =-=[22]-=- proposed a variant of the alternating fixpoint semantics tailored for magic sets computation, which generates fewer magic facts. This paper presents a partial deduction framework for query evaluation... |

22 |
A query evaluation method for stratified programs under the extended CWA
- Seki, Itoh
- 1988
(Show Context)
Citation Context ...everal extensions of SLD resolution with memoing have been studied, including extension tables [12], OLDT resolution [36], and QSQR [41]. These techniques have been generalized to stratified programs =-=[16, 34]-=- and modularly stratified programs [32]. Example 1.1 Consider the following program: e(a; b): e(b; c): e(b; a): tc(X; Y ) / e(X; Y ): tc(X; Y ) / e(X; Z); tc(Z; Y ): The SLD tree for / tc(a; V ) is in... |

21 |
Completeness of a top-down query evaluation procedure for stratified databases
- Kemp, Topor
- 1988
(Show Context)
Citation Context ...everal extensions of SLD resolution with memoing have been studied, including extension tables [12], OLDT resolution [36], and QSQR [41]. These techniques have been generalized to stratified programs =-=[16, 34]-=- and modularly stratified programs [32]. Example 1.1 Consider the following program: e(a; b): e(b; c): e(b; a): tc(X; Y ) / e(X; Y ): tc(X; Y ) / e(X; Z); tc(Z; Y ): The SLD tree for / tc(a; V ) is in... |

16 | Query restricted bottom-up evaluation of normal programs
- Kemp, Srivastava, et al.
- 1992
(Show Context)
Citation Context ...n, the major issue becomes maintaining dependencies among magic tuples (or subgoals) so as to ensure that a positive subgoal is fully evaluated before its negative counterpart is resolved. Kemp et al =-=[15]-=- developed a technique that computes the well founded semantics using a double program, one for deriving definitely true and false answers and the other for deriving possibly true or false answers. Ho... |

14 |
Towards a Programming Methodology Founded on Partial Deduction
- Komorowski
(Show Context)
Citation Context ... 3 Query Evaluation as Partial Deduction Partial deduction is a program transformation technique that specializes a logic program with respect to a goal to produce a more efficient or simpler program =-=[17, 19]-=-. The new program should be equivalent to the original one as far as the goal is concerned. Applications of partial deduction (or partial evaluation), especially to meta programming, have been investi... |

11 |
The Semantics of Deductive Databases
- Ross
- 1991
(Show Context)
Citation Context ...moing have been studied, including extension tables [12], OLDT resolution [36], and QSQR [41]. These techniques have been generalized to stratified programs [16, 34] and modularly stratified programs =-=[32]-=-. Example 1.1 Consider the following program: e(a; b): e(b; c): e(b; a): tc(X; Y ) / e(X; Y ): tc(X; Y ) / e(X; Z); tc(Z; Y ): The SLD tree for / tc(a; V ) is infinite. Figure 1 shows the OLDT forest ... |

8 |
An evaluation procedure for all logic programs
- Bidoit, Legay
- 1990
(Show Context)
Citation Context ...nly detects positive loops, but also avoids redundant computation of identical subgoals. Mechanisms for detecting and handling negative loops in this framework have also been studied, including WELL! =-=[6]-=- and XOLDTNF resolution [10]. Imagine a negative looping branch in an SLDNF tree. The key idea to detect negative loops is to maintain for each subgoal the set of ground negative literals that have be... |

2 |
Literature list for partial evaluation and mixed computation
- Sestoft, Zamulin
- 1987
(Show Context)
Citation Context ...original one as far as the goal is concerned. Applications of partial deduction (or partial evaluation), especially to meta programming, have been investigated. (see [7] for an extensive bibliography =-=[35]-=- on partial evaluation.) In this paper we use partial deduction for query evaluation with respect to three-valued stable models. The specialized program for a goal will not contain arbitrary clauses, ... |

1 |
Implementations of the well founded semantics
- Chen, Swift, et al.
(Show Context)
Citation Context ...general logic programs P , determining whether P has a (two-valued) stable model is NP-complete. Several implementations of SLG resolution have been carried out in Quintus Prolog as meta interpreters =-=[9]-=-. They all use a left-most computation rule, but different strategies for the selection of transformations. We conclude with a brief discussion of implementation details. 2 Three-Valued Stable Models ... |