[Paper Review] Lemma Discovery in Agentic Program Verification
The paper introduces LemmaNet, an LLM-based agent that discovers helper lemmas offline from source code and online during proving to bridge semantics-aware and proof-targeted verification conditions, improving deductive verification on real-world software.
Deductive verification provides strong correctness guarantees for code by extracting verification conditions (VCs) and writing formal proofs for them. The expertise-intensive task of VC proving is the main bottleneck in this process, and has been partly automated owing to recent advances in Large Language Model (LLM) agents. However, existing proof agents are not able to discover helper lemmas - auxiliary lemmas that aid in proving - and thus fall short as programs grow in size and complexity. In this paper, we argue that VC proving for program verification is more than a purely mathematical task, and benefits considerably from program comprehension. Our key insight is that human-proof engineers often discover and apply helper lemmas based on their understanding of the program semantics, which are not directly reflected in the VCs produced by VC generators. Inspired by this insight, we propose an LLM agent, LemmaNet, that discovers helper lemmas in two ways. Specifically, the agent first synthesizes lemmas offline by directly analyzing the source code and specifications, and then relating this semantic understanding to the mechanical, verbose encoding produced by VC generators. As the proof unfolds, LemmaNet then adapts existing helper lemmas online to accommodate evolving proof states, enabling the agent to effectively discharge complex VCs on-the-fly. We evaluate LemmaNet on SV-COMP and established real-world subjects, including modules of the Linux kernel, Contiki OS, standard C++ library, and X.509 parser. Our experimental results demonstrate that LemmaNet significantly outperforms state-of-the-art approaches, highlighting the importance of program comprehension-aided lemma discovery in agentic program verification.
Motivation & Objective
- Demonstrate that VC proving benefits from program comprehension through helper-lemma discovery.
- Propose a dual-stage LemmaNet architecture with offline lemma synthesis and online lemma adaptation.
- Show that integrating semantics-aware VCs with proof-targeted VCs improves discharge of complex verification conditions.
- Evaluate LemmaNet on real-world software and benchmarks to establish effectiveness and robustness.
Proposed method
- Offline lemma synthesis analyzes source code and specifications to generate semantics-aligned helper lemmas bridging semantics-aware VCs and proof-targeted VCs.
- Online lemma adapter refines and adapts helper lemmas during proving based on feedback from the proof assistant.
- System built on top of an existing tactic-by-tactic proof agent, with a program semantic analyzer and obligation-aligned lemma synthesis.
- Phased workflow: generate semantics-aware VC; synthesize bridging lemmas; discharge VC with a trusted VC generator; adapt lemmas online as proof states evolve.
Experimental results
Research questions
- RQ1Can helper lemmas derived from program semantics improve discharge of verification conditions produced by traditional VC generators?
- RQ2How can offline semantic analysis and online adaptation co-operate to bridge gaps between semantics-aware and proof-targeted VCs?
- RQ3Do lemma-discovery-enabled agents outperform state-of-the-art proof agents on real-world software verification tasks?
- RQ4What kinds of real-world software (e.g., Linux kernel modules, Contiki OS, standard libraries) benefit most from semantic lemma discovery?
Key findings
- LemmaNet significantly outperforms state-of-the-art proof agents AutoRocq and Copra by 26.8%–51.7% on benchmarks.
- Offline synthesis derives helper lemmas aligned with program semantics that bridge semantics-aware and proof-targeted VCs.
- Online lemma adaptation refines lemmas during proving to handle evolving proof states, improving discharge of complex VCs.
- Evaluation includes Linux kernel modules, Contiki OS, X.509 parser, and standard C++ library.
- The approach highlights the importance of program comprehension for lemma discovery in agentic program verification.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.