skip to main content
research-article
Free Access

Formal verification of a realistic compiler

Published:01 July 2009Publication History
Skip Abstract Section

Abstract

This paper reports on the development and formal verification (proof of semantic preservation) of CompCert, a compiler from Clight (a large subset of the C programming language) to PowerPC assembly code, using the Coq proof assistant both for programming the compiler and for proving its correctness. Such a verified compiler is useful in the context of critical software and its formal verification: the verification of the compiler guarantees that the safety properties proved on the source code hold for the executable compiled code as well.

References

  1. ]]Appel, A.W. Foundational proof-carrying code. In Logic in Computer Science 2001 (2001), IEEE, 247--258. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. ]]Appel, A.W., Blazy, S. Separation logic for small-step Cminor. In Theorem Proving in Higher Order Logics, TPHOLs 2007, volume 4732 of LNCS (2007), Springer, 5--21. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. ]]Bertot, Y., Castéran, P. Interactive Theorem Proving and Program Development---Coq'Art: The Calculus of Inductive Constructions (2004), Springer. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. ]]Blazy, S., Dargaye, Z., Leroy, X. Formal verification of a C compiler front-end. In FM 2006: International Symposium on Formal Methods, volume 4085 of LNCS (2006), Springer, 460--475. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. ]]Blazy, S., Leroy, X. Mechanized semantics for the Clight subset of the C language. J. Autom. Reasoning (2009). Accepted for publication, to appear.Google ScholarGoogle Scholar
  6. ]]Chaitin, G.J. Register allocation and spilling via graph coloring. In 1982 SIGPLAN Symposium on Compiler Construction (1982), ACM, 98--105. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. ]]Coq development team. The Coq proof assistant. Available at http://coq.inria.fr/, 1989--2009.Google ScholarGoogle Scholar
  8. ]]Dave, M.A. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes 28, 6 (2003), 2. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. ]]George, L., Appel, A.W. Iterated register coalescing. ACM Trans, Prog. Lang. Syst. 18, 3 (1996), 300--324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. ]]Hales, T.C. Formal proof. Notices AMS 55, 11 (2008), 1370--1380.Google ScholarGoogle Scholar
  11. ]]Leroy, X. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In 33rd Symposium on the Principles of Programming Languages (2006), ACM, 42--54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. ]]Leroy, X. The CompCert verified compiler, software and commented proof. Available at http://compcert.inria.fr/, Aug.2008.Google ScholarGoogle Scholar
  13. ]]Leroy, X. A formally verified compiler back-end. arXiv:0902.2137 {cs}. Submitted, July 2008.Google ScholarGoogle Scholar
  14. ]]Leroy, X., Blazy, S. Formal verification of a C-like memory model and its uses for verifying program transformations. J. Autom. Reasoning 41, 1 (2008), 1--31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. ]]Letouzey, P. Extraction in Coq: An overview. In Logic and Theory of Algorithms, Computability in Europe, CiE 2008, volume 5028 of LNCS (2008), Springer, 359--369. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. ]]McCarthy, J., Painter, J. Correctness of a compiler for arithmetical expressions. In Mathematical Aspects of Computer Science, volume 19 of Proceedings of Symposia in Applied Mathematics (1967), AMS, 33--41.Google ScholarGoogle Scholar
  17. ]]Milner, R., Weyhrauch, R. Proving compiler correctness in a mechanized logic. In Proceedings of 7th Annual Machine Intelligence Workshop, volume 7 of Machine Intelligence (1972), Edinburgh University Press, 51--72.Google ScholarGoogle Scholar
  18. ]]Morrisett, G., Walker, D., Crary, K., Glew, N. From System F to typed assembly language. ACM Trans. Prog. Lang. Syst. 21, 3 (1999), 528--569. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. ]]Necula, G.C. Proof-carrying code. In 24th Symposium on the Principles of Programming Languages (1997), ACM, 106--119. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. ]]Necula, G.C. Translation validation for an optimizing compiler. In Programming Language Design and Implementation 2000 (2000), ACM, 83--95. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. ]]Necula, G.C., McPeak, S., Rahul, S.P., Weimer, W. CIL: Intermediate language and tools for analysis and transformation of C programs. In Compiler Construction, volume 2304 of LNCS (2002), Springer, 213--228. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. ]]Pnueli, A., Siegel, M., Singerman, E. Translation validation. In Tools and Algorithms for Construction and Analysis of Systems, TACAS '98, volume 1384 of LNCS (1998), Springer, 151--166. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. ]]Tristan, J.-B., Leroy, X. Formal verification of translation validators: A case study on instruction scheduling optimizations. In 35th Symposium of the Principles of Programming Languages (2008), ACM, 17--27. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. ]]Tristan, J.-B., Leroy, X. Verified validation of lazy code motion. In Programming Language Design and Implementation 2009 (2009), ACM. To appear. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Formal verification of a realistic compiler

                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

                Full Access

                • Published in

                  cover image Communications of the ACM
                  Communications of the ACM  Volume 52, Issue 7
                  Barbara Liskov: ACM's A.M. Turing Award Winner
                  July 2009
                  141 pages
                  ISSN:0001-0782
                  EISSN:1557-7317
                  DOI:10.1145/1538788
                  Issue’s Table of Contents

                  Copyright © 2009 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 1 July 2009

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article
                  • Popular
                  • Refereed

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader

                HTML Format

                View this article in HTML Format .

                View HTML Format