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.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
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.
Preview
Unable to display preview. Download preview PDF.
References
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.
F. Bellegarde. Astre, a Transformation System using Completion. Technical Report, Department of Computer Science and Engineering, Oregon Graduate Institute, 1991.
J. Bentley. Programming Pearls, Addison Wesley, 1986.
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.
W. N. Chin. Automatic Methods for Program Transformation. PhD thesis, University of London, Imperial College of Science, Technology and Medecine, London, UK, 1990.
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.
N. Dershowitz. Completion and its Applications. Resolution of Equations in Algebraic Structures, Academic Press, New York, 1988.
A. Ershov. Mixed computation: potential applications and problem for study. Theoritical Computer Science, Vol. 18, pages 41–67, 1982.
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.
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.
U. S. Reddy. Transformational derivation of programs using the Focus system. In Symposium Practical Software Development Environments, pages 163–172, ACM, December 1988.
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.
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.
S. Thompson. Functional Programming: Executable Specifications and Program Transformation. In Fifth International Workshop on Software Specification and Design., IEEE Press, 1989.
S. Thompson. Type Theory and Functional Programming, Addison Wesley, 1991.
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.
P. Wadler. Theorem for free! In Proc. 1989 ACM Conference on Lisp and Functional Programming, pages 347–359, 1989.
Author information
Authors and Affiliations
Editor information
Rights 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