Correctly Compiling Proofs About Programs Without Proving Compilers Correct

Audrey Seo, Christopher Lam, Dan Grossman, Talia Ringer

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

Guaranteeing correct compilation is nearly synonymous with compiler verification. However, the correctness guarantees for certified compilers and translation validation can be stronger than we need. While many compilers do have incorrect behavior, even when a compiler bug occurs it may not change the program's behavior meaningfully with respect to its specification. Many real-world specifications are necessarily partial in that they do not completely specify all of a program's behavior. While compiler verification and formal methods have had great success for safety-critical systems, there are magnitudes more code, such as math libraries, compiled with incorrect compilers, that would benefit from a guarantee of its partial specification. This paper explores a technique to get guarantees about compiled programs even in the presence of an unverified, or even incorrect, compiler. Our workflow compiles programs, specifications, and proof objects, from an embedded source language and logic to an embedded target language and logic. We implement two simple imperative languages, each with its own Hoare-style program logic, and a system for instantiating proof compilers out of compilers between these two languages that fulfill certain equational conditions in Coq. We instantiate our system on four compilers: one that is incomplete, two that are incorrect, and one that is correct but unverified. We use these instances to compile Hoare proofs for several programs, and we are able to leverage compiled proofs to assist in proofs of larger programs. Our proof compiler system is formally proven sound in Coq. We demonstrate how our approach enables strong target program guarantees even in the presence of incorrect compilation, opening up new options for which proof burdens one might shoulder instead of, or in addition to, compiler correctness.

Original languageEnglish (US)
Title of host publication15th International Conference on Interactive Theorem Proving, ITP 2024
EditorsYves Bertot, Temur Kutsia, Michael Norrish
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
ISBN (Electronic)9783959773379
DOIs
StatePublished - Sep 2024
Event15th International Conference on Interactive Theorem Proving, ITP 2024 - Tbilisi, Georgia
Duration: Sep 9 2024Sep 14 2024

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
Volume309
ISSN (Print)1868-8969

Conference

Conference15th International Conference on Interactive Theorem Proving, ITP 2024
Country/TerritoryGeorgia
CityTbilisi
Period9/9/249/14/24

Keywords

  • compiler validation
  • program logics
  • proof engineering
  • proof transformations

ASJC Scopus subject areas

  • Software

Fingerprint

Dive into the research topics of 'Correctly Compiling Proofs About Programs Without Proving Compilers Correct'. Together they form a unique fingerprint.

Cite this