Abstract
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.
Preview
Unable to display preview. Download preview PDF.
References
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.
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.
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.
Beeri, C. and R. Ramakrishnan. “On the Power of Magic,” in Proc. SIGACT-SIGMOD Principles of Database Systems Conference (PODS), 1987.
Byrd, L.. “Understanding the Control Flow of Prolog Programs,” in Proc. of the Logic Programming Workshop, 1980.
Henschen, L. and S. Naqvi “On Compiling Queries in Recursive First-Order Databases,” in J. ACM 31, 1(Jan. 1984), pp. 47–85.
Krishnamurthy, R., and C. Zaniolo. “Optimization in a Logic Based Language for Knowledge and Data Intensive Applications,” Extending Data Base Technology, Venice, 1988.
Lloyd, J.W. Foundations of Logic Programming, Springer Verlag, 1984.
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.
Michie, D. “'Memo’ Functions and Machine Learning,” in Nature, April 1968.
Nilson, N.J. Principles of Artificial Intelligence, Tioga Publishing Company, 1980.
Naqvi, S. A. and S. Tsur. A Language for Data and Knowledge Bases, W.H. Freeman, 1989.
Pereira, L.M. and A. Porto. “Selective Backtracking,” in Logic Programming, edited by K.L. Clark and S.A. Tärnlund, Academic Press, 1982.
Ramakrishnan, R., C. Beeri, and R. Krishnamurthy. “Optimizing Existential Queries,” in Proc. SIGACT-SIGMOD Principles of Database Systems Conference (PODS), Austin, April 1988.
Sacca, D. and C. Zaniolo. “The Generalized Counting Method for Recursive Logic Queries,” in Proc. 1st Int. Conf. on Database Theory, Rome, 1986.
Ullman, J. “Implementation of Logical Query Languages for Databases,” in TODS, Vol. 10, No. 3, pp. 289–321, 1985.
Ullman, J. Database and Knowledge Systems, Vol. I, Computer Science Press, 1988.
Ullman, J. Database and Knowledge Systems, Vol. II, Computer Science Press, 1989.
Vieille, L. “Recursive Query Processing: The Power of Logic,” to appear in Theoretical Computer Science, 1989.
Wadsworth, C.P., “Semantics and Pragmatics of the Lambda-Calculus,” D. Phil. Thesis, University of Oxford, 1971.
Warren, D.H.D. “An Abstract Prolog Instruction Set,” Technical Note 309, SRI International, 1983
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chimenti, D., Gamboa, R., Krishnamurthy, R. (1990). Abstract machine for \(\mathcal{L}\mathcal{D}\mathcal{L}\) . In: Bancilhon, F., Thanos, C., Tsichritzis, D. (eds) Advances in Database Technology — EDBT '90. EDBT 1990. Lecture Notes in Computer Science, vol 416. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0022169
Download citation
DOI: https://doi.org/10.1007/BFb0022169
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-52291-1
Online ISBN: 978-3-540-46948-3
eBook Packages: Springer Book Archive