Design and Correctness of Program Transformations Based on Control-Flow Analysis

We show how control-flow-based program transformations in functional languages can be proven correct. The method relies upon "defunctionalization," a mapping from a higher-order language to a firstorder language. We first show that defunctionalization is correct; using this proof and common semantic techniques, we then show how two program transformations - flow-based inlining and lightweight defunctionalization - can be proven correct.

[1]  Mitchell Wand,et al.  Specifying the correctness of binding-time analysis , 1993, POPL '93.

[2]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[3]  Naoki Kobayashi Type-based useless variable elimination , 1999, PEPM '00.

[4]  Franklyn Turbak,et al.  Strongly Typed Flow-Directed Representation Transformations. , 1997, ICFP 1997.

[5]  Martín Abadi,et al.  A core calculus of dependency , 1999, POPL '99.

[6]  Joe B. Wells,et al.  Strongly typed flow-directed representation transformations (extended abstract) , 1997, ICFP '97.

[7]  David Grove,et al.  Vortex: an optimizing compiler for object-oriented languages , 1996, OOPSLA '96.

[8]  Andrew W. Appel,et al.  Type-preserving garbage collectors , 2001, POPL '01.

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

[10]  Anindya Banerjee A modular, polyvariant and type-based closure analysis , 1997, ICFP '97.

[11]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[12]  G. Duclos New York 1987 , 2000 .

[13]  Kwangkeun Yi,et al.  An Abstract Interpretation for Estimating Uncaught Exceptions in Standard ML Programs , 1998, Sci. Comput. Program..

[14]  Suresh Jagannathan,et al.  A unified treatment of flow analysis in higher-order languages , 1995, POPL '95.

[15]  Peter Sestoft,et al.  Replacing function parameters by global variables , 1989, FPCA.

[16]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[17]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[18]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

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

[20]  Neil D. Jones,et al.  Flow Analysis of Lambda Expressions (Preliminary Version) , 1981, ICALP.

[21]  Nevin Heintze,et al.  Control-Flow Analysis and Type Systems , 1995, SAS.

[22]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[23]  Mitchell Wand,et al.  Lightweight closure conversion , 1997, TOPL.

[24]  Robert D. Tennent,et al.  Semantics of programming languages , 1991, Prentice Hall International Series in Computer Science.

[25]  Flemming Nielson,et al.  Program transformations in a denotational setting , 1981, ACM Trans. Program. Lang. Syst..

[26]  Jon G. Riecke,et al.  The SLam calculus: programming with secrecy and integrity , 1998, POPL '98.

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

[28]  Manuel Fähndrich,et al.  Making Set-Constraint Based Program Analyses Scale , 1996 .

[29]  Matthias Felleisen,et al.  Componential Set-Based Analysis , 1999, ACM Trans. Program. Lang. Syst..

[30]  Mitchell Wand,et al.  Set constraints for destructive array update optimization , 2001, J. Funct. Program..

[31]  Urban Boquist,et al.  Code Optimisation Techniques for Lazy Functional Languages , 1999 .

[32]  Mitchell Wand,et al.  Constraint systems for useless variable elimination , 1999, POPL '99.

[33]  Suresh Jagannathan,et al.  Effective Flow Analysis for Avoiding Run-Time Checks , 1995, SAS.

[34]  John C. Reynolds,et al.  Definitional Interpreters Revisited , 1998, High. Order Symb. Comput..

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

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

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

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

[39]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

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

[41]  Manuel Fähndrich,et al.  Making Set-Constraint Program Analyses Scale , 1996 .

[42]  Flemming Nielson,et al.  Infinitary control flow analysis: a collecting semantics for closure analysis , 1997, POPL '97.

[43]  Dana S. Scott,et al.  A Type-Theoretical Alternative to ISWIM, CUCH, OWHY , 1993, Theor. Comput. Sci..

[44]  Lasse Nielsen,et al.  A Denotational Investigation of Defunctionalization , 2000 .

[45]  Mads Tofte,et al.  Region-based Memory Management , 1997, Inf. Comput..

[46]  Urs Hölzle,et al.  Dynamic versus Static Optimization Techniques for Object-Oriented Languages , 1995, Theory Pract. Object Syst..

[47]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..