paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Solving constrained Horn clauses modulo algebraic data types and recursive functions

模代数数据类型与递归函数求解约束 Horn 子句
POPL 6(POPL)2022匹配度 3/10 · 论文研究CHC modulo ADT和递归函数的求解与归纳不变式合成,属于纯形式化验证/程序分析,未涉及LLM/Agent、浮点程序分析或贝叶斯程序分析,与用户画像的核心交叉方向不匹配。引用 26 inbox
Hari Govind V K, Sharon Shoham, Arie Gurfinkel
crossref: 2026-09-10

AI 速览

一句话:提出 IC3 启发的 Racer 算法,在 ADT 与 catamorphism 下求解 CHC,自动合成归纳不变式并保证找到不安全反例。

验证操作数据结构(如 Rust)的命令式程序时,验证条件常含代数数据类型(ADT),其归纳不变式需递归定义函数(RDF)表示抽象。该问题归约为同时含 ADT 与 RDF 的约束 Horn 子句(CHC)求解,但底层逻辑不可判定,使 IC3 类算法失去进展保证。本文提出 IC3 启发的 Racer 算法,对 ADT 与 catamorphism 类 RDF 求解 CHC,自动合成归纳不变式。核心是将 catamorphism 编码为 CHC(relationification)以学习归纳性质并保持不可满足性,同时用新抽象编码为 RDF 以展开递归定义,抽象保证理论可判定。Racer 在不可判定理论下仍保证进展,对不安全程序终止并给出反例;在 Z3 中实现且实验效果良好。

问题
验证操作数据结构(如 Rust)的命令式程序时,验证条件包含 ADT 与递归定义函数,底层逻辑不可判定,导致归纳不变式验证困难、IC3 类算法失去进展保证。
方法
提出 IC3 启发的 Racer 算法,将 catamorphism 同时编码为 CHC(relationification)与 RDF(新抽象),在 ADT 与 RDF 下求解 CHC 并自动合成归纳不变式,抽象保证底层理论可判定。
评估
在 Z3 中实现 Racer,并通过实验表明其在实际中工作良好。
原文摘要(Abstract)

This work addresses the problem of verifying imperative programs that manipulate data structures, e.g., Rust programs. Data structures are usually modeled by Algebraic Data Types (ADTs) in verification conditions. Inductive invariants of such programs often require recursively defined functions (RDFs) to represent abstractions of data structures. From the logic perspective, this reduces to solving Constrained Horn Clauses (CHCs) modulo both ADT and RDF. The underlying logic with RDFs is undecidable. Thus, even verifying a candidate inductive invariant is undecidable. Similarly, IC3-based algorithms for solving CHCs lose their progress guarantee: they may not find counterexamples when the program is unsafe. We propose a novel IC3-inspired algorithm Racer for solving CHCs modulo ADT and RDF (i.e., automatically synthesizing inductive invariants, as opposed to only verifying them as is done in deductive verification). Racer ensures progress despite the undecidability of the underlying theory, and is guaranteed to terminate with a counterexample for unsafe programs. It works with a general class of RDFs over ADTs called catamorphisms. The key idea is to represent catamorphisms as both CHCs, via relationification , and RDFs, using novel abstractions . Encoding catamorphisms as CHCs allows learning inductive properties of catamorphisms, as well as preserving unsatisfiabilty of the original CHCs despite the use of RDF abstractions, whereas encoding catamorphisms as RDFs allows unfolding the recursive definition, and relying on it in solutions. Abstractions ensure that the underlying theory remains decidable. We implement our approach in Z3 and show that it works well in practice.

链接与引用

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

BibTeX
@article{paperbot1557,
  title = {Solving constrained Horn clauses modulo algebraic data types and recursive functions},
  author = {Hari Govind V K and Sharon Shoham and Arie Gurfinkel},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {6},
  number = {POPL},
  year = {2022},
  doi = {10.1145/3498722}
}