Abstract
This paper presents a novel implementation of memoing evaluation [SSW94] by source-to-source transformation. The transformation proceeds in two steps:
The first step consists of magic sets rewriting [BR91], a standard transformation in deductive databases, whose application to Prolog has not been considered yet.
The second transformation rewrites bottom-up rules to Prolog clauses. This new bottom-up to top-down transformation has useful applications besides memoing. It can be derived by partially evaluating a tupleoriented semi-naive meta-interpreter for bottom-up rules, written in Prolog.
The tuple-oriented approach to bottom-up processing permits an elegant combination of negation and magic sets rewriting.
This paper also introduces a variant of supplementary magic sets tailored to the memoing application.
This is a preview of subscription content, log in via an institution.
Preview
Unable to display preview. Download preview PDF.
References
F. Bancilhon and R. Ramakrishnan. An amateur's introduction to recursive query processing strategies, invited paper. In Proceedings of SIGMOD. 1986.
C. Beeri and R. Ramakrishnan. On the power of magic. The Journal of Logic Programming, 10:255–300, January 1991.
F. Bry. Query evaluation in recursive databases: bottom-up and top-down reconciled. Data & Knowledge Engineering, 5:289–312, 1990.
W. Burgard. Goal-Directed Forward Chaining for Logic Programs. PhD thesis, Universität Bonn, 1991.
K. De Bosschere and P. Tarau. Blackboard Communication in Logic Programming. In Proceedings of the PARCO'93 Conference, Grenoble, France, September 1993.
S.W. Dietrich. Extension tables: Memo relations in logic programming. In Proceedings of the 1987 Symposium on Logic Programming, pages 264–273, 1987.
J. Gallagher. Transforming logic programs by specialising interpreters. In European Conference on Artificial Intelligence, pages 109–122, 1986.
J. F. Naughton and R. Ramakrishnan. How to forget the past without repeating it. In 16th International Conference on Very Large Data Bases, 1990.
R. Ramakrishnan. Magic templates: A spellbinding approach to logic programs. In Robert A. Kowalski and Kenneth A. Bowen, editors, Proceedings of the Fifth International Conference and Symposium on Logic Programming, pages 140–159, Seatle, 1988. ALP, IEEE, The MIT Press.
R. Ramesh and Weidong Chen. A portable method of integrating slg resolution into prolog systems. In Logic Programming — Proceedings of the 1994 International Symposium, pages 618–632. The MIT Press, 1994.
H. Schütz. Tupelweise Bottom-up-Auswertung von Logikprorammen. PhD thesis, Technische Universität München, 1993.
K. Sagonas, T. Swift, and D.S. Warren. XSB as an efficient deductive database engine. In Proceedings of SIGMOD. 1994.
D. S. Warren. Memoing for logic programs with applications to abstract interpretation and partial deduction. In Communications of ACM. 1992.
J. E. Wunderwald. Adding Bottom-up Evaluation to Prolog (Preliminary Title). PhD thesis, Technische Universität München, to appear.
J. E. Wunderwald. Logikprogrammieren mit frei wählbarer Auswertungsrichtung. In Proceedings of the Tenth Logic Programming Workshop, Zürich, 1994.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Wunderwald, J.E. (1996). Memoing evaluation by source-to-source transformation. In: Proietti, M. (eds) Logic Program Synthesis and Transformation. LOPSTR 1995. Lecture Notes in Computer Science, vol 1048. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-60939-3_2
Download citation
DOI: https://doi.org/10.1007/3-540-60939-3_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-60939-1
Online ISBN: 978-3-540-49745-5
eBook Packages: Springer Book Archive