Program and proof optimizations with type systems

We demonstrate a method for describing data-flow analyses based program optimizations as compositional type systems with a transformation component. Analysis results are presented in terms of types ascribed to expressions and statements, certifiable by type derivations, and the transformation component carries out the optimizations that the type derivations license. We describe dead code elimination and common subexpression elimination. In the case of common subexpression elimination we circumvent non-compositionality with a combined type system for a combination of two analyses. The motivation of this work lies in certified code applications, where an optimization of a program must be supported by a checkable justification. As an example application we highlight “proof optimization”, i.e., mechanical transformation of a program’s functional correctness proof together with the program, based on the analysis type derivation.

[1]  David Pichardie,et al.  Proof-carrying code from certified abstract interpretation and fixpoint compression , 2006, Theor. Comput. Sci..

[2]  David Cachera,et al.  Certified Memory Usage Analysis , 2005, FM.

[3]  George C. Necula,et al.  Translation validation for an optimizing compiler , 2000, PLDI '00.

[4]  Tarmo Uustalu,et al.  Type Systems for Optimizing Stack-based Code , 2007, Electron. Notes Theor. Comput. Sci..

[5]  Tarmo Uustalu,et al.  Type systems equivalent to data-flow analyses for imperative languages , 2006, Theor. Comput. Sci..

[6]  Tarmo Uustalu,et al.  Proof optimization for partial redundancy elimination , 2008, PEPM '08.

[7]  Eric Van Wyk,et al.  Proving correctness of compiler optimizations by temporal logic , 2002, POPL '02.

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

[9]  Manuel V. Hermenegildo,et al.  Abstraction-Carrying Code , 2005, LPAR.

[10]  Tarmo Uustalu,et al.  A compositional natural semantics and Hoare logic for low-level languages , 2007, Theor. Comput. Sci..

[11]  Tarmo Uustalu,et al.  Foundational certification of data-flow analyses , 2007, First Joint IEEE/IFIP Symposium on Theoretical Aspects of Software Engineering (TASE '07).

[12]  Amir Pnueli,et al.  VOC: A Methodology for the Translation Validation of OptimizingCompilers , 2003, J. Univers. Comput. Sci..

[13]  Eric Van Wyk,et al.  Compiler Optimization Correctness by Temporal Logic , 2004, High. Order Symb. Comput..

[14]  Benjamin Grégoire,et al.  A Structured Approach to Proving Compiler Optimizations Based on Dataflow Analysis , 2004, TYPES.

[15]  Nick Benton,et al.  Simple relational correctness proofs for static analyses and program transformations , 2004, POPL.

[16]  David Sands,et al.  On flow-sensitive security types , 2006, POPL '06.

[17]  Martín Abadi,et al.  A type system for Java bytecode subroutines , 1999, TOPL.

[18]  Martin Hofmann,et al.  Automatic Certification of Heap Consumption , 2004, LPAR.

[19]  Sorin Lerner,et al.  Automatically proving the correctness of compiler optimizations , 2003, PLDI '03.

[20]  Flemming Nielson,et al.  Flow Logic: A Multi-paradigmatic Approach to Static Analysis , 2002, The Essence of Computation.

[21]  Geoffrey Smith,et al.  A Sound Type System for Secure Flow Analysis , 1996, J. Comput. Secur..

[22]  Tarmo Uustalu,et al.  Compositional Type Systems for Stack-Based Low-Level Languages , 2006, CATS.

[23]  David Aspinall,et al.  Optimisation Validation , 2007, COCV@ETAPS.