A certified type-preserving compiler from lambda calculus to assembly language

We present a certified compiler from the simply-typed lambda calculus to assembly language. The compiler is certified in the sense that it comes with a machine-checked proof of semantics preservation, performed with the Coq proof assistant. The compiler and the terms of its several intermediate languages are given dependent types that guarantee that only well-typed programs are representable. Thus, type preservation for each compiler pass follows without any significant "proofs" of the usual kind. Semantics preservation is proved based on denotational semantics assigned to the intermediate languages. We demonstrate how working with a type-preserving compiler enables type-directed proof search to discharge large parts of our proof obligations automatically.

[1]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[2]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[3]  Eduardo Giménez,et al.  Codifying Guarded Definitions with Recursive Schemes , 1994, TYPES.

[4]  Maulik A. Dave,et al.  Compiler verification: a bibliography , 2003, SOEN.

[5]  Matthieu Sozeau,et al.  Subset Coercions in Coq , 2006, TYPES.

[6]  Xavier Leroy,et al.  Formal certification of a compiler back-end or: programming a compiler with a proof assistant , 2006, POPL '06.

[7]  de Ng Dick Bruijn Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem , 1972 .

[8]  Mitchell Wand,et al.  VLISP: A verified implementation of Scheme , 1995, LISP Symb. Comput..

[9]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[10]  Samuel Boutin,et al.  Using Reflection to Build Efficient and Certified Decision Procedures , 1997, TACS.

[11]  Louis-Julien Guillemette A type-preserving compiler from system f to typed assembly language , 2009 .

[12]  Long Li,et al.  A general framework for certifying garbage collectors and their mutators , 2007, PLDI '07.

[13]  Conor McBride,et al.  The view from the left , 2004, Journal of Functional Programming.

[14]  J. Strother Moore,et al.  A mechanically verified language implementation , 1989, Journal of Automated Reasoning.

[15]  Furio Honsell,et al.  Pre-logical Relations , 1999, CSL.

[16]  Walid Taha,et al.  Tagless staged interpreters for typed languages , 2002, ICFP '02.

[17]  Frank Pfenning,et al.  System Description: Twelf - A Meta-Logical Framework for Deductive Systems , 1999, CADE.

[18]  Peter Lee,et al.  TIL: a type-directed, optimizing compiler for ML , 2004, SIGP.

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

[20]  Benjamin C. Pierce,et al.  Mechanized Metatheory for the Masses: The PoplMark Challenge , 2005, TPHOLs.

[21]  Tim Sheard Languages of the future , 2004, ACM SIGPLAN Notices.