The generalized counting method for recursive logic queries

  • Domenico Saccà
  • Carlo Zaniolo
Invited Lectures
Part of the Lecture Notes in Computer Science book series (LNCS, volume 243)

Abstract

This paper treats the problem of implementing efficiently recursive Horn Clauses queries, including those with function symbols. In particular, the situation is studied where the initial bindings of the arguments in the recursive query goal can be used in the top-down (as in backward chaining) execution phase to improve the efficiency and, often, to guarantee the termination, of the forward chaining execution phase that implements the fixpoint computation for the recursive query. A general method is given for solving these queries; the method performs an analysis of the binding passing behavior of the query, and then reschedules the overall execution as two fixpoint computations derived as results of this analysis. The first such computation emulates the propagation of bindings in the top-down phase; the second generates the desired answer by proving the goals left unsolved during the previous step. Finally, sufficient conditions for safety are derived, to ensure that the fixpoint computations are completed in a finite number of steps.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [AhUl]
    Aho A. V. and J. Ullman, “ Universality of Data Retrieval Languages,” Proc. POPL Conference, San Antonio Tx, 1979.Google Scholar
  2. [AC]
    Aiello, L. and Cecchi, “Adding a Closure Operator to the Extended Relational Algebra ...”, Rome Univ. Technical Report, 1985.Google Scholar
  3. [B]
    Bancilhon, F., “Naive Evaluation of Recursively defined Relations”, Unpublished Manuscript, 1985.Google Scholar
  4. [BGK]
    Bayer, R., U. Guntzer and W. Kiessling, “On the Evaluation of Recursion in Deductive DB Systems by Efficient Differential Fixpoint Iteration,” Technical Report, Technische Univ. Munich, 1985.Google Scholar
  5. [BMSU1]
    Bancilhon, F., D. Maier, Y. Sagiv, J. Ullman, “Magic sets and other strange ways to implement logic programs”, Proc. 5th ACM SIGMODSIGACT Symp. on Principles of Database Systems, 1986.Google Scholar
  6. [BMSU2]
    Bancilhon, F., D. Maier, Y. Sagiv, J. Ullman, “Magic sets: algorithms and examples”, unpublished manuscript, 1985.Google Scholar
  7. [BR]
    Bancilhon, F., Ramakrishan, R., “An amateur's introduction to recursive query processing strategies”, Proc. ACM SIGMOD Int. Conference on Management of Data, Washington, D.C., May 1986.Google Scholar
  8. [CH]
    Chandra, A.K., Harel, D., “Horn clauses and the fixpoint hierarchy”, Proc. ACM SIGMOD-SIGACT Symp. on Principles of Database Systems, 1982, pp. 158–163.Google Scholar
  9. [GD]
    Gardarin, G., DeMaindreville, C., “ Evaluation of Database Recursive Logic Programs as Recursive Function Series,” Proc. ACM SIGMOD Int. Conference on Management of Data, Washington, D.C., May 1986.Google Scholar
  10. [HN]
    Henschen, L.J., Naqvi, S. A., “On compiling queries in recursive first-order databases”, JACM 31, 1, 1984, pp. 47–85.Google Scholar
  11. [L]
    Lozinskii, E.L., “Inference by generating and structuring of deductive databases”, Report 84-11, Dept. of Computer Science, Hebrew University, Israel.Google Scholar
  12. [MS]
    McKay, D., Shapiro, S., “Using active connection graphs for reasoning with recursive rules”, Proc. 7th IJCAI, 1981, pp. 368–374.Google Scholar
  13. [P]
    Parker, S. et al., “Logic Programming and Databases,” in Expert Database Systems, L. Kerschberg (ed.), Benjamin/Cummings, 1986.Google Scholar
  14. [R]
    Reiter, R., “On closed world databases”, in Logic and Databases (Gallaire, H., Minker, J., eds), Plenum, New York, 1978, pp. 55–76.Google Scholar
  15. [SZ1]
    Saccà, D., Zaniolo, C., “On the implementation of a simple class of logic queries for databases”, Proc. 5th ACM SIGMOD-SIGACT Symp. on Principles of Database Systems, 1986.Google Scholar
  16. [SZ2]
    Saccà, D., Zaniolo, C., “Implementation of recursive queries for a data language based on pure Horn clauses”, unpublished manuscript, 1986.Google Scholar
  17. [SZ3]
    Saccà, D., Zaniolo, C., “Techniques for Solving Recursive queries in a Logic Based Language,” in preparation.Google Scholar
  18. [U1]
    Ullman, J.D., Principles of Database Systems, Computer Science Press, Rockville, Md., 1982.Google Scholar
  19. [T1]
    Tarski, A. “A Lattice Theoretical Fixpoint Theorem and its Application,” Pacific Journal of Mathematics No. 5, pp. 285–309, 1955.Google Scholar
  20. [UV]
    Ullman, J.D. and A. Van Gelder, “Testing Applicability of Top-Down Capture Rules,” Stanford University, Report STAN-CS-85-1046, 1985.Google Scholar
  21. [U2]
    Ullman, J.D., “Implementation of logical query languages for databases”, TODS 10, 3, 1985, pp. 289–321.Google Scholar
  22. [VK]
    van Emden, M.H., Kowalski, R., “The semantics of predicate logic as a programming language”, JACM 23, 4, 1976, pp. 733–742.Google Scholar
  23. [Vg]
    Van Gelder, A., “A Message Passing Framework for Logical Query Evaluation,” Proc. ACM SIGOD Int. Conference on Management of Data, Washington, D.C., May 1986.Google Scholar
  24. [Vi]
    Vieille, L. “Recursive Axioms in Deductive Databases: the Query-Subquery Approach,” Proc. First Int. Conference on Expert Database Systems, Charleston, S.C., 1986.Google Scholar
  25. [Z1]
    Zaniolo, C. “Prolog: a database query language for all seasons,” in Expert Database Systems, L. Kerschberg (ed.), Benjamin/Cummings, 1986.Google Scholar
  26. [Z2]
    Zaniolo, C. “The Representation and Deductive Retrieval of Complex Objects,” Proc. 11-th VLDB, pp. 459–469, 1985.Google Scholar
  27. [Z3]
    Zaniolo, C. “Safety and Compilation of Non-Recursive Horn Clauses,” Proc. First Int. Conference on Expert Database Systems, Charleston, S.C., 1986.Google Scholar

Copyright information

© Springer-Verlag 1986

Authors and Affiliations

  • Domenico Saccà
    • 1
  • Carlo Zaniolo
    • 2
  1. 1.CRAIRendeItaly
  2. 2.MCCAustinUSA

Personalised recommendations