Abstract
We compare transformations for the elimination of intermediate results in first-order functional programs. We choose the well known deforestation technique of Wadler and composition techniques from the theory of tree transducers, of which the implementation of functional programs yet does not take advantage. We identify syntactic classes of function definitions for which both techniques deliver equally efficient results and for which one technique is more powerful than the other. In particular, this paper offers a technique that eliminates intermediate results for certain kinds of function definitions, for which deforestation fails.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Burstall, R.M., Darlington, J.: A transformation system for developing recursive programs. J. Assoc. Comput. Mach. 24, 44–67 (1977)
Courcelle, B., Franchi-Zannettacci, P.: Attribute grammars and recursive program schemes. Theoret. Comput. Sci. 17, 163–191, 235–257 (1982)
Engelfriet, J.: Some open questions and recent results on tree transducers and tree languages. In: Book, R.V. (ed.) Formal language theory; perspectives and open problems, pp. 241–286. Academic Press, New York (1980)
Engelfriet, J., Vogler, H.: Macro tree transducers. J. Comput. Syst. Sci. 31, 71–145 (1985)
Ferguson, A.B., Wadler, P.: When will deforestation stop? In: 1988 Glasgow Workshop on Functional Programming, pp. 39–56 (1988)
Fülöp, Z.: On attributed tree transducers. Acta Cybernetica 5, 261–279 (1981)
Fülöp, Z., Vogler, H.: Syntax-directed semantics - Formal models based on tree transducers. Monographs in Theoretical Computer Science, An EATCS Series. Springer, Heidelberg (1998)
Ganzinger, H.: Increasing modularity and language-independency in automatically generated compilers. Science of Computer Programming 3, 223–278 (1983)
Giegerich, R.: Composition and evaluation of attribute coupled grammars. Acta Informatica 25, 355–423 (1988)
Gill, A.: Cheap deforestation for non-strict functional languages. PhD thesis, University of Glasgow (1996)
Gill, A., Launchbury, J., Peyton Jones, S.L.: A short cut to deforestation. In: FPCA 1993, Proceedings, Copenhagen, Denmark, pp. 223–231. ACM Press, New York (1993)
Hamilton, G.W., Jones, S.B.: Extending deforestation for first order functional programs. In: 1991 Glasgow Workshop on Functional Programming. Series of Workshops in Computing, pp. 134–145. Springer, Heidelberg (1992)
Hughes, J.: Why functional programming matters. In: Turner, D. (ed.) Research Topics in Functional Programming. Addison-Wesley, Reading (1990)
Knuth, D.E.: Semantics of context-free languages. Math. Syst. Th. 2, 127–145 (1968); Corrections in Math. Syst. Th. 5, 95–96 (1971)
Kühnemann, A.: Benefits of tree transducers for optimizing functional programs. In: Arvind, V., Sarukkai, S. (eds.) FST TCS 1998. LNCS, vol. 1530, pp. 146–158. Springer, Heidelberg (1998)
Kühnemann, A., Vogler, H.: Synthesized and inherited functions - a new computational model for syntax-directed semantics. Acta Informatica 31, 431–477 (1994)
Rounds, W.C.: Mappings and grammars on trees. Math. Syst. Th. 4, 257–287 (1970)
Sørensen, M.H., Glück, R., Jones, N.D.: Towards unifying partial evaluation, deforestation, supercompilation, and GPC. In: Sannella, D. (ed.) ESOP 1994. LNCS, vol. 788, pp. 485–500. Springer, Heidelberg (1994)
Thatcher, J.W.: Generalized2 sequential machine maps. J. Comput. Syst. Sci. 4, 339–367 (1970)
Wadler, P.: Deforestation: Transforming programs to eliminate trees. Theor. Comp. Sci. 73, 231–248 (1990)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kühnemann, A. (1999). Comparison of Deforestation Techniques for Functional Programs and for Tree Transducers. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_8
Download citation
DOI: https://doi.org/10.1007/10705424_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66677-6
Online ISBN: 978-3-540-47950-5
eBook Packages: Springer Book Archive