skip to main content
10.1145/3385412.3385969acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Polynomial invariant generation for non-deterministic recursive programs

Published: 11 June 2020 Publication History

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 positivstellensaetze, i.e. theorems in semi-algebraic 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 (Colon 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.

References

[1]
Assalé Adjé, Pierre-Loïc Garoche, and Victor Magron. 2015. Propertybased polynomial invariant generation using sums-of-squares optimization. In SAS. 235–251.
[2]
Assalé Adjé, Stéphane Gaubert, and Eric Goubault. 2010. Coupling policy iteration with semi-definite relaxation to compute accurate numerical invariants in static analysis. In ESOP. 23–42.
[3]
Aws Albarghouthi, Yi Li, Arie Gurfinkel, and Marsha Chechik. 2012. Ufo: A framework for abstraction-and interpolation-based software verification. In CAV. Springer, 672–678.
[4]
Frances E Allen. 1970. Control flow analysis. In ACM Sigplan Notices, Vol. 5. ACM, 1–19.
[5]
Rajeev Alur, Thao Dang, and Franjo Ivančić. 2006. Predicate abstraction for reachability analysis of hybrid systems. ACM transactions on embedded computing systems (TECS) 5, 1 (2006), 152–199.
[6]
Erling D. Andersen and Knud D. Andersen. 2018. MOSEK Optimization Suite. (2018).
[7]
https://www.mosek.com/
[8]
Roberto Bagnara, Enric Rodríguez-Carbonell, and Enea Zaffanella. 2005. Generation of Basic Semi-algebraic Invariants Using Convex Polyhedra. In SAS. 19–34.
[9]
Saugata Basu, Richard Pollack, and Marie-Françoise Coste-Roy. 2007. Algorithms in real algebraic geometry. Springer.
[10]
Mohamed Amin Ben Sassi, Sriram Sankaranarayanan, Xin Chen, and Erika Ábrahám. 2015. Linear relaxations of polynomial positivity for polynomial lyapunov function synthesis. IMA Journal of Mathematical Control and Information 33, 3 (2015), 723–756.
[11]
Aaron R Bradley, Zohar Manna, and Henny B Sipma. 2005. Linear ranking with reachability. In CAV. Springer, 491–504.
[12]
Christopher W Brown. 2019. QEPCAD - Quantifier Elimination by Partial Cylindrical Algebraic Decomposition. (2019).
[13]
https://www. usna.edu/CS/qepcadweb/B/QEPCAD.html
[14]
Aleksandar Chakarov and Sriram Sankaranarayanan. 2013. Probabilistic program analysis with martingales. In CAV. Springer, 511–526.
[15]
Aleksandar Chakarov and Sriram Sankaranarayanan. 2014. Expectation Invariants for Probabilistic Program Loops as Fixed Points. In SAS. 85–100.
[16]
Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2016. Termination Analysis of Probabilistic Programs Through Positivstellensatz’s. In CAV. 3–22.
[17]
Krishnendu Chatterjee, Hongfei Fu, and Amir Kafshdar Goharshady. 2017. Non-polynomial Worst-Case Analysis of Recursive Programs. In CAV. 41–63.
[18]
Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady, and Ehsan Kafshdar Goharshady. 2020. Polynomial invariant generation for non-deterministic recursive programs. arXiv preprint arXiv:1902.04373 (2020).
[19]
Krishnendu Chatterjee, Petr Novotný, and Dorde Zikelic. 2017. Stochastic invariants for probabilistic termination. In POPL. 145–160.
[20]
Yinghua Chen, Bican Xia, Lu Yang, Naijun Zhan, and Chaochen Zhou. 2007. Discovering non-linear ranking functions by solving semialgebraic systems. In ICTAC. Springer, 34–49.
[21]
Yu-Fang Chen, Chih-Duo Hong, Bow-Yaw Wang, and Lijun Zhang. 2015. Counterexample-Guided Polynomial Loop Invariant Generation by Lagrange Interpolation. In CAV. 658–674.
[22]
Michael Colón, Sriram Sankaranarayanan, and Henny Sipma. 2003. Linear Invariant Generation Using Non-linear Constraint Solving. In CAV. 420–432.
[23]
Michael A Colón and Henny B Sipma. 2001. Synthesis of linear ranking functions. In TACAS. Springer, 67–81.
[24]
Thomas H Cormen, Charles E Leiserson, Ronald L Rivest, and Clifford Stein. 2009. Introduction to algorithms. MIT press.
[25]
Patrick Cousot. 2005. Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming. In VMCAI. 1–24.
[26]
Patrick Cousot and Radhia Cousot. 1977. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In POPL. ACM, 238–252.
[27]
Patrick Cousot, Radhia Cousot, Jérôme Feret, Laurent Mauborgne, Antoine Miné, David Monniaux, and Xavier Rival. 2005. The ASTREÉ Analyzer. In ESOP. 21–30.
[28]
Patrick Cousot and Nicolas Halbwachs. 1978. Automatic discovery of linear restraints among variables of a program. In POPL. ACM, 84–96.
[29]
Christoph Csallner, Nikolai Tillmann, and Yannis Smaragdakis. 2008. DySy: dynamic symbolic execution for invariant inference. In ICSE. 281–290.
[30]
Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An efficient SMT solver. In TACAS. 337–340.
[31]
Steven de Oliveira, Saddek Bensalem, and Virgile Prevosto. 2016. Polynomial Invariants by Linear Algebra. In ATVA. 479–494.
[32]
Isil Dillig, Thomas Dillig, Boyang Li, and Ken McMillan. 2013. Inductive invariant generation via abductive inference. In OOPSLA.
[33]
Isil Dillig, Thomas Dillig, Boyang Li, and Kenneth L. McMillan. 2013. Inductive invariant generation via abductive inference. In OOPSLA. 443–456.
[34]
Azadeh Farzan and Zachary Kincaid. 2015. Compositional Recurrence Analysis. In FMCAD. 57–64.
[35]
Yijun Feng, Lijun Zhang, David N. Jansen, Naijun Zhan, and Bican Xia. 2017. Finding Polynomial Loop Invariants for Probabilistic Programs. In ATVA. 400–416.
[36]
Robert W Floyd. 1993. Assigning meanings to programs. In Program Verification. Springer, 65–81.
[37]
Fedor V Fomin, Daniel Lokshtanov, Saket Saurabh, Michał Pilipczuk, and Marcin Wrochna. 2018. Fully polynomial-time parameterized computations for graphs and matrices of low treewidth. ACM Transactions on Algorithms (TALG) 14, 3 (2018), 1–45.
[38]
Pranav Garg, Daniel Neider, P. Madhusudan, and Dan Roth. 2016. Learning invariants using decision trees and implication counterexamples. In POPL. 499–512.
[39]
Roberto Giacobazzi and Francesco Ranzato. 1997. Completeness in abstract interpretation: A domain perspective. In AMAST. 231–245.
[40]
Dima Grigor’ev and Nicolai Vorobjov. 1988. Solving systems of polynomial inequalities in subexponential time. Journal of Symbolic Computation 5, 1/2 (1988), 37–64.
[41]
Sumit Gulwani, Saurabh Srivastava, and Ramarathnam Venkatesan. 2009. Constraint-Based Invariant Inference over Predicate Abstraction. In VMCAI. 120–135.
[42]
Arie Gurfinkel, Temesghen Kahsai, Anvesh Komuravelli, and Jorge A. Navas. 2015. The SeaHorn Verification Framework. In CAV. 343–361.
[43]
Nicolas Halbwachs, Yann-Erick Proy, and Patrick Roumanoff. 1997. Verification of real-time systems using linear relation analysis. Formal Methods in System Design 11, 2 (1997), 157–185.
[44]
Matthias Heizmann, Jürgen Christ, Daniel Dietsch, Evren Ermis, Jochen Hoenicke, Markus Lindenmann, Alexander Nutz, Christian Schilling, and Andreas Podelski. 2013. Ultimate Automizer with SMTInterpol. In TACAS. 641–643.
[45]
Thomas Henzinger and Pei-Hsin Ho. 1994. Model checking strategies for linear hybrid systems. (1994).
[46]
Hoon Hong. 1991. Comparison of several decision algorithms for the existential theory of the reals. (1991).
[47]
Ehud Hrushovski, Joël Ouaknine, Amaury Pouly, and James Worrell. 2018. Polynomial Invariants for Affine Programs. In LICS. 530–539.
[48]
Mingzhang Huang, Hongfei Fu, Krishnendu Chatterjee, and Amir Kafshdar Goharshady. 2019. Modular verification for almost-sure termination of probabilistic programs. In OOPSLA. 1–29.
[49]
Andreas Humenberger, Maximilian Jaroschek, and Laura Kovács. 2017. Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences. In ISSAC. 221–228. PLDI ’20, June 15–20, 2020, London, UK K. Chatterjee, H. Fu, A.K. Goharshady, and E.K. Goharshady
[50]
Deepak Kapur. 2004. Automatically generating loop invariants using quantifier elimination, preliminary report. In ACA.
[51]
Joost-Pieter Katoen, Annabelle McIver, Larissa Meinicke, and Carroll C. Morgan. 2010. Linear-Invariant Generation for Probabilistic Programs: - Automated Support for Proof-Based Methods. In SAS. 390–406.
[52]
Zachary Kincaid, Jason Breck, Ashkan Forouhi Boroujeni, and Thomas W. Reps. 2017. Compositional recurrence analysis revisited. In PLDI. 248–262.
[53]
Zachary Kincaid, John Cyphert, Jason Breck, and Thomas W. Reps. 2018. Non-linear reasoning for invariant synthesis. In POPL. 54:1– 54:33.
[54]
Wang Lin, Min Wu, Zhengfeng Yang, and Zhenbing Zeng. 2014. Proving total correctness and generating preconditions for loop programs via symbolic-numeric computation methods. Frontiers of Computer Science 8, 2 (2014), 192–202.
[55]
Zohar Manna and Amir Pnueli. 1995. Temporal verification of reactive systems: Safety. Springer.
[56]
Kenneth L. McMillan. 2008. Quantified Invariant Generation Using an Interpolating Saturation Prover. In TACAS. 413–427.
[57]
Markus Müller-Olm and Helmut Seidl. 2004. Computing polynomial program invariants. Inform. Process. Lett. 91, 5 (2004).
[58]
Van Chan Ngo, Quentin Carbonneaux, and Jan Hoffmann. 2018. Bounded expectations: resource analysis for probabilistic programs. In PLDI. ACM, 496–512.
[59]
ThanhVu Nguyen, Deepak Kapur, Westley Weimer, and Stephanie Forrest. 2012. Using dynamic analysis to discover polynomial and array invariants. In ICSE. 683–693.
[60]
Antoine Oustry, Matteo Tacchi, and Didier Henrion. 2019. Inner approximations of the maximal positively invariant set for polynomial dynamical systems. IEEE Control Systems Letters 3, 3 (2019), 733–738.
[61]
Oded Padon, Kenneth L McMillan, Aurojit Panda, Mooly Sagiv, and Sharon Shoham. 2016. Ivy: safety verification by interactive generalization. PLDI (2016), 614–630.
[62]
Mihai Putinar. 1993. Positive polynomials on compact semi-algebraic sets. Indiana University Mathematics Journal 42, 3 (1993), 969–984.
[63]
Wolfram Research. 2019. Mathematica, Version 12.0. (2019). https: //www.wolfram.com/mathematica
[64]
Enric Rodríguez-Carbonell. 2018. Some programs that need polynomial invariants in order to be verified. (2018). http://www.cs.upc.edu/ ~erodri/webpage/polynomial_invariants/list.html
[65]
Enric Rodríguez-Carbonell and Deepak Kapur. 2004. Automatic generation of polynomial loop invariants: Algebraic foundations. In ISSAC. ACM, 266–273.
[66]
Enric Rodríguez-Carbonell and Deepak Kapur. 2007. Automatic generation of polynomial invariants of bounded degree using abstract interpretation. Science of Computer Programming 64, 1 (2007), 54–75.
[67]
Sriram Sankaranarayanan. 2011. Automatic abstraction of non-linear systems using change of bases transformations. In HSCC. 143–152.
[68]
Sriram Sankaranarayanan, Henny Sipma, and Zohar Manna. 2004. Non-linear loop invariant generation using Gröbner bases. In POPL. 318–329.
[69]
Sriram Sankaranarayanan, Henny B Sipma, and Zohar Manna. 2004. Constraint-based linear-relations analysis. In SAS. Springer, 53–68.
[70]
Rahul Sharma and Alex Aiken. 2016. From invariant checking to invariant inference using randomized search. Formal Methods in System Design 48, 3 (2016), 235–256.
[71]
Gagandeep Singh, Markus Püschel, and Martin Vechev. 2015. Making numerical program analysis fast. In PLDI. ACM, 303–313.
[72]
Gagandeep Singh, Markus Püschel, and Martin Vechev. 2017. Fast polyhedra abstract domain. In POPL. 46–59.
[73]
Gilbert Stengle. 1974. A Nullstellensatz and a Positivstellensatz in semialgebraic geometry. Math. Ann. 207, 2 (1974), 87–97.
[74]
Bernd Sturmfels. 2002. Solving systems of polynomial equations. American Mathematical Society.
[75]
Mikkel Thorup. 1998. All structured programs have small tree width and good register allocation. Information and Computation 142, 2 (1998), 159–181.
[76]
Robert J. Vanderbei. 2006. LOQO User’s Manual - Version 4.05. Technical Report. Princeton University.
[77]
Peixin Wang, Hongfei Fu, Amir Kafshdar Goharshady, Krishnendu Chatterjee, Xudong Qin, and Wenjun Shi. 2019. Cost analysis of nondeterministic probabilistic programs. In PLDI. 204–220.
[78]
Lu Yang, Chaochen Zhou, Naijun Zhan, and Bican Xia. 2010. Recent advances in program verification through computer algebra. Frontiers of Computer Science in China 4, 1 (2010), 1–16.
[79]
Ian En-Hsu Yen, Kai Zhong, Cho-Jui Hsieh, Pradeep K Ravikumar, and Inderjit S Dhillon. 2015. Sparse linear programming via primal and dual augmented coordinate descent. In NIPS. 2368–2376.

Cited By

View all

Index Terms

  1. Polynomial invariant generation for non-deterministic recursive programs

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image ACM Conferences
      PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation
      June 2020
      1174 pages
      ISBN:9781450376136
      DOI:10.1145/3385412
      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Sponsors

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      Published: 11 June 2020

      Permissions

      Request permissions for this article.

      Check for updates

      Author Tags

      1. Invariant generation
      2. Polynomial programs
      3. Positivstellensaetze

      Qualifiers

      • Research-article

      Funding Sources

      Conference

      PLDI '20
      Sponsor:

      Acceptance Rates

      Overall Acceptance Rate 406 of 2,067 submissions, 20%

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)69
      • Downloads (Last 6 weeks)12
      Reflects downloads up to 25 Dec 2024

      Other Metrics

      Citations

      Cited By

      View all

      View Options

      Login options

      View options

      PDF

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media