Abstract
Partial Evaluation in Prolog (generally associated to Folding/Unfolding techniques) is a code optimization technique, which transforms a readable and structured program in a more efficient program (that is to say better adapted to the interpreter or compiler). These programs are Prolog programs semantically equivalent with respect to the least Herbrand model. Our context is the operational equivalence of programs, and not the efficiency of program transformations.
We introduce first the notion of Strong Operational Equivalence (s.-o.e.), and then we propose to study strong operational equivalence preserving transformations. Strong operational equivalence means that the solution order is preserved and, when using inference as complexity unit, the runtime of any solution in the transformed program is linearly dependent on the runtime of the corresponding solution in the original program. This equivalence allows us to consider programs including non-logical features. We will restrict our study to Cut and Read/Write predicates and our framework is the standard resolution (depth first, leftmost atom).
Then, two meta-interpreters are studied. Using the Vanilla meta-interpreter and a new meta-interpreter (that we introduce and call quasiiterative meta-interpreter), we show that any Prolog program ? can be transformed to a meta-program (that is, an instance of these metainterpreters) which is strongly operationally equivalent to the original one. The structure of the quasi-iterative meta-interpreter is the simpliest one known up to date, that is, composed of three unit clauses and one right linear recursive rule.
partially supported by the G.D.R. Greco de la Programmation
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
C. Böhm and G. Jacopini, Flow diagrams, Türing machines and languages with only two formation rules, Communications of ACM, vol. 9, pages 366–371, 1966.
M. Bugliesi and F.Russo, Partial Evaluation in Prolog: some Improvements about Cut, in Proceedings of the north-american conference on logic programming, pages 645-660, 1989.
J.-P.Delahaye, Sémantique logique et dénotationnelle des interpréteurs Prolog, Informatique Théorique et Applications, Vol. 22, n. 1, 1988, pages 3–42.
F.Denis and J.-P.Delahaye, Unfolding, Procedural and Fixpoint Semantics of Logic Programs, in Proceedings of STACS’91, Lecture Notes in Computer Science, vol.480, Springer-Verlag Ed., pages 511-522.
H. Fujita, An algorithm for partial evaluation with constraints, ICOT Technical Memorandum, ICOT 1987.
J. Gallagher and M. Bruynooghe, Some low-level source transformations for logic programs, in Proceedings of the second workshop on meta-programming in logic, April 1990, Leuven, Belgium, Bruynooghe editor, pages 229-244.
T. Kawamura and T. Kanamori, Preservation of stronger equivalence in unfold/fold logic transformation, in Proceedings of the international conference on fifth generation computer systems, pages 413-421, ICOT 1988.
R. Kowalski, Imperial College, London, Meta-matters, in Second Workshop on Meta-programming in logic, April 1990, Louvain, Belgique.
M. Falaschi, G. Levi, C. Palamidessi and M. Martelli, Declarative Modeling of the Operational Behaviour of Logic Languages, in Theoretical Computer Science, vol. 69, 1989, pages 289–318.
J.W. Lloyd, Foundations of logic programming, Springer-Verlag, 2nd ed., 1987.
M.J. Maher, Equivalences of logic programs, in Foundations of deductive databases and logic programming, J.Minker Ed., Morgan Kaufmann Publishers, pages 627-658, 1987.
K.Marriott, L.Naish and J.-L.Lassez, Most specific logic programs, in Proceedings of the Fifth International Conference and Symposium on Logic Programming,Washington, Seattle, August 1988, pages 909-923.
A.Parrain, P.Devienne and P.Lebegue, .Equivalence Opérationnelle et Evaluation Partielle, Rapport Interne, LIFL, 1990.
M.Proietti and A.Pettorossi, Semantics Preserving Transformation Rules for Prolog, ACM Symposium on Partial Evaluation and Semantics Based Program Manipulation, New-Haven, U.S.A., 17-19 June 1991.
D. Sahlin, An Automatic Partial Evaluator for Full Prolog, Ph.D.Thesis, Swedish Institute of Computer Science, Stockholm, March 1991.
H. Tamaki and T. Sato, Unfold/Fold transformation of logic programs, in Proceedings of the second International Conference on. Logic Programming, Uppsala, 1984, pages 127-138.
R. Venken and B. Demoen, A Partial Evaluation System: some Practical Considerations, in New Generation Computing, Vol. 6, n. 2,3, pages 279–290, 1988.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1992 Springer-Verlag London
About this paper
Cite this paper
Parrain, A., Devienne, P., Lebegue, P. (1992). Prolog Program Transformations and Meta-Interpreters. In: Clement, T.P., Lau, KK. (eds) Logic Program Synthesis and Transformation. Workshops in Computing. Springer, London. https://doi.org/10.1007/978-1-4471-3494-7_17
Download citation
DOI: https://doi.org/10.1007/978-1-4471-3494-7_17
Publisher Name: Springer, London
Print ISBN: 978-3-540-19742-3
Online ISBN: 978-1-4471-3494-7
eBook Packages: Springer Book Archive