Live Verification in an Interactive Proof Assistant
Samuel Gruetter, Viktor Fukala, Adam Chlipala
Abstract
We present a prototype for a tool that enables programmers to verify their code as they write it in real-time. After each line of code that the programmer writes, the tool tells the programmer whether it was able to prove absence of undefined behavior so far, and it displays a concise representation of the symbolic state of the program right after the added line. The user can then either write the next line of code, or if needed or desired, write a specially marked comment that provides hints on how to solve side conditions or on how to represent the symbolic state more nicely. Once the programmer has finished writing the program, it is already verified with a mathematical correctness proof. Other tools providing real-time feedback already exist, but ours is the first one that only relies on a small trusted proof checker and that provides a concise summary of the symbolic state at the point in the program currently being edited, as opposed to only indicating whether user-stated assertions or postconditions hold.
Program verification requires loop invariants, which are hard to find and tedious to spell out. We explore a middle ground in the design space between the two extremes of requiring users to spell out loop invariants manually and attempting to infer loop invariants automatically: Since a loop invariant often looks quite similar to the symbolic state right before the loop, our tool asks the user to express the desired loop invariant as a diff from the symbolic state before the loop, which has the potential to lead to shorter, more maintainable proofs.
We prototyped our technique in the interactive proof assistant Coq, so our framework creates machinechecked proofs that the developed functions satisfy their specifications when executed according to the formal semantics of the source language. Using a verified compiler proven against the same source-language semantics, we can ensure that the behavior of the compiled program matches the program's behavior as represented by the framework during the proof. Additionally, since our polyglot source files can be viewed as Coq or C files at the same time, users willing to accept a larger trusted code base can compile them with GCC.
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 dc86dd2b-01e3-4b18-8f97-30f7f74a7100Cited by top-tier papers2
- PulseCore: An Impredicative Concurrent Separation Logic for Dependently Typed ProgramsGabriel Ebner, Guido Martínez, Aseem Rastogi, Thibault Dardinier et al.PLDI 2025 · 8 citations
- Smooth, Integrated Proofs of Cryptographic Constant Time for Nondeterministic Programs and CompilersOwen Conoly, Andres Erbsen, Adam ChlipalaPLDI 2025 · 1 citation
Builds on2
- Integration verification across software and hardware for a simple embedded systemAndres Erbsen, Samuel Gruetter, Joonwon Choi, Clark Wood et al.PLDI 2021 · 29 citations
- Relational compilation for performance-critical applications: extensible proof-producing translation of functional models into low-level codeClément Pit-Claudel, Jade Philipoom, Dustin Jamner, Andres Erbsen et al.PLDI 2022 · 26 citations
Related papers
- TacTok: semantics-aware proof synthesisEmily First, Yuriy Brun, Arjun GuhaOOPSLA 2020 · 39 citations
- Mostly Automated Proof Repair for Verified LibrariesKiran Gopinathan, Mayank Keoliya, Ilya SergeyPLDI 2023 · 11 citations
- Synthesizing Implication Lemmas for Interactive Theorem ProvingAna Brendel, Aishwarya Sivaraman, Todd D. MillsteinOOPSLA 2025
- Sound Gradual Verification with Symbolic ExecutionConrad Zimmerman, Jenna DiVincenzo, Jonathan AldrichPOPL 2024 · 7 citations
- VST-A: A Foundationally Sound Annotation VerifierLitao Zhou, Jianxing Qin, Qinshi Wang, Andrew W. Appel et al.POPL 2024 · 12 citations
