arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.22114cs.SE
收藏

代理程序验证中的引理发现

Automated Lemma Discovery in Agentic Program Verification

National University of Singapore(新加坡国立大学);Massachusetts Institute of Technology(麻省理工学院)

Huan Zhao, Haoxin Tu, Zhengyao Liu, Martin C. Rinard, Abhik Roychoudhury

AI总结:

本文提出LemmaNet代理,通过分析源代码和规格,发现辅助引理以提升程序验证的正确性保证。

摘要:

演绎验证通过提取验证条件(VCs)并为其编写形式证明,为代码提供强正确性保证。VC证明的专家密集型任务是该过程的主要瓶颈,但近期大语言模型(LLM)代理的进步部分自动化了这一过程。然而,现有证明代理无法发现辅助引理——用于证明的辅助引理,因此在程序规模和复杂性增加时表现不足。本文认为程序验证中的VC证明不仅是纯粹数学任务,还应受益于程序理解。我们的关键见解是,人类证明工程师常基于对程序语义的理解发现和应用辅助引理,这些引理不直接反映在VC生成器产生的VC中。受此启发,我们提出LemmaNet代理,通过两种方式发现辅助引理:首先,代理通过直接分析源代码和规格合成引理;然后,将这种语义理解与VC生成器产生的机械、冗长编码相关联。随着证明展开,LemmaNet则在线调整现有辅助引理以适应演进的证明状态,使代理能够有效消解复杂VC。我们评估了LemmaNet在SV-COMP和已建立的现实世界主题上的表现,包括Linux内核模块、Contiki OS、标准C++库和X.509解析器。实验结果表明,LemmaNet显著优于现有最先进方法,突显了程序理解辅助的引理发现对于代理程序验证的重要性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑