Accelerating Verified-Compiler Development with a Verified Rewriting Engine

Jason Gross, Andres Erbsen, Jade Philipoom, Rajashree Agrawal, Adam Chlipala
5/2/2022
7 citations
cs.PL

Official code: mit-plv/fiat-crypto (850 stars, Rocq Prover, last commit 2026-11-11). 1 more implementation below.

Abstract

Compilers are a prime target for formal verification, since compiler bugs invalidate higher-level correctness guarantees, but compiler changes may become more labor-intensive to implement, if they must come with proof patches. One appealing approach is to present compilers as sets of algebraic rewrite rules, which a generic engine can apply efficiently.

Show full abstract

Now each rewrite rule can be proved separately, with no need to revisit past proofs for other parts of the compiler. We present the first realization of this idea, in the form of a framework for the Coq proof assistant. Our new Coq command takes normal proved theorems and combines them automatically into fast compilers with proofs. We applied our framework to improve the Fiat Cryptography toolchain for generating cryptographic arithmetic, producing an extracted command-line compiler that is about 1000$\times$ faster while actually featuring simpler compiler-specific proofs.

View on arXivView PDF

Code Implementations(2)

Code implementations of this paper
RepositoryTypeStarsLanguageLicenseLast commit
mit-plv/fiat-cryptoOfficial850Rocq Prover–2026-11-11
mit-plv/rewriterOfficial27Rocq Prover–2026-11-14

Cryptographic Primitive Code Generation by Fiat

850181Rocq Prover, AssemblySep 10, 20152 weeks agoNOASSERTION
mit-plv/rewriterOfficial100%

Reflective PHOAS rewriting/pattern-matching-compilation framework for simply-typed equalities and let-lifting

2725Rocq Prover, PythonOct 15, 20192 weeks agoNOASSERTION

Similar Papers

Cite this paper

@article{gross2022accelerating,
  title  = {Accelerating Verified-Compiler Development with a Verified Rewriting Engine},
  author = {Jason Gross and Andres Erbsen and Jade Philipoom and Rajashree Agrawal and Adam Chlipala},
  year   = {2022},
  eprint = {2205.00862},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.00862}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.00862.svg)](https://codeofpaper.com/paper/2205.00862)

Discussion