skip to main content
10.1145/1250734.1250742acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article

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

Published:10 June 2007Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Samuel Boutin. Using reflection to build efficient and certified decision procedures. In Proc. STACS, pages 515--529, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Maulik A. Dave. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes, 28(6):2--2, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarCross RefCross Ref
  6. Eduardo Giménez. Codifying guarded definitions with recursive schemes. In Proc. TYPES, pages 39--59. Springer--Verlag, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. Furio Honsell and Donald Sannella. Pre-logical relations. In Proc. CSL, pages 546--561, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. Conor McBride and James McKinna. The view from the left. J. Functional Programming, 14(1):69--111, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Yasuhiko Minamide, Greg Morrisett, and Robert Harper. Typed closure conversion. Technical Report CMU--CS--FOX--95--05, Carnegie Mellon University, 1995.Google ScholarGoogle Scholar
  12. J. Strother Moore. A mechanically verified language implementation. J. Automated Reasoning, 5(4):461--492, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Andrew McCreight, Zhong Shao, Chunxiao Lin, and Long Li. A general framework for certifying garbage collectors and their mutators. In Proc. PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. F. Pfenning and C. Elliot. Higher-order abstract syntax. In Proc. PLDI, pages 199--208, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. G. D. Plotkin. Lambda-definability and logical relations. Memorandum SAI-RM-4, University of Edinburgh, 1973.Google ScholarGoogle Scholar
  17. Gordon D. Plotkin. Call-by-name, call-by-value, and the lambda calculus. Theoretical Computer Science, 1:125--159, 1975.Google ScholarGoogle ScholarCross RefCross Ref
  18. Frank Pfenning and Carsten Schürmann. System description: Twelf-a meta-logical framework for deductive systems. In Proc. CADE, pages 202--206, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Emir Pasalic, Walid Taha, and Tim Sheard. Tagless staged interpreters for typed languages. In Proc. ICFP, pages 218--229, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Tim Sheard. Languages of the future. In Proc. OOPSLA, pages 116--119, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Matthieu Sozeau. Subset coercions in Coq. In Proc. TYPES, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

                Recommendations

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation
                  June 2007
                  508 pages
                  ISBN:9781595936332
                  DOI:10.1145/1250734
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 42, Issue 6
                    Proceedings of the 2007 PLDI conference
                    June 2007
                    491 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/1273442
                    Issue’s Table of Contents

                  Copyright © 2007 ACM

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 10 June 2007

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • Article

                  Acceptance Rates

                  Overall Acceptance Rate406of2,067submissions,20%

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader
                About Cookies On This Site

                We use cookies to ensure that we give you the best experience on our website.

                Learn more

                Got it!