Skip to main content

Unfold/fold transformations preserving termination properties

  • Conference paper
  • First Online:
Programming Language Implementation and Logic Programming (PLILP 1992)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 631))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Torben Amtoft. Unfold/fold transformations preserving termination properties. To appear as a technical report from DAIMI, University of Aarhus, Denmark, 1992.

    Google Scholar 

  2. R.M. Burstall and John Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44–67, January 1977.

    Google Scholar 

  3. 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.

    Google Scholar 

  4. 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.

    Google Scholar 

  5. Jean-Yves Girard, Yves Lafont, and Paul Taylor. Proofs and Types. Cambridge University Press, 1989.

    Google Scholar 

  6. Steve Gregory. Parallel Logic Programming in PARLOG — the language and its implementation. Addison-Wesley, 1987.

    Google Scholar 

  7. P. A. Gardner and J. C. Shepherdson. Unfold/fold transformations of logic programs. In Computational Proofs: Essays in honour of Alan Robinson. 1991.

    Google Scholar 

  8. 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.

    Google Scholar 

  9. 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.

    Google Scholar 

  10. Zhu Hong. How powerful are folding/unfolding transformations. Technical Report CSTR-91-2, Department of Computer Science, Brunel University, January 1991.

    Google Scholar 

  11. 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.

    Google Scholar 

  12. Tadashi Kawamura and Tadashi Kanamori. Preservation of stronger equivalence in unfold/fold logic program transformation. Theoretical Computer Science, 75:139–156, 1990.

    Google Scholar 

  13. Laurent Kott. Unfold/fold program transformations. In Maurice Nivat and John C. Reynolds, editors, Algebraic Methods in Semantics, chapter 12. Cambridge University Press, 1985.

    Google Scholar 

  14. J.W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1984.

    Google Scholar 

  15. 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.

    Google Scholar 

  16. Catuscia Palamidessi. Algebraic properties of idempotent substitutions. Technical Report TR-33/89, University of Pisa, 1989.

    Google Scholar 

  17. Gordon D. Plotkin. A structural approach to operational semantics. Technical Report FN-19, DAIMI, University of Aarhus, Denmark, September 1981.

    Google Scholar 

  18. 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.

    Google Scholar 

  19. 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.

    Google Scholar 

  20. Hirohisa Seki. Unfold/fold transformations of stratified programs. Theoretical Computer Science, 86(1):107–139, 1991.

    Google Scholar 

  21. Harald SØndergaard. Semantics-based analysis and transformation of logic programs. Technical Report 89/22, DIKU, University of Copenhagen, Denmark, 1989.

    Google Scholar 

  22. Hisao Tamaki and Taisuke Sato. Unfold/fold transformation of logic programs. In Proceedings of 2nd International Logic Programming Conference, Uppsala, pages 127–138, 1984.

    Google Scholar 

  23. Valentin F. Turchin. The concept of a supercompiler. ACM Transactions on Programming Languages and Systems, 8(3):292–325, July 1986.

    Google Scholar 

  24. Philip Wadler. Deforestation: Transforming programs to eliminate trees. Theoretical Computer Science, 73:231–248, 1990.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Maurice Bruynooghe Martin Wirsing

Rights and permissions

Reprints 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

Publish with us

Policies and ethics