Abstract
We propose a new data structure for implementing delayed computations in Prolog as efficiently as commonly employed solutions, together with the optimal memory management needed for this data structure. It appears that this data structure (and the associated memory management) is also useful for implementing other extensions where there is a need for reversibly modifying terms other than in the leaves, e.g. functional extensions.
We first recall that optimal memory management in Prolog is possible only when considering the binding states in a precise manner.
Then we describe the classical implementation of delayed computations, along with the new memory management problems involved. The conclusion is that a correct implementation, w.r.t memory management, is only possible when introducing a new data structure which is known by the garbage collector.
A memory management machine, called MALI, has been realized in our group following the principles described, and offering such a data structure, called the attributed variable. On top of this machine, we have implemented a number of extensions to Prolog.
In the course of our experiments, we have verified that the initial choice in the design of MALI, i.e. to make it independent from the procedural semantics of Prolog, was a good choice. Indeed, we have been able to implement various logic programming systems extending the so-called “pure-Prolog”, ranging from PrologII to λ-Prolog and fair proof strategies.
Preview
Unable to display preview. Download preview PDF.
Bibliography
Y. Bekkers, B. Canet, O. Ridoux, L. Ungaro: A Short Note on Garbage Collection in Prolog Interpreters Logic Programming Newsletter, No 5, Lisboa, Portugal, 1983.
Y. Bekkers, B. Canet, O. Ridoux, L. Ungaro: A Memory Management Machine for Prolog Interpreters Proc. of the 2nd ICLP, Uppsala, Sweden, 1984.
Y. Bekkers, B. Canet, O. Ridoux, L. Ungaro: MALI: A Memory with a Real-Time Garbage Collector for Implementing Logic Programming Languages Proc. of the 3rd SLP, IEEE, Salt-Lake City, USA, 1986.
P.G. Bosco, E. Giovannetti: IDEAL: An Ideal Deductive Applicative Language Proc. of the 3rd SLP, Salt-Lake City, USA, 1986.
P. Brisset: Implémentation d'un langage de programmation logique d'ordre supérieur avec MALI Proc. of SPLT90, Trégastel, France, 1990.
M. Bruynooghe: A Note on Garbage Collection in Prolog Interpreters Proc. of the 1st ICLP, Marseilles, France, 1982.
M. Carlsson: Freeze, Indexing, and Other Implementation Issues in the WAM Logic Programming 2, J.L. Lassez, Ed, MIT Press, 1987.
L. Chevallier, S. Le Huitouze, O. Ridoux: Style de programmation poour une machine de programmation logique munie d'un récupérateur de mémoire Proc. of SPLT87, Trégastel, France, 1990.
L. Chevallier, S. Le Huitouze, O. Ridoux: Programmation of a Garbage Collection Logic Programming Machine Proc. of French-Soviet Workshop INFORMATIKA 88 on Methods of Compilation and Program Construction, INRIA, Nice, France, 1988.
S. Janot: Programmation logique avec des interpréteurs équitables Proc. of SPLT88, Trégastel, France, 1988.
S. Le Huitouze: Mise en oeuvre de PrologII/MALI Thesis, Université de Rennes I, 1988.
U. Neumerkel: Extensible Unification by Metastructures Proc. of META90, Leuven, Belgium, 1990.
E. Pittomvills, M. Bruynooghe, Y.D. Willems: Towards a Real Time Garbage Collector for Prolog Proc. of the 2nd Symposium on Logic Programming, 1985.
M. Van Caneghem: L'anatomie de PrologII Thesis, Université d'Aix-Marseille, 1984.
D.H.D. Warren: 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
Le Huitouze, S. (1990). A new data structure for implementing extensions to Prolog. In: Deransart, P., Maluszyński, J. (eds) Programming Language Implementation and Logic Programming. PLILP 1990. Lecture Notes in Computer Science, vol 456. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0024181
Download citation
DOI: https://doi.org/10.1007/BFb0024181
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-53010-7
Online ISBN: 978-3-540-46298-9
eBook Packages: Springer Book Archive