paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Almost correct invariants: synthesizing inductive invariants by fuzzing proofs

几乎正确的不变式:通过对证明进行模糊测试来合成归纳不变式
ISSTA Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis2022匹配度 5/10 · 论文针对含不可解释操作(如外部库调用、ML模型查询)的开放程序合成归纳不变式,与‘PL→AI’中验证含ML组件程序的方向有部分交集,且采用主动学习+模糊测试,兼具工程实现与问题驱动。但未涉及LLM/Agent,也不属于浮点或贝叶斯程序分析,因此匹配度中等。引用 20 inbox
Sumit Lahiri, Subhajit Roy
crossref: 2026-09-12

AI 速览

一句话:提出 Achar,用主动学习提出候选不变式,并以模糊测试反证之,从而为含不可解释操作的开放程序合成归纳不变式。

现实程序常包含验证引擎无法理解语义的操作,如第三方库调用、内联汇编、SIMD 指令、编译器原语乃至不可解释的机器学习模型查询。针对这类“开放”程序,归纳不变式的合成长期依赖人工编写桩函数,既困难又容易出错。本文提出“几乎正确的不变式”这一自动化策略:采用主动学习,由数据驱动的学习器提出候选不变式,但与传统“验证不变式”的思路不同,作者转而尝试证伪候选不变式,将证伪问题归约为非确定性程序上的一组可达性检查,并借助现代模糊测试器高效求解这些查询。工具 Achar 能自动合成足以证明目标程序正确性的归纳不变式。实验表明,即使几乎不接触程序源码,Achar 也优于能完整访问源码的最先进不变式生成工具;对于调用外部库、内联汇编以及查询卷积神经网络等现有引擎无法处理的程序,Achar 也能在合理时间内成功推断所需不变式。

问题
如何为包含语义不可知操作(第三方库、内联汇编、SIMD、ML 模型查询等)的“开放”程序自动合成归纳不变式,避免依赖易错的人工桩函数。
方法
采用主动学习:数据驱动学习器提出候选不变式,再通过将证伪问题归约为非确定性程序的可达性查询,并借助现代模糊测试器搜索反例来筛除错误候选。
评估
在几乎不提供程序源码访问的条件下与可完整访问源码的最先进不变式合成工具对比,并在调用外部库、内联汇编与卷积神经网络等现有工具无法处理的程序上验证 Achar 的有效性与时间开销。
原文摘要(Abstract)

Real-life programs contain multiple operations whose semantics are unavailable to verification engines, like third-party library calls, inline assembly and SIMD instructions, special compiler-provided primitives, and queries to uninterpretable machine learning models. Even with the exceptional success story of program verification, synthesis of inductive invariants for such "open" programs has remained a challenge. Currently, this problem is handled by manually "closing" the program---by providing hand-written stubs that attempt to capture the behavior of the unmodelled operations; writing stubs is not only difficult and tedious, but the stubs are often incorrect---raising serious questions on the whole endeavor. In this work, we propose Almost Correct Invariants as an automated strategy for synthesizing inductive invariants for such "open" programs. We adopt an active learning strategy where a data-driven learner proposes candidate invariants. In deviation from prior work that attempt to verify invariants, we attempt to falsify the invariants: we reduce the falsification problem to a set of reachability checks on non-deterministic programs; we ride on the success of modern fuzzers to answer these reachability queries. Our tool, Achar, automatically synthesizes inductive invariants that are sufficient to prove the correctness of the target programs. We compare Achar with a state-of-the-art invariant synthesis tool that employs theorem proving on formulae built over the program source. Though Achar is without strong soundness guarantees, our experiments show that even when we provide almost no access to the program source, Achar outperforms the state-of-the-art invariant generator that has complete access to the source. We also evaluate Achar on programs that current invariant synthesis engines cannot handle---programs that invoke external library calls, inline assembly, and queries to convolution neural networks; Achar successfully infers the necessary inductive invariants within a reasonable time.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot7434,
  title = {Almost correct invariants: synthesizing inductive invariants by fuzzing proofs},
  author = {Sumit Lahiri and Subhajit Roy},
  booktitle = {ISSTA},
  year = {2022},
  doi = {10.1145/3533767.3534381}
}