Magic Sets and Bottom-Up Evaluation of Well-Founded Models

We present a bottom-up operational procedure for computing well-founded models of allowed DATALOG programs with negation. This procedure provides a practical method of handling programs that involve unstratiied negation in a manner that may be mixed with other evaluation approaches, such as semi-naive evaluation. We also deene classes of programs and sips for which the magic sets transformation preserves well-founded models with respect to the query. The class of programs and sips we consider strictly subsume those already considered in the literature, and include stratiied programs (with any choice of sips), modularly stratiied programs (with left-to-right sips) and programs with three-valued well-founded models (with well-founded sips). For these programs and sips, our procedure for computing well-founded models is applicable to the magic programs, thus allowing increased eeciency by specializing a program for a query.

[1]  Adrian Walker,et al.  Towards a Theory of Declarative Knowledge , 1988, Foundations of Deductive Databases and Logic Programming..

[2]  François Bancilhon,et al.  Naive Evaluation of Recursively Defined Relations , 1986, On Knowledge Base Management Systems.

[3]  Catriel Beeri,et al.  On the power of magic , 1987, J. Log. Program..

[4]  Allen Van Gelder,et al.  The Alternating Fixpoint of Logic Programs with Negation , 1993, J. Comput. Syst. Sci..

[5]  Kenneth A. Ross,et al.  Unfounded sets and well-founded semantics for general logic programs , 1988, PODS.

[6]  Allen Van Gelder,et al.  Negation as Failure using Tight Derivations for General Logic Programs , 1988, J. Log. Program..

[7]  Kotagiri Ramamohanarao,et al.  Design overview of the Aditi deductive database system , 1991, [1991] Proceedings. Seventh International Conference on Data Engineering.

[8]  Jeffrey D. Ullman,et al.  Bottom-up beats top-down for datalog , 1989, PODS '89.

[9]  K. A. Ross Modular stratification and magic sets for DATALOG programs with negation , 1990, PODS 1990.