Relational compilation for performance-critical applications: extensible proof-producing translation of functional models into low-level code
Clément Pit-Claudel, Jade Philipoom, Dustin Jamner, Andres Erbsen, Adam Chlipala
Abstract
There are typically two ways to compile and run a purely functional program verified using an interactive theorem prover (ITP): automatically extracting it to a similar language (typically an unverified process, like Coq to OCaml) or manually proving it equivalent to a lower-level reimplementation (like a C program). Traditionally, only the latter produced both excellent performance and end-to-end proofs.
This paper shows how to recast program extraction as a proof-search problem to automatically derive correct-byconstruction, high-performance code from purely functional programs. We call this idea relational compilation Ð it extends recent developments with novel solutions to loop-invariant inference and genericity in kinds of side effects.
Crucially, relational compilers are incomplete, and unlike traditional compilers, they generate good code not because of a fixed set of clever built-in optimizations but because they allow experts to plug in domainśspecific extensions that give them complete control over the compiler's output.
We demonstrate the benefits of this approach with Rupicola, a new compiler-construction toolkit designed to extract fast, verified, idiomatic low-level code from annotated functional models. Using case studies and performance benchmarks, we show that it is extensible with minimal effort and that it achieves performance on par with that of handwritten C programs.
- All work was done prior to joining Amazon.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ba0fd49b-100b-423c-b7db-698fb44c7b95Cited by top-tier papers9
- Verified Extraction from Coq to OCamlYannick Forster, Matthieu Sozeau, Nicolas TabareauPLDI 2024 · 13 citations
- Foundational Integration Verification of a Cryptographic ServerAndres Erbsen, Jade Philipoom, Dustin Jamner, Ashley Lin et al.PLDI 2024 · 8 citations
- The Functional Essence of Imperative Binary Search TreesAnton Lorenzen, Daan Leijen, Wouter Swierstra, Sam LindleyPLDI 2024 · 6 citations
- Live Verification in an Interactive Proof AssistantSamuel Gruetter, Viktor Fukala, Adam ChlipalaPLDI 2024 · 3 citations
- A Verified Compiler for a Functional Tensor LanguageAmanda Liu, Gilbert Bernstein, Adam Chlipala, Jonathan Ragan-KelleyPLDI 2024 · 2 citations
Builds on3
- EverCrypt: A Fast, Verified, Cross-Platform Cryptographic ProviderJonathan Protzenko, Bryan Parno, Aymeric Fromherz, Chris Hawblitzel et al.S&P 2020 · 114 citations
- Perceus: garbage free reference counting with reuseAlex Reinking, Ningning Xie, Leonardo de Moura, Daan LeijenPLDI 2021 · 31 citations
- Integration verification across software and hardware for a simple embedded systemAndres Erbsen, Samuel Gruetter, Joonwon Choi, Clark Wood et al.PLDI 2021 · 29 citations
Related papers
- Effectively Propositional Higher-Order Functional ProgrammingNicholas V. Lewchenko, Kunha Kim, Bor-Yuh Evan Chang, Gowtham KakiOOPSLA 2026
- Coq Coq correct! verification of type checking and erasure for Coq, in CoqMatthieu Sozeau, Simon Boulier, Yannick Forster, Nicolas Tabareau et al.POPL 2020 · 67 citations
- PureCake: A Verified Compiler for a Lazy Functional LanguageHrutvik Kanabar, Samuel Vivien, Oskar Abrahamsson, Magnus O. Myreen et al.PLDI 2023 · 7 citations
- Computing correctly with inductive relationsZoe Paraskevopoulou, Aaron Eline, Leonidas LampropoulosPLDI 2022 · 16 citations
- Cakes That Bake Cakes: Dynamic Computation in CakeMLThomas Sewell, Magnus O. Myreen, Yong Kiam Tan, Ramana Kumar et al.PLDI 2023 · 16 citations
