On Deforesting Parameters of Accumulating Maps

Deforestation is a well-known program transformation technique which eliminates intermediate data structures that are passed between functions. One of its weaknesses is the inability to deforest programs using accumulating parameters.We show how intermediate lists built by a selected class of functional programs, namely 'accumulating maps', can be deforested using a single composition rule. For this we introduce a new function dmap, a symmetric extension of the familiar function map. While the associated composition rule cannot capture all deforestation problems, it can handle accumulator fusion of functions defined in terms of dmap in a surprisingly simple way. The rule for accumulator fusion presented here can also be viewed as a restricted composition scheme for attribute grammars, which in turn may help us to bridge the gap between the attribute and functional world.

[1]  Mitchell Wand,et al.  Continuation-Based Program Transformation Strategies , 1980, JACM.

[2]  John Launchbury,et al.  Warm fusion: deriving build-catas from recursive definitions , 1995, FPCA '95.

[3]  Philip Wadler,et al.  Deforestation: Transforming Programs to Eliminate Trees , 1990, Theor. Comput. Sci..

[4]  Alberto Pettorossi,et al.  Program Development Using Lambda Abstraction , 1987, FSTTCS.

[5]  Armin Kühnemann Berechnungsstärken von Teilklassen primitiv-rekursiver Programmschemata , 1997 .

[6]  Armin Kühnemann,et al.  Comparison of Deforestation Techniques for Functional Programs and for Tree Transducers , 1999, Fuji International Symposium on Functional and Logic Programming.

[7]  Robert Glück,et al.  A positive supercompiler , 1996, Journal of Functional Programming.

[8]  Philip Wadler The Concatenate Vanishes , 1987 .

[9]  ChitilOlaf Typer inference builds a short cut to deforestation , 1999 .

[10]  Thomas Johnsson,et al.  Attribute grammars as a functional programming paradigm , 1987, FPCA.

[11]  Olaf Chitil,et al.  Typer inference builds a short cut to deforestation , 1999, ICFP '99.

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

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

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

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

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

[17]  Didier Parigot,et al.  Declarative Program Transformation: A Deforestation Case-Study , 1999, PPDP.

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

[19]  David Sands,et al.  Total correctness by local improvement in the transformation of functional programs , 1996, TOPL.

[20]  Robert Glück,et al.  Relating Accumulative and Non-accumulative Functional Programs , 2001, RTA.

[21]  Mary Lou Soffa,et al.  An approach for exploring code improving transformations , 1997, TOPL.

[22]  Wei-Ngan Chin,et al.  Safe fusion of functional expressions II: Further improvements , 1994, Journal of Functional Programming.

[23]  Andrzej Skowron,et al.  The Power of the Lambda Abstraction Strategy for Program Derivation , 1989, J. Inf. Process. Cybern..

[24]  Yoshihiko Futamura,et al.  An Extension of Shortcut Deforestation for Accumulatiove List Folding , 2002 .

[25]  Valentin F. Turchin,et al.  The concept of a supercompiler , 1986, TOPL.