paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Formalization of Core Why3 in Coq

在 Coq 中形式化 Core Why3
POPL 8(POPL)2024匹配度 3/10 · 该论文属于形式化验证/证明工程,研究 Why3 逻辑片段在 Coq 中的形式语义与证明系统,并未涉及 LLM/Agent 与静态分析/形式化验证的交叉,也不涉及浮点或贝叶斯程序分析。仅可作为形式验证基础设施的背景参考。引用 9 inbox
Joshua M. Cohen, Philip Johnson-Freyd
crossref: 2026-09-10

AI 速览

一句话:在 Coq 中为 Why3 逻辑片段建立形式语义,并机器化验证其证明系统与变换的可靠性。

Why3、Boogie 等中间验证语言把程序验证器的构建转化为逻辑编译问题,但工具链本身是否正确缺乏保证;VST、CakeML 等基础方法虽提供强保证,却难以构建且无法利用 SMT 求解器自动化。作为迈向兼具基础保证与自动化的工具的第一步,本文在 Coq 中为 Why3 的逻辑片段(含多态、代数数据类型、递归函数与谓词、归纳谓词)给出形式语义,并基于该语义构造了一个正确性由构造保证的自然演绎证明系统。作者用该系统验证了 Why3 标准库的部分内容,并证明 Why3 中两个将项与公式转换到后端求解器所支持更简单逻辑的变换是可靠的。

问题
如何确保基于 Why3 这类中间验证语言构建的程序验证器正确,同时又不放弃 SMT 求解器带来的自动化能力。
方法
在 Coq 中为 Why3 的逻辑片段(多态、代数数据类型、递归函数与谓词、归纳谓词)建立形式语义,并据此给出正确性由构造保证的自然演绎证明系统。
评估
使用该证明系统验证 Why3 标准库的部分内容,并证明 Why3 中两个把项与公式转换到后端求解器逻辑的变换具有可靠性。
原文摘要(Abstract)

Intermediate verification languages like Why3 and Boogie have made it much easier to build program verifiers, transforming the process into a logic compilation problem rather than a proof automation one. Why3 in particular implements a rich logic for program specification with polymorphism, algebraic data types, recursive functions and predicates, and inductive predicates; it translates this logic to over a dozen solvers and proof assistants. Accordingly, it serves as a backend for many tools, including Frama-C, EasyCrypt, and GNATProve for Ada SPARK. But how can we be sure that these tools are correct? The alternate foundational approach, taken by tools like VST and CakeML, provides strong guarantees by implementing the entire toolchain in a proof assistant, but these tools are harder to build and cannot directly take advantage of SMT solver automation. As a first step toward enabling automated tools with similar foundational guarantees, we give a formal semantics in Coq for the logic fragment of Why3. We show that our semantics are useful by giving a correct-by-construction natural deduction proof system for this logic, using this proof system to verify parts of Why3’s standard library, and proving sound two of Why3’s transformations used to convert terms and formulas into the simpler logics supported by the backend solvers.

链接与引用

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

BibTeX
@article{paperbot2607,
  title = {A Formalization of Core Why3 in Coq},
  author = {Joshua M. Cohen and Philip Johnson-Freyd},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632902}
}