Skip to main content
Log in

State‐saving transformations for efficient bottom‐up evaluation of logic programs and rule‐based systems

  • Published:
Annals of Mathematics and Artificial Intelligence Aims and scope Submit manuscript

Abstract

Redundant computations in bottom‐up evaluation of logic programs and rule‐based systems can be avoided by caching intermediate joins – i.e., partial rule instantiations – for later use. Joins can be cached either at representation level by program transformation techniques introducing supplementary predicates or at implementation level by specialized implementation techniques using internal memory cells. The efficiency of these state‐saving techniques depends on the selection of premises for storing the joins. In this paper we first present a general program transformation technique for saving joins which heuristically reorders subgoals and performs predicate splitting optimization, an extension of unfolding. This state‐saving transformation can be applied for any goal‐directed and model‐generation evaluation. It does not require any information about the query. We show that the program transformation approach is equivalent to the specialized state‐saving implementations known from production systems and model‐generation theorem provers. To use the efficient and complete bottom‐up evaluation also for query answering, we improve the supplementary extensions of Generalized Magic Sets and Magic Templates rewriting strategies by the presented state‐saving transformation.

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.

Institutional subscriptions

Similar content being viewed by others

References

  1. I. Balbin, G.S. Port, K. Ramamohanarao and K. Meenakshi, Efficient bottom-up computation of queries on stratified databases, Journal of Logic Programming 11 (1991) 295–344.

    Article  MATH  MathSciNet  Google Scholar 

  2. I. Balbin and K. Ramamohanarao, A generalization of the differential approach to recursive query evaluation, Journal of Logic Programming 4 (1987) 259–262.

    Article  MATH  MathSciNet  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 5th ACM SIGMOD-SIGACT Symposium on Principles of Database Systems (ACM, 1986) pp. 1–15.

  4. F. Bancilhon and R. Ramakrishnan, An amateur's introduction to recursive query processing strategies, in: Proceedings of the ACM SIGMOD Conference (ACM, 1986) pp. 16–52.

  5. F. Bancilhon and R. Ramakrishnan, Performance evaluation of data intensive logic programs, in: Foundations of Deductive Databases and Logic Programming, ed. J. Minker (Morgan-Kaufmann Publishers, Inc., Los Altos, CA, 1988) pp. 441–517.

    Google Scholar 

  6. C. Beeri and R. Ramakrishnan, On the power of magic, Journal of Logic Programming 10 (October 1991) 255–299.

    Article  MATH  MathSciNet  Google Scholar 

  7. H. Boley, P. Hanschke, K. Hinkelmann and M. Meyer, COLAB: A hybrid knowledge compilation laboratory, Annals of Operations Research 55 (1995) 11–79.

    Article  MATH  Google Scholar 

  8. F. Bry, Query evaluation in recursive databases: bottom-up and top-down reconciled, Data and Knowledge Engineering 5 (1990) 289–312.

    Article  Google Scholar 

  9. C.L. Forgy, Rete: A fast algorithm for the many pattern / many object pattern match problem, Artificial Intelligence 19 (1982) 17–37.

    Article  Google Scholar 

  10. M. Fujita, R. Hasegawa, M. Koshimura and H. Fujita, Model generation theorem provers on a parallel inference machine, in: Proceedings of the International Conference on Fifth Generation Computer Systems (Association for Computing Machinery, ICOT, Japan, 1992) pp. 357–375.

    Google Scholar 

  11. K. Hinkelmann, A consequence-finding approach for feature recognition in CAPP, in: Seventh International Conference on Industrial & Engineering Applications of Artifical Intelligence & Expert Systems (IEA/AIE'94), Austin, Texas (Gordon and Breach Science Publishers, 1994) pp. 2–11.

  12. K. Hinkelmann, Knowledge-base rewriting for bottom-up abduction and integrity checking, in: Deductive Databases and Logic Programming — Abduction in Deductive Databases and Knowledge-based Systems, Proceedings of the ICLP'95 Joint Workshop, eds. H. Decker, U. Geske, T. Kakas, C. Sakama, D. Seipel and T. Urpi, GMD-Studien Nr. 266 (June 1995) pp. 127–141.

  13. K. Hinkelmann, Transformation von Hornklausel-Wissensbasen: Verarbeilung gleichen Wissens durch verschiedene Inferenzen, Dissertationen zur Künstlichen Intelligenz, Band 81, infix, St. Augustin (1995). PhD Thesis, in German.

  14. K. Inoue, Consequence-finding based on ordered linear resolution, in: Proc. of the 12th IJCAI, Sidney, Australia (1991).

  15. K. Inoue, Y. Ohta, R. Hasegawa and M. Nakashima, Bottom-up abduction by model generation, in: Proc. of the 13th IJCAI (1993) pp. 102–108.

  16. R. Krishnamurthy, H. Boral and C. Zaniolo, Optimization of nonrecursive queries, in: Proceedings of the 12th International Conference on Very Large Databases (VLDB) (1986) pp. 128–137.

  17. D.P. Miranker, TREAT: A better match algorithm for AI production systems, in: Proc. of AAAI-87 (Philadelphia, PA, 1987) pp. 42–47. Extended Version as Technical Report AI TR87-58, University of Texas at Austin.

  18. K.A. Morris, An algorithm for ordering subgoals in NAIL!, in: Proceedings of the Seventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS'88) (ACM Press, 1988).

  19. P. Nayak, A. Gupta and P. Rosenbloom, Comparison of the Rete and Treat production matchers for Soar (a summary), in: Proc. of AAAI-88 (St. Paul, MN, 1988) pp. 693–698.

  20. R. Ramakrishnan, Magic templates: A spellbinding approach to logic programms, in: Proceedings of the 5th International Conference and Symposium on Logic Programming, eds. R.A. Kowalski and K.B. Bowen (1988).

  21. J. Rohmer, R. Lescoeur and J.M. Kerisit, The Alexander method — a technique for the processing of recursive axioms in deductive databases, in: New Generation Computing (1986) pp. 273–285.

  22. D. Sacca and C. Zaniolo, The generalized counting method for recursive logic queries, in: First International Conference on Database Theory (1986).

  23. F. Sadri and R. Kowalski, A theorem-proving approach to database integrity, in: Foundations of Deductive Databases and Logic Programming, ed. J. Minker (Morgan-Kaufmann Publishers, Inc., Los Altos, CA, 1988) pp. 313–362.

    Google Scholar 

  24. D.E. Smith and M.R. Genesereth, Ordering conjunctive queries, Artificial Intelligence 26 (1985) 171–215.

    Article  MATH  MathSciNet  Google Scholar 

  25. M.E. Stickel, Upside-down meta-interpretation for the model-elimination theorem-proving procedure for deduction and abduction, Technical Report TR-664, ICOT (July 1991).

  26. H. Tamaki and T. Sato, Unfold/fold transformations of logic programs, in: Proceedings of the Second International Conference on Logic Programming (Uppsala, 1984) pp. 127–138.

  27. J.D. Ullman, Principles of Database and Knowledge-Base Systems, Vol. 2 (Computer Science Press, Rockville, Maryland USA, 1989).

    Google Scholar 

  28. J.D. Ullman and M.Y. Vardi, The complexity of ordering subgoals, in: Proceedings of the Seventh ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS'88) (ACM Press, 1988).

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Hinkelmann, K., Hintze, H. State‐saving transformations for efficient bottom‐up evaluation of logic programs and rule‐based systems. Annals of Mathematics and Artificial Intelligence 20, 335–356 (1997). https://doi.org/10.1023/A:1018940713446

Download citation

  • Issue Date:

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

Keywords

Navigation