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