Abstract machine for \(\mathcal{L}\mathcal{D}\mathcal{L}\)

  • Danette Chimenti
  • Ruben Gamboa
  • Ravi Krishnamurthy
Session 4: Deductive Database Systems
Part of the Lecture Notes in Computer Science book series (LNCS, volume 416)


We propose an abstract machine for \(\mathcal{L}\mathcal{D}\mathcal{L}\) that maintains a high-level view of an \(\mathcal{L}\mathcal{D}\mathcal{L}\) program while incorporating aspects of its execution that make a performance difference. A canonical AND/OR graph corresponding to the \(\mathcal{L}\mathcal{D}\mathcal{L}\) program provides the skeleton of its execution. The nodes in the AND/OR graph are annotated to specify relevant details of the execution, such as access methods, join methods, execution strategies, intelligent backtracking etc. We formalize four execution methods (top-down, bottom-up as well as two hybrid methods that incorporate memoing) and two recursive computations (fixpoint and stack-based). The two computations and four execution methods are combined to cater to a rich variety of recursive techniques. This annotated AND/OR graph represents a declarative program for the abstract machine. The set of all possible annotated AND/OR graphs constitutes the execution space that defines the abstract machine.

To prove the feasibility of this declarative abstract machine, we demonstrate an actual realization by presenting a code generation algorithm that proceeds by translating each node in the annotated AND/OR graph into a sequence of imperative statements that include calls to a tuple-level interface of an underlying DBMS. The \(\mathcal{L}\mathcal{D}\mathcal{L}\) compiler — which supports Datalog, sets, updates, negation, non-deterministic choice and other advanced features — has been implemented using this approach.


Abstract Machine Query Form Success Point Node Table Execution Method 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Ba85]
    Bancilhon, F.D. “Naive Evaluation of Recursively Defined Relations,” in On Knowledge Base Management Systems, edited by M. Brodie and J. Mylopoulos, Springer-Verlag, 1985.Google Scholar
  2. [B*86]
    Bancilhon, F.D., D. Maier, Y. Sagiv, and J. Ullman. “Magic Sets and Other Strange Ways to Implement Logic Programs,” in Proc. SIGACT-SIGMOD Principles of Database Systems Conference (PODS), 1986.Google Scholar
  3. [BR86]
    Bancilhon, F.D. and R. Ramakrishnan. “An Amateur's Introduction to Recursive Query Processing Strategies,” in Proc. SIGACT-SIGMOD Int. Conf. on Management of Data (SIGMOD), Washington D.C., 1986.Google Scholar
  4. [BR87]
    Beeri, C. and R. Ramakrishnan. “On the Power of Magic,” in Proc. SIGACT-SIGMOD Principles of Database Systems Conference (PODS), 1987.Google Scholar
  5. [By80]
    Byrd, L.. “Understanding the Control Flow of Prolog Programs,” in Proc. of the Logic Programming Workshop, 1980.Google Scholar
  6. [HN84]
    Henschen, L. and S. Naqvi “On Compiling Queries in Recursive First-Order Databases,” in J. ACM 31, 1(Jan. 1984), pp. 47–85.CrossRefGoogle Scholar
  7. [KZ88]
    Krishnamurthy, R., and C. Zaniolo. “Optimization in a Logic Based Language for Knowledge and Data Intensive Applications,” Extending Data Base Technology, Venice, 1988.Google Scholar
  8. [Ll84]
    Lloyd, J.W. Foundations of Logic Programming, Springer Verlag, 1984.Google Scholar
  9. [Me82]
    Mellish, C. “An Alternative to Structure Sharing in the Implementation of a Prolog Interpreter,” in Logic Programming, edited by K.L. Clark and S.A. Tärnlund, Academic Press, 1982.Google Scholar
  10. [Mi68]
    Michie, D. “'Memo’ Functions and Machine Learning,” in Nature, April 1968.Google Scholar
  11. [Nil80]
    Nilson, N.J. Principles of Artificial Intelligence, Tioga Publishing Company, 1980.Google Scholar
  12. [NT89]
    Naqvi, S. A. and S. Tsur. A Language for Data and Knowledge Bases, W.H. Freeman, 1989.Google Scholar
  13. [PP82]
    Pereira, L.M. and A. Porto. “Selective Backtracking,” in Logic Programming, edited by K.L. Clark and S.A. Tärnlund, Academic Press, 1982.Google Scholar
  14. [RBK88]
    Ramakrishnan, R., C. Beeri, and R. Krishnamurthy. “Optimizing Existential Queries,” in Proc. SIGACT-SIGMOD Principles of Database Systems Conference (PODS), Austin, April 1988.Google Scholar
  15. [SZ86]
    Sacca, D. and C. Zaniolo. “The Generalized Counting Method for Recursive Logic Queries,” in Proc. 1st Int. Conf. on Database Theory, Rome, 1986.Google Scholar
  16. [Ull85]
    Ullman, J. “Implementation of Logical Query Languages for Databases,” in TODS, Vol. 10, No. 3, pp. 289–321, 1985.Google Scholar
  17. [Ull88]
    Ullman, J. Database and Knowledge Systems, Vol. I, Computer Science Press, 1988.Google Scholar
  18. [Ull89]
    Ullman, J. Database and Knowledge Systems, Vol. II, Computer Science Press, 1989.Google Scholar
  19. [Vi89]
    Vieille, L. “Recursive Query Processing: The Power of Logic,” to appear in Theoretical Computer Science, 1989.Google Scholar
  20. [Wa71]
    Wadsworth, C.P., “Semantics and Pragmatics of the Lambda-Calculus,” D. Phil. Thesis, University of Oxford, 1971.Google Scholar
  21. [Wa83]
    Warren, D.H.D. “An Abstract Prolog Instruction Set,” Technical Note 309, SRI International, 1983Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1990

Authors and Affiliations

  • Danette Chimenti
    • 1
  • Ruben Gamboa
    • 1
  • Ravi Krishnamurthy
    • 1
  1. 1.MCC, 3500 West Balcones Center DriveAustin

Personalised recommendations