Comparison of Deforestation Techniques for Functional Programs and for Tree Transducers

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.

[1]  Zoltán Fülöp On attributed tree transducers , 1981, Acta Cybern..

[2]  James W. Thatcher,et al.  Generalized Sequential Machine Maps , 1970, J. Comput. Syst. Sci..

[3]  David Turner,et al.  Research topics in functional programming , 1990 .

[4]  Zoltán Fülöp,et al.  Syntax-Directed Semantics , 1998, Monographs in Theoretical Computer Science An EATCS Series.

[5]  Joost Engelfriet,et al.  Macro Tree Transducers , 1985, J. Comput. Syst. Sci..

[6]  John Hughes,et al.  Why Functional Programming Matters , 1989, Comput. J..

[7]  Bruno Courcelle,et al.  Attribute Grammars and Recursive Program Schemes I , 1982, Theoretical Computer Science.

[8]  Joost Engelfriet,et al.  SOME OPEN QUESTIONS AND RECENT RESULTS ON TREE TRANSDUCERS AND TREE LANGUAGES , 1980 .

[9]  Andrew John Gill,et al.  Cheap deforestation for non-strict functional languages , 1996 .

[10]  Ronald V. Book,et al.  Formal language theory : perspectives and open problems , 1980 .

[11]  Robert Glück,et al.  Towards Unifying Partial Evaluation, Deforestation, Supercompilation, and GPC , 1994, ESOP.

[12]  Geoff W. Hamilton,et al.  Extending Deforestation for First Order functional Programs , 1991, Functional Programming.

[13]  Heiko Vogler,et al.  Synthesized and inherited functions - a new computational model for syntax-directed semantics , 1994 .

[14]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[15]  Bruno Courcelle,et al.  Attribute Grammars and Recursive Program Schemes II , 1982, Theor. Comput. Sci..

[16]  Harald Ganzinger Increasing Modularity and Language-Independency in Automatically Generated Compilers , 1983, Sci. Comput. Program..

[17]  Simon L. Peyton Jones,et al.  A short cut to deforestation , 1993, FPCA '93.

[18]  Philip Wadler,et al.  When Will Deforestation Stop , 1988 .

[19]  Armin Kühnemann,et al.  Benefits of Tree Transducers for Optimizing Functional Programs , 1998, FSTTCS.

[20]  Simon L. Peyton Jones,et al.  Type Classes in Haskell , 1994, ESOP.

[21]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1988, Theoretical Computer Science.