Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Free access

Formal verification of a realistic compiler

Published: 01 July 2009 Publication History

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.
[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.
[3]
]]Bertot, Y., Castéran, P. Interactive Theorem Proving and Program Development---Coq'Art: The Calculus of Inductive Constructions (2004), Springer.
[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.
[5]
]]Blazy, S., Leroy, X. Mechanized semantics for the Clight subset of the C language. J. Autom. Reasoning (2009). Accepted for publication, to appear.
[6]
]]Chaitin, G.J. Register allocation and spilling via graph coloring. In 1982 SIGPLAN Symposium on Compiler Construction (1982), ACM, 98--105.
[7]
]]Coq development team. The Coq proof assistant. Available at http://coq.inria.fr/, 1989--2009.
[8]
]]Dave, M.A. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes 28, 6 (2003), 2.
[9]
]]George, L., Appel, A.W. Iterated register coalescing. ACM Trans, Prog. Lang. Syst. 18, 3 (1996), 300--324.
[10]
]]Hales, T.C. Formal proof. Notices AMS 55, 11 (2008), 1370--1380.
[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.
[12]
]]Leroy, X. The CompCert verified compiler, software and commented proof. Available at http://compcert.inria.fr/, Aug.2008.
[13]
]]Leroy, X. A formally verified compiler back-end. arXiv:0902.2137 {cs}. Submitted, July 2008.
[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.
[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.
[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.
[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.
[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.
[19]
]]Necula, G.C. Proof-carrying code. In 24th Symposium on the Principles of Programming Languages (1997), ACM, 106--119.
[20]
]]Necula, G.C. Translation validation for an optimizing compiler. In Programming Language Design and Implementation 2000 (2000), ACM, 83--95.
[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.
[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.
[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.
[24]
]]Tristan, J.-B., Leroy, X. Verified validation of lazy code motion. In Programming Language Design and Implementation 2009 (2009), ACM. To appear.

Cited By

View all
  • (2024)Analysis and Control of Partially Observed Discrete-Event Systems via Positively Constructed FormulasComputation10.3390/computation1205009512:5(95)Online publication date: 9-May-2024
  • (2024)On the application of the calculus of positively constructed formulas for the study of controlled discrete-event systemsModeling and Analysis of Information Systems10.18255/1818-1015-2024-1-54-7731:1(54-77)Online publication date: 28-Mar-2024
  • (2024)Dafny vs. Dala: Experience with Mechanising Language DesignProceedings of the 26th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3678721.3686228(37-43)Online publication date: 20-Sep-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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: 01 July 2009
Published in CACM Volume 52, Issue 7

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Research-article
  • Popular
  • Refereed

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1,077
  • Downloads (Last 6 weeks)166
Reflects downloads up to 26 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Analysis and Control of Partially Observed Discrete-Event Systems via Positively Constructed FormulasComputation10.3390/computation1205009512:5(95)Online publication date: 9-May-2024
  • (2024)On the application of the calculus of positively constructed formulas for the study of controlled discrete-event systemsModeling and Analysis of Information Systems10.18255/1818-1015-2024-1-54-7731:1(54-77)Online publication date: 28-Mar-2024
  • (2024)Dafny vs. Dala: Experience with Mechanising Language DesignProceedings of the 26th ACM International Workshop on Formal Techniques for Java-like Programs10.1145/3678721.3686228(37-43)Online publication date: 20-Sep-2024
  • (2024)Sound Borrow-Checking for Rust via Symbolic SemanticsProceedings of the ACM on Programming Languages10.1145/36746408:ICFP(426-454)Online publication date: 15-Aug-2024
  • (2024)A Safe Low-Level Language for Computer Algebra and Its Formally Verified CompilerProceedings of the ACM on Programming Languages10.1145/36746298:ICFP(121-146)Online publication date: 15-Aug-2024
  • (2024)LLM-Enhanced Theorem Proving with Term Explanation and Tactic Parameter Repair✱Proceedings of the 15th Asia-Pacific Symposium on Internetware10.1145/3671016.3674823(21-30)Online publication date: 24-Jul-2024
  • (2024)Finding and Understanding Defects in Static Analyzers by Constructing Automated OraclesProceedings of the ACM on Software Engineering10.1145/36607811:FSE(1656-1678)Online publication date: 12-Jul-2024
  • (2024)Proving Correctness of Parallel Implementations of Transition System ModelsACM Transactions on Programming Languages and Systems10.1145/366063046:3(1-50)Online publication date: 20-Apr-2024
  • (2024)Bringing the WebAssembly Standard up to Speed with SpecTecProceedings of the ACM on Programming Languages10.1145/36564408:PLDI(1559-1584)Online publication date: 20-Jun-2024
  • (2024)Qubit Recycling RevisitedProceedings of the ACM on Programming Languages10.1145/36564288:PLDI(1264-1287)Online publication date: 20-Jun-2024
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Digital Edition

View this article in digital edition.

Digital Edition

Magazine Site

View this article on the magazine site (external)

Magazine Site

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media