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