The Essence of Program Transformation by Partial Evaluation and Driving

An abstract framework is developed to describe program transformation by specializing a given program to a restricted set of inputs. Particular cases include partial evaluation [19] and Turchin's more powerful "driving" transformation [33]. Such automatic program speedups have been seen to give quite significant speedups in practical applications. This paper's aims are similar to those of [18]: better to understand the fundamental mathematical phenomena that make such speedups possible. The current paper is more complete than [18], since it precisely formulates correctness of code generation; and more powerful, since it includes program optimizations not achievable by simple partial evaluation. Moreover, for the first time it puts Turchin's driving methodology on a solid semantic foundation which is not tied to any particular programming language or data structure. This paper is dedicated to Satoru Takasu with thanks for good advice early in my career on how to do research, and for insight into how to see the essential part of a new problem.

[1]  Valentin F. Turchin,et al.  Semantic definitions in REFAL and the automatic production of compilers , 1980, Semantics-Directed Compiler Generation.

[2]  Robert Glück,et al.  Application of metasystem transition to function inversion and transformation , 1990, ISSAC '90.

[3]  Peter Sestoft,et al.  Partial evaluation and automatic program generation , 1993, Prentice Hall international series in computer science.

[4]  Olivier Danvy,et al.  Partial Evaluation of Pattern Matching in Strings , 1989, Inf. Process. Lett..

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

[6]  Valentin F. Turchin,et al.  A constructive interpretation of the full set theory , 1987, The Journal of Symbolic Logic.

[7]  Andrei P. Ershov,et al.  Mixed Computation: Potential Applications and Problems for Study , 1982, Theor. Comput. Sci..

[8]  S. A. Romanenko,et al.  A compiler generator produced by a self-applicable specializer can have a surprisingly natural and u , 1988 .

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

[10]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[11]  Chris Hankin,et al.  Abstract Interpretation of Declarative Languages , 1987 .

[12]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

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

[14]  John Launchbury,et al.  Projection factorisations in partial evaluation , 1991 .

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

[16]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[17]  Lennart Augustsson,et al.  Compiling Pattern Matching , 1985, FPCA.

[18]  Robert Glück,et al.  Occam's Razor in Metacompuation: the Notion of a Perfect Process Tree , 1993, WSA.

[19]  Valentin F. Turchin,et al.  The language refal - the theory of compilation and metasystem analysis , 1980 .

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

[21]  Valentin F. Turchin,et al.  Program transformation with metasystem transitions , 1993, Journal of Functional Programming.

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

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

[24]  Donald E. Knuth,et al.  Fast Pattern Matching in Strings , 1977, SIAM J. Comput..

[25]  Erik Sandewall,et al.  A Partial Evaluator, and its Use as a Programming Tool , 1976, Artif. Intell..

[26]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

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

[28]  Akihiko Takano Generalized partial computation for a lazy functional language , 1991 .

[29]  Flemming Nielson,et al.  Abstract interpretation: a semantics-based tool for program analysis , 1995, LICS 1995.