Automated Lemma Discovery in Agentic Program Verification
On the map: LLM agents and tool use → Educational agents and math problem solving
Abstract (arXiv)
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 implement LemmaNet on top of an existing proof agent AutoRocq for Rocq and the Frama-C ecosystem, and evaluate it 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.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Placed in Educational agents and math problem solving, one of 16 directions in LLM agents and tool use. Builds on 14 of its 68 references that are in the map. First posted on arXiv 23 Mar 2026.
Builds on
14 of 68 references.
Closest ancestors · 1
Same direction, newest first
Other references · 13
- 2023Using an LLM to Help With Code Understandingcited by 222
- 2019Learning to Prove Theorems via Interacting with Proof Assistantscited by 107
- 2024Enchanting Program Specification Synthesis by Large Language Models using Static Analysis and Program Verificationcited by 55
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2025RepoAudit: An Autonomous LLM-Agent for Repository-Level Code Auditingcited by 47
- 2019Generating Correctness Proofs with Neural Networkscited by 36
- 2024Rango: Adaptive Retrieval-Augmented Proving for Automated Software Verificationcited by 25
- 2022Passport: Improving Automated Formal Verification Using Identifierscited by 19
- 2018Deductive Verification of Unmodified Linux Kernel Library Functionscited by 5
- 2025Adaptive Proof Refinement with LLM-Guided Strategy Selectioncited by 4
- 2026Neural Theorem Proving for Verification Conditions: A Real-World Benchmarkcited by 4
- 2025PAT-Agent: Autoformalization for Model Checkingcited by 3
1 more
Built on by
Citing papers per year: 2026: 2.
2 papers.
Similar, not cited
Close in wording, no citation either way
- 2026Harnessing Code Agents for Automatic Software Verification
- 2026Agentic Proving for Program Verification
- 2026AoA: Theorem Proving Agent over Abstract Syntax Tree of Redesigned Language
- 2026Automating Formal Verification with Agent-Guided Tree Search
- 2026SWE-Proof: Can Language Models Resolve Real-World Issues with Machine-Checked Proofs?
- 2026WybeCoder: Verified Imperative Code Generation
- 2025Prover Agent: An Agent-Based Framework for Formal Mathematical Proofs
- 2026On Reasoning-Centric LLM-based Automated Theorem Proving