ABSTRACT
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.
- Brian E. Aydemir, Aaron Bohannon, Matthew Fairbairn, J. Nathan Foster, Benjamin C. Pierce, Peter Sewell, Dimitrios Vytiniotis, Geoffrey Washburn, Stephanie Weirich, and Steve Zdancewic. Mechanized metatheory for the masses: The PoplMark challenge. In Proc. TPHOLs, pages 50--65, 2005. Google Scholar
Digital Library
- Yves Bertot and Pierre Castéran. Interactive Theorem Proving and Program Development. Coq'Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. Springer Verlag, 2004. Google Scholar
Digital Library
- Samuel Boutin. Using reflection to build efficient and certified decision procedures. In Proc. STACS, pages 515--529, 1997. Google Scholar
Digital Library
- Maulik A. Dave. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes, 28(6):2--2, 2003. Google Scholar
Digital Library
- Nicolas G. de Bruijn. Lambda-calculus notation with nameless dummies: a tool for automatic formal manipulation with application to the Church--Rosser theorem. Indag. Math., 34(5):381--392, 1972.Google Scholar
Cross Ref
- Eduardo Giménez. Codifying guarded definitions with recursive schemes. In Proc. TYPES, pages 39--59. Springer--Verlag, 1995. Google Scholar
Digital Library
- Joshua D. Guttman, John D. Ramsdell, and Mitchell Wand. VLISP: A verified implementation of Scheme. Lisp and Symbolic Computation, 8(1/2):5--32, 1995. Google Scholar
Digital Library
- Furio Honsell and Donald Sannella. Pre-logical relations. In Proc. CSL, pages 546--561, 1999. Google Scholar
Digital Library
- Xavier Leroy. Formal certification of a compiler back--end or: programming a compiler with a proof assistant. In Proc. POPL, pages 42--54, 2006. Google Scholar
Digital Library
- Conor McBride and James McKinna. The view from the left. J. Functional Programming, 14(1):69--111, 2004. Google Scholar
Digital Library
- Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. Technical Report CMU--CS--FOX--95--05, Carnegie Mellon University, 1995.Google Scholar
- J. Strother Moore. A mechanically verified language implementation. J. Automated Reasoning, 5(4):461--492, 1989. Google Scholar
Digital Library
- Andrew McCreight, Zhong Shao, Chunxiao Lin, and Long Li. A general framework for certifying garbage collectors and their mutators. In Proc. PLDI, 2007. Google Scholar
Digital Library
- Greg Morrisett, David Walker, Karl Crary, and Neal Glew. From System F to typed assembly language. ACM Trans. Program. Lang. Syst., 21(3):527--568, 1999. Google Scholar
Digital Library
- F. Pfenning and C. Elliot. Higher-order abstract syntax. In Proc. PLDI, pages 199--208, 1988. Google Scholar
Digital Library
- G. D. Plotkin. Lambda-definability and logical relations. Memorandum SAI-RM-4, University of Edinburgh, 1973.Google Scholar
- Gordon D. Plotkin. Call-by-name, call-by-value, and the lambda calculus. Theoretical Computer Science, 1:125--159, 1975.Google Scholar
Cross Ref
- Frank Pfenning and Carsten Schürmann. System description: Twelf-a meta-logical framework for deductive systems. In Proc. CADE, pages 202--206, 1999. Google Scholar
Digital Library
- Emir Pasalic, Walid Taha, and Tim Sheard. Tagless staged interpreters for typed languages. In Proc. ICFP, pages 218--229, 2002. Google Scholar
Digital Library
- Tim Sheard. Languages of the future. In Proc. OOPSLA, pages 116--119, 2004. Google Scholar
Digital Library
- Matthieu Sozeau. Subset coercions in Coq. In Proc. TYPES, 2006. Google Scholar
Digital Library
- D. Tarditi, G. Morrisett, P. Cheng, C. Stone, R. Harper, and P. Lee. TIL: a type--directed optimizing compiler for ML. In Proc. PLDI, pages 181--192, 1996. Google Scholar
Digital Library
Index Terms
A certified type-preserving compiler from lambda calculus to assembly language
Recommendations
A verified compiler for an impure functional language
POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesWe present a verified compiler to an idealized assembly language from a small, untyped functional language with mutable references and exceptions. The compiler is programmed in the Coq proof assistant and has a proof of total correctness with respect to ...
A certified type-preserving compiler from lambda calculus to assembly language
Proceedings of the 2007 PLDI conferenceWe 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 ...
Parametric higher-order abstract syntax for mechanized semantics
ICFP '08We present parametric higher-order abstract syntax (PHOAS), a new approach to formalizing the syntax of programming languages in computer proof assistants based on type theory. Like higher-order abstract syntax (HOAS), PHOAS uses the meta language's ...







Comments