A Denotational Investigation of Defunctionalization

Defunctionalization was introduced by John Reynolds in his 1972 article Definitional Interpreters for Higher-Order Programming Languages. Defunctionalization transforms a higher-order program into a first-order one, representing functional values as data structures. Since then it has been used quite widely, but we observe that it has never been proven correct. We formalize defunctionalization denotationally for a typed functional language, and we prove that it preserves the meaning of any terminating program. Our proof uses logical relations. Keywords: defunctionalization, program transformation, denotational semantics, logical relations.

[1]  Nils Klarlund,et al.  The DSD Schema Language and its Applications , 2000 .

[2]  Olivier Danvy,et al.  Lambda-dropping: transforming recursive equations into programs with block structure , 1997, Theor. Comput. Sci..

[3]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[4]  Simon L. Peyton Jones An Introduction to Fully-Lazy Supercombinators , 1985, Combinators and Functional Programming Languages.

[5]  Claus Brabrand,et al.  The bigwig Project , 2000 .

[6]  G. Winskel The formal semantics of programming languages , 1993 .

[7]  Bernd Grobauer,et al.  The Second Futamura Projection for Type-Directed Partial Evaluation , 1999, PEPM '00.

[8]  Ivan Damgård,et al.  A Generalisation, a Simplification and Some Applications of Paillier's Probabilistic Public-Key System , 2001, Public Key Cryptography.

[9]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[10]  Robert Harper,et al.  Typed closure conversion , 1996, POPL '96.

[11]  Andrew P. Tolmach,et al.  From ML to Ada: Strongly-typed language interoperability via source translation , 1998, Journal of Functional Programming.

[12]  James Hook,et al.  Defunctionalization of Typed Programs , 1994 .

[13]  Jeffery M. Bell An implementation of Reynolds defunctionalization method for a modern functional language , 1994 .

[14]  John C. Reynolds Definitional Interpreters for Higher-Order Programming Languages , 1998, High. Order Symb. Comput..

[15]  Christopher Strachey,et al.  Fundamental Concepts in Programming Languages , 2000, High. Order Symb. Comput..

[16]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

[17]  Suresh Jagannathan,et al.  Flow-Directed Closure Conversion for Typed Languages , 2000, ESOP.

[18]  Anindya Banerjee,et al.  Design and Correctness of Program Transformations Based on Control-Flow Analysis , 2001, TACS.

[19]  Zhe Yang,et al.  Reasoning About Code-Generation in Two-Level Languages , 2000 .

[20]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[21]  Thomas Johnsson,et al.  Lambda Lifting: Treansforming Programs to Recursive Equations , 1985, FPCA.