Constraints to stop higher-order deforestation

Wadler's deforestation algorithm removes intermediate data structures from functional programs. To be appropriate for inclusion in a compiler, deforestation must terminate on all programs. Several techniques exist to ensure termination of deforestation on all first-order programs, but a technique for higher-order programs was only recently introduced by Hamilton and later Marlow. We present a new technique for ensuring termination of deforestation on all higher-order programs that allows useful transformation steps prohibited in Hamilton's and Marlow's techniques. The technique uses a constraint-based higher-order control-flow analysis.

[1]  Martin S. Feather,et al.  A System for Assisting Program Transformation , 1982, TOPL.

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

[3]  Jens Palsberg,et al.  Closure analysis in constraint form , 1995, TOPL.

[4]  Nevin Heintze,et al.  Set-based analysis of ML programs , 1994, LFP '94.

[5]  Simon L. Peyton Jones,et al.  Cheap Deforestation in Practice: An Optimizer for Haskell , 1994, IFIP Congress.

[6]  Philip Wadler Listlessness is better than laziness II: composing listless functions , 1985, Programs as Data Objects.

[7]  David Sands Proving the Correctness of Recursion-Based Automatic Program Transformations , 1995, TAPSOFT.

[8]  Helmut Seidl Integer Constraints to Stop Deforestation , 1996, ESOP.

[9]  Morten Heine Sørensen,et al.  Grammar-Based Data-Flow Analysis to Stop Deforestation , 1994, CAAP.

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

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

[12]  Tim Sheard,et al.  A fold for all seasons , 1993, FPCA '93.

[13]  Dines Bjørner,et al.  Partial Evaluation and Mixed Computation , 1987 .

[14]  Valentin F. Turchin,et al.  Experiments with a supercompiler , 1982, LFP '82.

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

[16]  Tong Zhou,et al.  Improving Programs Which Recurse over Multiple Inductive Structures , 1994, PEPM.

[17]  Geoff W. Hamilton,et al.  Transforming Programs to Eliminate Intermediate Structures , 1991, JTASPEFT/WSA.

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

[19]  Alan Mycroft,et al.  Polymorphic Type Schemes and Recursive Definitions , 1984, Symposium on Programming.

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

[21]  Peter Sestoft,et al.  Automatic call unfolding in a partial evaluator , 1987 .

[22]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[23]  John Darlington,et al.  An Experimental Program Transformation and Synthesis System , 1986, Artif. Intell..

[24]  Philip Wadler,et al.  Deforestation for Higher-Order Functions , 1992, Functional Programming.

[25]  Jonathan C. Shultis,et al.  Transformations of FP program schemes , 1981, FPCA '81.

[26]  David Sands,et al.  Proving the Correctness of Recursion-Based Automatic Program Transformations , 1995, Theor. Comput. Sci..

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

[28]  Akihiko Takano,et al.  Shortcut deforestation in calculational form , 1995, FPCA '95.

[29]  Philip Wadler,et al.  Applicative style programming, program transformation, and list operators , 1981, FPCA '81.

[30]  David Sands,et al.  Total correctness by local improvement in program transformation , 1995, POPL '95.

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

[32]  Zohar Manna,et al.  Synthesis: Dreams - Programs , 1979, IEEE Trans. Software Eng..

[33]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[34]  Wei-Ngan Chin Safe fusion of functional expressions , 1992, LFP '92.

[35]  Wei-Ngan Chin,et al.  Better Consumers for Deforestation (Extended Abstract) , 1995, PLILP.

[36]  Wei-Ngan Chin,et al.  Automatic methods for program transformation , 1990 .

[37]  W.-N. Chin Generalising Deforestation for All First-Order Functional Programs , 1991, JTASPEFT/WSA.

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

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

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

[41]  Matthias Felleisen,et al.  A call-by-need lambda calculus , 1995, POPL '95.

[42]  Dines Bjørner,et al.  Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop, Gammel Avernaes, Denmark, 18-24 Oct., 1987 , 1988 .

[43]  Helmut Seidl Least Solutions of Equations over N , 1994, ICALP.

[44]  Fritz Henglein,et al.  Type inference with polymorphic recursion , 1993, TOPL.

[45]  Wei-Ngan Chin Fully Lazy Higher-Order Removal , 1992, PEPM.

[46]  Geoff W. Hamilton,et al.  Compile-time optimisation of store usage in lazy functional programs , 1993 .