Abstract
We present a goal replacement rule whose main applicability condition is based on termination properties of the resulting transformed program. The goal replacement rule together with a multi-step unfolding rule forms a powerful and elegant transformation system for definite programs. It also sheds new light on the relationship between folding and goal replacement, and between different folding rules. Our explicit termination condition contrasts with other transformation systems in the literature, which contain conditions on folding and goal replacement, often rather complex, in order to avoid “introducing a loop” into a program. We prove that the goal replacement rule preserves the success set of a definite program. We define an extended version of goal replacement that also preserves the finite failure set. A powerful folding rule can be constructed as a special case of goal replacement, allowing folding with recursive rules, with no distinction between old and new predicates. A proof that Seki's transformation system preserves recurrence, an important termination property, is outlined.
Preview
Unable to display preview. Download preview PDF.
References
K.R. Apt. and D. Pedreschi. Studies in Pure Prolog: Termination. In J.W. Lloyd, editor, Proceedings of the Esprit symposium on computational logic, pages 150–176, 1990.
D. Boulanger and M. Bruynooghe. Using abstract interpretation for goal replacement. In Y. Deville, editor, Logic Program Synthesis and Tranformation (LOPSTR'93), Louvain-la-Neuve, 1993.
A. Bossi, N. Cocco, and S. Etalle. Transforming Normal Programs by Replacement. In Third Workshop on Metaprogramming in Logic, Uppsala., 1992. META92.
R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24:44–67, 1977.
A. Bossi and S. Etalle. Transforming Acyclic Programs. ACM Transactions on Programming Languages and Systems, (to appear); also available as CWI Technical Report CS-R9369 December 1993, CWI, Amsterdam, 1994.
M. Bezem. Characterising Termination of Logic Programs with Level Mappings. In E.L. Lusk and R.A. Overbeek, editors, Proceedings NACLP89, pages 69–80, 1989.
J. Cook. A transformation system for definite logic programs based on termination analysis. Master's thesis, School of Mathematics, University of Bristol, 1992.
D. De Schreye and K. Verschaetse. Termination of Logic Programs:Tutorial Notes. In Third Workshop on Metaprogramming in Logic, Uppsala, 1992. META92.
D. De Schreye, K. Verschaetse, and M. Bruynooghe. A Framework for Analysing the Termination of Definite Logic Programs with respect to call patterns. In ICOT, editor, Proceedings of the International Conference on Fifth Generation Computer Systems, 1992.
P.A. Gardner and J.C. Shepherdson. Unfold/fold transformations of logic programs. In J.L Lassez and G. Plotkin, editors, Computational Logic: Essays in Honour of Alan Robinson. MIT Press, 1991.
J.W. Lloyd. Foundations of Logic Programming, 2nd Edition. Springer-Verlag, 1987.
J.W. Lloyd and J.C. Shepherdson. Partial Evaluation in Logic Programming. Journal of Logic Programming, 11(3 & 4):217–242, 1991.
M.J. Maher. Correctness of a Logic Program Transformation System. Research Report RC13496, IBM, T.J. Watson Research Center, 1987.
L. Plümer. Automatic Termination Proofs for Prolog Programs Operating on Nonground Terms. In Proceedings ILPS'91, San Diego, pages 503–517. MIT Press, 1992.
M. Proietti and A. Pettorossi. Synthesis of programs from unfold/fold proofs. In Y. Deville, editor, Logic Program Synthesis and Tranformation (LOPSTR'93), Louvain-la-Neuve, 1993.
H. Seki. Unfold/Fold Transformation of Stratified Programs. In G. Levi and M. Martelli, editors, Sixth Conference on Logic Programming, Lisboa, Portugal. The MIT Press, 1989.
H. Tamaki and T. Sato. Unfold/Fold Transformation of Logic Programs. In Proceedings of the Second international Logic Programming Conference, pages 127–138, Uppsala, 1984.
J.D. Ullman and A. Van Gelder. Efficient tests for top-down termination of logical rules. Journal of the ACM, 35(2), pages 345–373, 1988.
T. Vasak and J. Potter. Characterisation of Terminating Logic Programs. In Proceedings 1986 Symposium on Logic Programming, Salt Lake City, pages 140–147, 1986.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cook, J., Gallagher, J.P. (1994). A transformation system for definite programs based on termination analysis. In: Fribourg, L., Turini, F. (eds) Logic Program Synthesis and Transformation — Meta-Programming in Logic. META LOPSTR 1994 1994. Lecture Notes in Computer Science, vol 883. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58792-6_4
Download citation
DOI: https://doi.org/10.1007/3-540-58792-6_4
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58792-7
Online ISBN: 978-3-540-49104-0
eBook Packages: Springer Book Archive