paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Simple Linear Loops: Algebraic Invariants and Applications

简单线性循环:代数不变量与应用
POPL 9(POPL)2025匹配度 2/10 · 论文属于程序验证/循环不变式生成的理论工作,涉及静态分析与形式化验证的经典问题,但完全不涉及 LLM、Agent、机器学习或浮点/贝叶斯程序分析,也不关注工业落地或 benchmark,与画像的核心交叉方向无关。引用 6 inbox
Rida Ait El Manssour, George Kenison, Mahsa Shirmohammadi, Anton Varonka
crossref: 2026-09-10

AI 速览

一句话:提出多项式空间算法,为简单线性循环计算最强代数不变量,并给出验证与合成的复杂度结果。

本文研究简单线性循环(无分支、单线性更新)的代数不变量生成。该问题一般不可判定,但此类受限程序可判定。作者提出多项式空间算法,计算最强代数不变量,即所有可达状态满足的多项式方程;算法缓解变量消去与 Gröbner 基计算的爆炸,固定变量数时为多项式时间。应用方面,不变量验证在稠密/稀疏表示下分别为 coNP 完全和 PSPACE;循环合成可构造满足给定代数性质且可达状态无限的循环,强合成要求该性质为最强不变量。整数/有理数上合成与 Hilbert 第十问题同难;限制常数位长后,合成及其强变体在 PSPACE 可判定,固定变量数为 NP。

问题
研究简单线性循环的代数不变量自动生成,以及不变量验证和循环合成的可判定性与复杂度。
方法
提出多项式空间算法计算最强代数不变量,生成所有可达状态满足的多项式方程,并改进变量消去与 Gröbner 基计算中的复杂度爆炸。
评估
以理论复杂度分析评估:固定变量数时算法为多项式时间;验证问题为 coNP 完全或 PSPACE;合成在整数/有理数上难如 Hilbert 第十问题,位长受限时为 PSPACE 可判定、固定变量数时为 NP。
原文摘要(Abstract)

The automatic generation of loop invariants is a fundamental challenge in software verification. While this task is undecidable in general, it is decidable for certain restricted classes of programs. This work focuses on invariant generation for (branching-free) loops with a single linear update. Our primary contribution is a polynomial-space algorithm that computes the strongest algebraic invariant for simple linear loops, generating all polynomial equations that hold among program variables across all reachable states. The key to achieving our complexity bounds lies in mitigating the blow-up associated with variable elimination and Gröbner basis computation, as seen in prior works. Our procedure runs in polynomial time when the number of program variables is fixed. We examine various applications of our results on invariant generation, focusing on invariant verification and loop synthesis. The invariant verification problem investigates whether a polynomial ideal defining an algebraic set serves as an invariant for a given linear loop. We show that this problem is coNP-complete and lies in PSPACE when the input ideal is given in dense or sparse representations, respectively. In the context of loop synthesis, we aim to construct a loop with an infinite set of reachable states that upholds a specified algebraic property as an invariant. The strong synthesis variant of this problem requires the construction of loops for which the given property is the strongest invariant. In terms of hardness, synthesising loops over integers (or rationals) is as hard as Hilbert’s Tenth problem (or its analogue over the rationals). When the constants of the output are constrained to bit-bounded rational numbers, we demonstrate that loop synthesis and its strong variant are both decidable in PSPACE, and in NP when the number of program variables is fixed.

链接与引用

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

BibTeX
@article{ManssourKSV25,
  title = {Simple Linear Loops: Algebraic Invariants and Applications},
  author = {Rida Ait El Manssour and George Kenison and Mahsa Shirmohammadi and Anton Varonka},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {POPL},
  year = {2025},
  doi = {10.1145/3704862}
}