paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mostly Automated Proof Repair for Verified Libraries

面向已验证库的半自动化证明修复
PLDI 7(PLDI)2023匹配度 4/10 · 论文属于程序验证与证明修复,与形式化验证方向相邻,但未涉及用户核心关注的 LLM/Agent、ML 系统静态分析、浮点程序分析或贝叶斯程序分析。其自动化依赖动态对齐与不变量综合,不属于“用 LLM/Agent 改进形式化验证”的路线,因此匹配度有限。引用 11 inbox
Kiran Gopinathan, Mayank Keoliya, Ilya Sergey
crossref: 2026-09-10

AI 速览

一句话:提出首个高阶命令式函数的证明修复方法,在 Coq 中结合动态对齐和不变量综合,自动生成大部分证明并留下少量残余义务。

形式化验证软件的维护成本很高:代码演化后必须同步更新证明,即证明修复。难点是为已验证程序的新版本推断足够强的不变量以证明完整正确性。本文提出首个面向高阶命令式函数的证明修复方法,处理在 Coq 中验证且规约不变的程序,结合动态程序对齐、枚举式不变量综合,以及利用 Coq 证明证书构造性剪枝的 proof-driven testing。工具 Sisyphus 接受已验证的 OCaml 函数及其未验证新版本,自动生成 Coq 证明并给出高置信残余义务。在 10 个涉及数组和可变结构的流行库 OCaml 程序上,它成功修复全部证明,找到正确不变量,残余义务少且易证。

问题
维护已验证软件需持续同步代码与证明;证明修复的难点在于为演化后的程序推断足够强的不变量,以保持原规约下的完整函数正确性。
方法
提出首个针对高阶命令式函数的证明修复方法,结合动态程序对齐、枚举式不变量合成,以及利用 Coq 证明证书构造性的 proof-driven testing 剪枝候选;实现工具 Sisyphus。
评估
在 10 个来自流行库、涉及数组和可变数据结构的 OCaml 程序上评估,Sisyphus 修复了全部证明,合成正确不变量,仅留下少量易证残余义务。
原文摘要(Abstract)

The cost of maintaining formally specified and verified software is widely considered prohibitively high due to the need to constantly keep code and the proofs of its correctness in sync—the problem known as proof repair . One of the main challenges in automated proof repair for evolving code is to infer invariants for a new version of a once verified program that are strong enough to establish its full functional correctness. In this work, we present the first proof repair methodology for higher-order imperative functions, whose initial versions were verified in the Coq proof assistant and whose specifications remained unchanged. Our proof repair procedure is based on the combination of dynamic program alignment, enumerative invariant synthesis, and a novel technique for efficiently pruning the space of invariant candidates, dubbed proof-driven testing , enabled by the constructive nature of Coq’s proof certificates. We have implemented our approach in a mostly-automated proof repair tool called Sisyphus. Given an OCaml function verified in Coq and its unverified new version, Sisyphus produces a Coq proof for the new version, discharging most of the new proof goals automatically and suggesting high-confidence obligations for the programmer to prove for the cases when automation fails. We have evaluated Sisyphus on 10 OCaml programs taken from popular libraries, that manipulate arrays and mutable data structures, considering their verified original and unverified evolved versions. Sisyphus has managed to repair proofs for all those functions, suggesting correct invariants and generating a small number of easy-to-prove residual obligations.

链接与引用

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

BibTeX
@article{paperbot1978,
  title = {Mostly Automated Proof Repair for Verified Libraries},
  author = {Kiran Gopinathan and Mayank Keoliya and Ilya Sergey},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591221}
}