Skip to main content

A transformation system combining partial evaluation with term rewriting

  • Conference paper
  • First Online:
Higher-Order Algebra, Logic, and Term Rewriting (HOA 1993)

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

Abstract

This paper presents a new approach to optimizing functional programs based on combining partial evaluation and rewriting. Programs are composed of higher-order primitives. Partial evaluation is used to eliminate higher-order functions. First-order rewriting is used to process the transformation. Laws about the higher-order primitives that are relevant for the optimizations are automatically extracted from a library and transformed into first-order terms using partial evaluation. Such a combination of a partial evaluation system and an intrinsically first-order rewriting tool allows a form of higher-order rewriting at a first-order level. This way, it is possible to automate deforestation of higher-order programs.

The work reported here was supported in part by a contract with Air Force Material Command (F1928-R-0032) and by a grant from NSF (CCR-9101721).

I would like to thank C. Consel and J. Hook for their comments and suggestions.

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. F. Bellegarde. Program Transformation and Rewriting. In Proceedings of the fourth conference on Rewriting Techniques and Applications, Springer Verlag, Lecture Notes in Computer Science 488, pages 226–239, Como, Italy, 1991.

    Google Scholar 

  2. F. Bellegarde. Astre, a Transformation System using Completion. Technical Report, Department of Computer Science and Engineering, Oregon Graduate Institute, 1991.

    Google Scholar 

  3. J. Bentley. Programming Pearls, Addison Wesley, 1986.

    Google Scholar 

  4. R. M. Burstall and J. Darlington. A Transformation System For Developing Recursive Programs. Journal of the Association for Computing Machinery, 24, pages 44–67, 1977.

    Google Scholar 

  5. W. N. Chin. Automatic Methods for Program Transformation. PhD thesis, University of London, Imperial College of Science, Technology and Medecine, London, UK, 1990.

    Google Scholar 

  6. C. Consel. A tour of Schism: A partial evaluation system for higher-order applicative languages. Research report, Pacific Software Research Center, Oregon Graduate Institute of Science and Technology, Beaverton, Oregon, USA, 1992.

    Google Scholar 

  7. N. Dershowitz. Completion and its Applications. Resolution of Equations in Algebraic Structures, Academic Press, New York, 1988.

    Google Scholar 

  8. A. Ershov. Mixed computation: potential applications and problem for study. Theoritical Computer Science, Vol. 18, pages 41–67, 1982.

    Google Scholar 

  9. A. Gill, J. Launchbury and S.L. Peyton Jones. A short cut to Deforestation. In Sixth Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, pp 223–232, June 1993.

    Google Scholar 

  10. E. Meijer, M. Fokkinga and R. Patterson. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In Conference on Functional Programming and Computer Architecture, Lecture Notes in Computer Science 523, pages 124–144, 1991.

    Google Scholar 

  11. U. S. Reddy. Transformational derivation of programs using the Focus system. In Symposium Practical Software Development Environments, pages 163–172, ACM, December 1988.

    Google Scholar 

  12. T. Scheard and L. Fegaras. A fold for All Seasons. Sixth Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, pp 233–242, June 1993.

    Google Scholar 

  13. W. Snyder and J. Gallier. Higher order unification revisited: complete sets of transformations. Journal of Symbolic Computation, Vol.8, pages 101–140, 1989. Special issue on Unification. Part two.

    Google Scholar 

  14. S. Thompson. Functional Programming: Executable Specifications and Program Transformation. In Fifth International Workshop on Software Specification and Design., IEEE Press, 1989.

    Google Scholar 

  15. S. Thompson. Type Theory and Functional Programming, Addison Wesley, 1991.

    Google Scholar 

  16. P. Wadler, Deforestation: Transforming programs to eliminate trees. In 2nd European Symposium on Programming ESOP'88, Nancy France, 1988. Lecture Notes in Computer Science 300, Springer Verlag.

    Google Scholar 

  17. P. Wadler. Theorem for free! In Proc. 1989 ACM Conference on Lisp and Functional Programming, pages 347–359, 1989.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Jan Heering Karl Meinke Bernhard Möller Tobias Nipkow

Rights and permissions

Reprints and permissions

Copyright information

© 1994 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Bellegarde, F. (1994). A transformation system combining partial evaluation with term rewriting. In: Heering, J., Meinke, K., Möller, B., Nipkow, T. (eds) Higher-Order Algebra, Logic, and Term Rewriting. HOA 1993. Lecture Notes in Computer Science, vol 816. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58233-9_3

Download citation

  • DOI: https://doi.org/10.1007/3-540-58233-9_3

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-58233-5

  • Online ISBN: 978-3-540-48579-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics