← 研踪 PaperTrailarXiv:2607.12226 · v2
Flex: A Foundational Proof-Producing Horn Solver
首次提交 2026-07-14 08:15
版本更新 2026-11-16 22:14
雷达观测 2026-11-17 17:11
摘要
Constrained Horn Clauses (CHCs) are a versatile intermediate representation for program verification, but leading CHC solvers rely on SMT-based reasoning over supported background theories. Specifications involving user-defined recursive functions or bespoke operators can require additional semantic encodings and reasoning beyond these theories. We observe that CHCs are existentially quantified propositions in a foundational logic, and so can be proved within an interactive theorem prover, where specifications can use native definitions, and users can complete proofs when automation stalls. However, in a foundational setting, every Horn variable solution must be justified by a kernel-checked proof. We present Flex, a proof-producing CHC solver implemented as a Lean metaprogram, that combines predicate synthesis with proof construction. Flex comprises a suite of tactics: Zap, which synthesizes strongest predicates for acyclic Horn variables and exploits their structure to construct elimination proofs without any proof search; Fix, which uses predicate abstraction over templates built from arbitrary Lean terms, discovered by scraping the CHCs and associated definitions, to infer inductive invariants for cyclic Horn variables; and a certifying pipeline that keeps external SMT-based solvers like Spacer and Eldarica outside the trusted computing base. We use Flex to verify the functional correctness of sorting algorithms, hash tables, ring buffers from the Tock OS kernel, and Rust std library challenges. We show that Zap constructs elimination proofs 28.2x and 44.6x faster than grind and aesop, respectively. With Zap and Fix, Flex automatically proves 98.0% of the refinement-typechecker CHCs in our evaluation.
作者备注:21 pages
观测到的版本
相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。
v2 · 2026-11-16 22:14 · 最新观测版本
Flex: A Foundational Proof-Producing Horn Solver
Constrained Horn Clauses (CHCs) are a versatile intermediate representation for program verification, but leading CHC solvers rely on SMT-based reasoning over supported background theories. Specifications involving user-defined recursive functions or bespoke operators can require additional semantic encodings and reasoning beyond these theories. We observe that CHCs are existentially quantified propositions in a foundational logic, and so can be proved within an interactive theorem prover, where specifications can use native definitions, and users can complete proofs when automation stalls. However, in a foundational setting, every Horn variable solution must be justified by a kernel-checked proof. We present Flex, a proof-producing CHC solver implemented as a Lean metaprogram, that combines predicate synthesis with proof construction. Flex comprises a suite of tactics: Zap, which synthesizes strongest predicates for acyclic Horn variables and exploits their structure to construct elimination proofs without any proof search; Fix, which uses predicate abstraction over templates built from arbitrary Lean terms, discovered by scraping the CHCs and associated definitions, to infer inductive invariants for cyclic Horn variables; and a certifying pipeline that keeps external SMT-based solvers like Spacer and Eldarica outside the trusted computing base. We use Flex to verify the functional correctness of sorting algorithms, hash tables, ring buffers from the Tock OS kernel, and Rust std library challenges. We show that Zap constructs elimination proofs 28.2x and 44.6x faster than grind and aesop, respectively. With Zap and Fix, Flex automatically proves 98.0% of the refinement-typechecker CHCs in our evaluation.
查看此版本解读 →查看此版本原文 ↗