Skip to main content
Log in

An Efficient Evaluation Technique for Non-Stratified Programs by Transformation to Explicitly Locally Stratified Programs

  • Published:
Journal of Systems Integration

Abstract

We give a simple transformation from normal programs with no stratification (local, weak, modular, etc.) into a subclass of the locally stratified programs, called Explicitly Locally Stratified (ELS) programs, for which there are efficient evaluation techniques. One set of predicates are generated for the true tuples and a different set of predicate are generated for the true and undefined tuples. A similar transformation is given that incorporates a magic sets like transformation. Previous approaches to magic sets transformations of unstratified programs either restricted the class of sips used or generated a program that required special treatment of the magic sets predicates. Our transformation does not suffer from these flaws.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. I. Balbin and K. Ramamohanarao, “A generalization of the differential approach to recursive query evaluation. ” Journal of Logic Programming 4(3), pp. 259–262, September 1987.

    Article  Google Scholar 

  2. F. Bancilhon, “Naive evaluation of recursively defined relations”. In (M. Brodie and J. Mylopoulos, eds.) On Knowledge-Base Management Systems-Integrating Database and AI Systems, pages 165–178. Springer-Verlag: New York, 1986.

    Google Scholar 

  3. F. Bancilhon, D. Maier, Y Sagiv, and J. D. Ullman, “Magic sets and other strange ways to implement logic programs, ” in Proceedings of the Fifth ACM PODS Symposium on Principles of Database Systems, 1986, pp. 1–15.

  4. C. Beeri and R. Ramakrishnan, “On the power of magic, ”in Proceedings ofthe Sixth ACM PODS Symposium on Principles of Database Systems, 1987, pp. 269–283.

  5. Keith L. Clark, “Negation as failure. ” In (Herve Gallaire and Jack Minker, eds.), Logic and Data Bases. Plenum Press, 1978, pp. 293–322.

  6. Sergio Greeo, Carlo Zaniolo, and Sumit Ganguly, “Greedy by choice, ” in Proceedings of the Eleventh ACM PODS Symposium on Principles of Database Systems, 1992, pp. 105–113.

  7. David Kemp and Kotagiri Ramamohanarao, “Efficient recursive aggregation and negation in deductive databases. ” Technical Report 96/1, Department of Information System, University of Melbourne, Australia, 1996.

    Google Scholar 

  8. David B. Kemp and Kotagiri Ramamohanarao, “A deductive database solution to the preferential vote counting problem, ” in Proceedings of the Second ICLP-Workshop on Deductive Databases, June 1994, pp. 143–158.

  9. David B. Kemp and Kotagiri Ramamohanarao, “Syntactically recognizable modularly stratified programs, ” in Proceedings of the 5th Australasian Database Conference, January 1994, pp. 147–161. An extended version of this paper has been written as University of Melbourne, Computer Science Department Technical Report 93/15.

  10. David B. Kemp, Divesh Srivastava, and Peter J. Stuckey, “Bottom-up evaluation and query optimization of well-founded models. ” Theoretical Computer Science 146(1–2), pp. 145–184, July 1995.

    Article  Google Scholar 

  11. Phokion G. Kolaitis and Christos H. Papadimitriou, “Why not negation by fixpoint?” in Proceedings of the Seventh ACM Symposium on Principles of Database Systems, March 1988, pp. 231–239.

  12. J. W. Lloyd, Foundations of Logic Programming, second edition. Springer Series in Symbolic Computation. Springer Verlag: New York, 1987.

    Google Scholar 

  13. Shinichi Morishita, “An alternating fixpoint tailored to magic programs, ” in PODS' 93, 1993, pp. 123–134.

  14. Teodor C. Przymusinski, “On the declarative semantics of deductive databases and logic programs. ” In (Jack Minker, ed.) Foundations of Deductive Databases and Logic Programming. Morgan Kaufmann Publishers, 1988, pp. 193–216.

  15. Raghu Ramakrishnan, Divesh Srivastava, and S. Sudarshan, “Controlling the search in bottom-up evaluation, ” in Proceedings of the 1992 Joint International Conference and Symposium on Logic Programming, November 1992, pp. 273–287.

  16. Raghu Ramakrishnan, Divesh Srivastava, S. Sudarshan, and Praveen Seshadri, “The coral deductive system. ” The VLDB Journal 3(2), pp. 161–210, 1994.

    Google Scholar 

  17. Ken A. Ross, “Modular stratification and magic sets for DATALOG programs with negation, ” in Proceedings of the Ninth ACM PODS Symposium on Principles of Database Systems, 1990, pp. 161–171. An extended version of this paper, containing new results, was obtained from the author.

  18. J. D. Ullman, Principles of Database and Knowledge-Base Systems, Vol. I. Computer Science Press: New York, 1988.

    Google Scholar 

  19. J. D. Ullman, Principles of Database and Knowledge-Base Systems, Vol. II: The New Technologies. Computer Science Press: New York, 1989.

    Google Scholar 

  20. Jayen Vaghani, Kotagiri Ramamohanarao, David B. Kemp, Zoltan Somogyi, Peter J. Stuckey, Tim S. Leask, and James Harland, “The Aditi deductive database system. ” The VLDB Journal 3(2), pp. 245–288, 1994.

    Google Scholar 

  21. A. van Gelder, K. A. Ross, and J. S. Schlipf, “The well-founded semantics for general logic programs. ” Journal of the ACM 38(3), pp. 620–650, 1991.

    Article  Google Scholar 

  22. Allen van Gelder, “The alternating fixpoint of logic programs with negation:” in Proceedings of the Eighth. ACM PODS Symposium on Principles of Database Systems, 1989, pp. 1–10.

  23. Carlo Zaniolo, Natraj Ami, and Kayliang Ong, “ Negation and aggregates in recursive rules: The LDL + + approach. ” in Proceedings of the Third International Conference on Deductive and Object-Oriented Databases, December 1993, pp. 204–221.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Kemp, D.B., Ramamohanarao, K. & Stuckey, P.J. An Efficient Evaluation Technique for Non-Stratified Programs by Transformation to Explicitly Locally Stratified Programs. Journal of Systems Integration 7, 191–230 (1997). https://doi.org/10.1023/A:1008275219746

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1008275219746

Navigation