Abstract
The unfold/fold framework constitutes the spine of many program transformation strategies. However, by unrestricted use of folding the target program may terminate less often than the source program. Several authors have investigated the problem of setting up conditions of syntactic nature, i.e. not based on some well-founded ordering of the arguments, which guarantee preservation of termination properties. These conditions are typically formulated in a way which makes it hard to grasp the basic intuition why they work, and in a way which makes it hard to give elegant proofs of correctness. The aim of this paper will be to give a more unified treatment by setting up a model which enables us to reason about termination preservation in a cleaner and more algebraic fashion. The model resembles a logic language and is parametrized with respect to evaluation order, but it should not be too difficult to transfer the ideas to other languages.
Preview
Unable to display preview. Download preview PDF.
References
Torben Amtoft. Unfold/fold transformations preserving termination properties. To appear as a technical report from DAIMI, University of Aarhus, Denmark, 1992.
R.M. Burstall and John Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, January 1977.
Anders Bondorf and Olivier Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming, 16(2):151–195, 1991.
John Darlington and Helen Pull. A program development methodology based on a unified approach to execution and transformation. In D. BjØrner, A.P. Ershov, and N.D. Jones, editors, Partial Evaluation and Mixed Computation, pages 117–131. North-Holland, 1988.
Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and Types. Cambridge University Press, 1989.
Steve Gregory. Parallel Logic Programming in PARLOG — the language and its implementation. Addison-Wesley, 1987.
P. A. Gardner and J. C. Shepherdson. Unfold/fold transformations of logic programs. In Computational Proofs: Essays in honour of Alan Robinson. 1991.
Torben Amtoft Hansen. Properties of unfolding-based meta-level systems. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut. (Sigplan Notices, vol. 26, no. 9), 1991.
Carsten Kehler Holst. Finiteness analysis. In John Hughes, editor, International Conference on Functional Programming Languages and Computer Architecture. Springer Verlag, LNCS no 523, August 1991.
Zhu Hong. How powerful are folding/unfolding transformations. Technical Report CSTR-91-2, Department of Computer Science, Brunel University, January 1991.
Neil D. Jones, Peter Sestoft, and Harald SØndergaard. Mix: A self-applicable partial evaluator for experiments in compiler generation. Lisp and Symbolic Computation, 2(1):9–50, 1989.
Tadashi Kawamura and Tadashi Kanamori. Preservation of stronger equivalence in unfold/fold logic program transformation. Theoretical Computer Science, 75:139–156, 1990.
Laurent Kott. Unfold/fold program transformations. In Maurice Nivat and John C. Reynolds, editors, Algebraic Methods in Semantics, chapter 12. Cambridge University Press, 1985.
J.W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1984.
Hanne Riis Nielson and Flemming Nielson. Eureka definitions for free! or disagreement points for fold/unfold transformations. In Neil D. Jones, editor, ESOP 90, Copenhagen, Denmark. LNCS 432, pages 291–305, May 1990.
Catuscia Palamidessi. Algebraic properties of idempotent substitutions. Technical Report TR-33/89, University of Pisa, 1989.
Gordon D. Plotkin. A structural approach to operational semantics. Technical Report FN-19, DAIMI, University of Aarhus, Denmark, September 1981.
Maurizio Proietti and Alberto Pettorossi. Semantics preserving transformation rules for Prolog. In Partial Evaluation and Semantics-Based Program Manipulation, New Haven, Connecticut. (Sigplan Notices, vol. 26, no. 9), 1991.
Maurizio Proietti and Alberto Pettorossi. Unfolding-Definition-Folding, in this order, for avoiding unnecessary variables in logic programs. In Proceedings of PLILP 91, Passau, Germany (LNCS 528), August 1991.
Hirohisa Seki. Unfold/fold transformations of stratified programs. Theoretical Computer Science, 86(1):107–139, 1991.
Harald SØndergaard. Semantics-based analysis and transformation of logic programs. Technical Report 89/22, DIKU, University of Copenhagen, Denmark, 1989.
Hisao Tamaki and Taisuke Sato. Unfold/fold transformation of logic programs. In Proceedings of 2nd International Logic Programming Conference, Uppsala, pages 127–138, 1984.
Valentin F. Turchin. The concept of a supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, July 1986.
Philip Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Amtoft, T. (1992). Unfold/fold transformations preserving termination properties. In: Bruynooghe, M., Wirsing, M. (eds) Programming Language Implementation and Logic Programming. PLILP 1992. Lecture Notes in Computer Science, vol 631. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55844-6_136
Download citation
DOI: https://doi.org/10.1007/3-540-55844-6_136
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55844-6
Online ISBN: 978-3-540-47297-1
eBook Packages: Springer Book Archive