paperbot · PL 论文追踪

全部论文 待读 收藏

P0 Laurel: Unblocking Automated Verification with Large Language Models

Laurel:用大语言模型解除自动验证的阻塞
OOPSLA 9(OOPSLA1)2025匹配度 8/10 · 该论文将 LLM 用于自动生成 Dafny 断言、辅助形式化验证器,正对应画像中“AI→PL:利用 LLM/Agent 改进静态分析/形式化验证”的核心方向;且论文提出错误定位与代码库示例提示两种领域特定技术,并从真实 Dafny 代码库构建 DafnyGym benchmark,符合画像对问题驱动、理论结合工程和工业落地案例的偏好。引用 9 inbox
Eric Mugnier, Emmanuel Anaya Gonzalez, Nadia Polikarpova, Ranjit Jhala, Zhou Yuanyuan
crossref: 2026-09-10

AI 速览

一句话:Laurel 利用大语言模型自动生成 Dafny 断言,通过错误定位与代码库示例提示,减少验证器所需人工提示。

Dafny 等程序验证器将证明交给 SMT 求解器自动化,但求解器常需要断言作为提示,给证明工程师带来负担。本文提出 Laurel,用大语言模型自动生成缺失断言。为提升成功率,作者设计两种领域特定提示技术:分析验证器错误信息以确定缺失断言位置并插入占位符;基于新的证明相似度度量,从同一代码库中选取示例断言提供给模型。作者同时构建 DafnyGym 基准,从三个真实 Dafny 代码库抽取复杂引理。评估表明,在仅少量尝试下,Laurel 能生成超过 56.6% 的所需断言,使 LLM 成为无需人工干预即可解除验证器阻塞的实用工具。

问题
Dafny 等验证器虽借助 SMT 自动化证明,但仍常需人工提供断言提示,增加证明工程负担。
方法
Laurel 用 LLM 自动生成断言,并通过错误信息定位缺失断言、以证明相似度检索同代码库示例进行领域特定提示。
评估
在从三个真实 Dafny 代码库抽取的 DafnyGym 基准上评估,少量尝试即可生成超过 56.6% 的所需断言。
原文摘要(Abstract)

Program verifiers such as Dafny automate proofs by outsourcing them to an SMT solver. This automation is not perfect, however, and the solver often requires hints in the form of assertions, creating a burden for the proof engineer. In this paper, we propose Laurel, a tool that alleviates this burden by automatically generating assertions using large language models (LLMs). To improve the success rate of LLMs in this task, we design two domain-specific prompting techniques. First, we help the LLM determine the location of the missing assertion by analyzing the verifier’s error message and inserting an assertion placeholder at that location. Second, we provide the LLM with example assertions from the same codebase, which we select based on a new proof similarity metric. We evaluate our techniques on our new benchmark DafnyGym , a dataset of complex lemmas we extracted from three real-world Dafny codebases. Our evaluation shows that Laurel is able to generate over 56.6 % of the required assertions given only a few attempts, making LLMs an affordable tool for unblocking program verifiers without human intervention.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3189,
  title = {Laurel: Unblocking Automated Verification with Large Language Models},
  author = {Eric Mugnier and Emmanuel Anaya Gonzalez and Nadia Polikarpova and Ranjit Jhala and Zhou Yuanyuan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA1},
  year = {2025},
  doi = {10.1145/3720499}
}