Polynomial invariant generation for non-deterministic recursive programs
Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady, Ehsan Kafshdar Goharshady
Abstract
We consider the classical problem of invariant generation for programs with polynomial assignments and focus on synthesizing invariants that are a conjunction of strict polynomial inequalities. We present a sound and semi-complete method based on positivstellensätze, i.e. theorems in semialgebraic geometry that characterize positive polynomials over a semi-algebraic set.
On the theoretical side, the worst-case complexity of our approach is subexponential, whereas the worst-case complexity of the previous complete method (Kapur, ACA 2004) is doubly-exponential. Even when restricted to linear invariants, the best previous complexity for complete invariant generation is exponential (Colón et al, CAV 2003). On the practical side, we reduce the invariant generation problem to quadratic programming (QCLP), which is a classical optimization problem with many industrial solvers. We demonstrate the applicability of our approach by providing experimental results on several academic benchmarks. To the best of our knowledge, the only previous invariant generation method that provides completeness guarantees for invariants consisting of polynomial inequalities is (Kapur, ACA 2004), which relies on quantifier elimination and cannot even handle toy programs such as our running example.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 819d19ac-6b90-4b94-b671-fa710ec83c89Cited by top-tier papers24
- Sound and Complete Certificates for Quantitative Termination Analysis of Probabilistic ProgramsKrishnendu Chatterjee, Amir Kafshdar Goharshady, Tobias Meggendorfer, Dorde ZikelicCAV 2022 · 30 citations
- This is the moment for probabilistic loopsMarcel Moosbrugger, Miroslav Stankovic, Ezio Bartocci, Laura KovácsOOPSLA 2022 · 30 citations
- Polynomial reachability witnesses via StellensätzeAli Asadi, Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady et al.PLDI 2021 · 28 citations
- Proving non-termination by program reversalKrishnendu Chatterjee, Ehsan Kafshdar Goharshady, Petr Novotný, Dorde ZikelicPLDI 2021 · 18 citations
- Quantitative analysis of assertion violations in probabilistic programsJinyi Wang, Yican Sun, Hongfei Fu, Krishnendu Chatterjee et al.PLDI 2021 · 18 citations
Related papers
- Scalable linear invariant generation with Farkas' lemmaHongming Liu, Hongfei Fu, Zhiyong Yu, Jiaxin Song et al.OOPSLA 2022 · 15 citations
- Simple Linear Loops: Algebraic Invariants and ApplicationsRida Ait El Manssour, George Kenison, Mahsa Shirmohammadi, Anton VaronkaPOPL 2025 · 2 citations
- Nonlinear Craig Interpolant GenerationTing Gan, Bican Xia, Bai Xue, Naijun Zhan et al.CAV 2020 · 14 citations
- Polynomial Invariant Generation for Floating-Point ProgramsXuran Cai, Liqian Chen, Hongfei FuCAV 2026
- Solvable Polynomial Ideals: The Ideal Reflection for Program AnalysisJohn Cyphert, Zachary KincaidPOPL 2024 · 11 citations
