Abstract
Automatic generation of non-linear loop invariants is a long-standing challenge in program analysis, with many applications. For instance, reasoning about exponentials provides a way to find invariants of digital-filter programs, and reasoning about polynomials and/or logarithms is needed for establishing invariants that describe the time or memory usage of many well-known algorithms. An appealing approach to this challenge is to exploit the powerful recurrence-solving techniques that have been developed in the field of computer algebra, which can compute exact characterizations of non-linear repetitive behavior. However, there is a gap between the capabilities of recurrence solvers and the needs of program analysis: (1) loop bodies are not merely systems of recurrence relations---they may contain conditional branches, nested loops, non-deterministic assignments, etc., and (2) a client program analyzer must be able to reason about the closed-form solutions produced by a recurrence solver (e.g., to prove assertions).
This paper presents a method for generating non-linear invariants of general loops based on analyzing recurrence relations. The key components are an abstract domain for reasoning about non-linear arithmetic, a semantics-based method for extracting recurrence relations from loop bodies, and a recurrence solver that avoids closed forms that involve complex or irrational numbers. Our technique has been implemented in a program analyzer that can analyze general loops and mutually recursive procedures. Our experiments show that our technique shows promise for non-linear assertion-checking and resource-bound generation.
Supplemental Material
Available for Download
The artifact for this publication is a zip file containing a virtual machine in OVA (Open Virtualization Archive) format. The virtual machine contains an installation of ICRA, which is the program analysis tool that implements the ideas described in the associated publication, "Non-Linear Reasoning for Invariant Synthesis." For more information about the virtual machine, and for detailed information about how to use the virtual machine to run ICRA, see the "/home/icrauser/Code/README.txt" file inside the virtual machine.
- E. Albert, P. Arenas, S. Genaim, and G. Puebla. 2008. Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis. In SAS. 221–237. Google Scholar
Digital Library
- E. Albert, S. Genaim, and A.N. Masud. 2013. On the inference of resource usage upper, lower bounds. Trans. on Computational Logic 14, 3 (2013). Google Scholar
Digital Library
- Z. Ammarguellat and W. L. Harrison, III. 1990. Automatic recognition of induction variables and recurrence relations by abstract interpretation. In PLDI. 283–295. Google Scholar
Digital Library
- C. Ancourt, F. Coelho, and F. Irigoin. 2010. A Modular Static Analysis Approach to Affine Loop Invariants Detection. Electron. Notes Theor. Comput. Sci. 267, 1 (Oct. 2010), 3–16. Google Scholar
Digital Library
- T. Antonopoulos, P. Gazzillo, M. Hicks, E. Koskinen, T. Terauchi, and S. Wei. 2017. Decomposition Instead of Self-composition for Proving the Absence of Timing Channels. In PLDI. Google Scholar
Digital Library
- R. Bagnara, A. Pescetti, A. Zaccagnini, and E. Zaffanella. 2005a. P URRS: Towards Computer Algebra Support for Fully Automatic Worst-Case Complexity Analysis. CoRR abs/cs/0512056 (2005).Google Scholar
- R. Bagnara, E. Rodríguez-Carbonell, and E. Zaffanella. 2005b. Generation of Basic Semi-Algebraic Invariants Using Convex Polyhedra. In SAS. Google Scholar
Digital Library
- G. Barthe, J. Crespo, and C. Kunz. 2011. Relational Verification Using Product Programs. In Proceedings of the 17th International Conference on Formal Methods (FM). Google Scholar
Cross Ref
- G. Barthe, P.R. D’Argenio, and T. Rezk. 2004. Secure Information Flow by Self-Composition. In Comp. Sec. Found. Workshop. Google Scholar
Cross Ref
- L. Berg. 1967. Introduction to the Operational Calculus. North-Holland Publishing Co., Amsterdam.Google Scholar
- D. Beyer and M.E. Keremoglu. 2011. CPAchecker: A Tool for Configurable Software Verification. In CAV. Google Scholar
Cross Ref
- R. Blanc, T. A. Henzinger, T. Hottelier, and L. Kovács. 2010. ABC: Algebraic Bound Computation for Loops. In Int. Conf. on Logic for Programming, Art. Intell., and Reasoning. 103–118.Google Scholar
- B. Boigelot and P. Wolper. 1994. Symbolic verification with periodic sets. In CAV. 55–67. Google Scholar
Cross Ref
- M. Bozga, R. Iosif, and F. Konečný. 2010. Fast Acceleration of Ultimately Periodic Relations. In CAV. 227–242. Google Scholar
Digital Library
- M. Brockschmidt, F. Emmes, S. Falke, C. Fuhs, and J. Giesl. 2014. Alternating runtime and size complexity analysis of integer programs. In TACAS. Google Scholar
Cross Ref
- B. Buchberger. 1976. A Theoretical Basis for the Reduction of Polynomials to Canonical Forms. SIGSAM Bull. 10, 3 (Aug. 1976), 19–29. Google Scholar
Digital Library
- B.-Y.E. Chang and K.R.M Leino. 2005. Abstract Interpretation with Alien Expressions and Heap Structures. In VMCAI. Google Scholar
Digital Library
- J. S. Cohen. 2003. Computer Algebra and Symbolic Computation: Mathematical Methods. A K Peters/CRC Press.Google Scholar
- M. A. Colón. 2004. Approximating the Algebraic Relational Semantics of Imperative Programs. In SAS. 296–311. Google Scholar
Cross Ref
- P. Cousot and R. Cousot. 1979. Systematic Design of Program Analysis Frameworks. In POPL. 269–282. Google Scholar
Digital Library
- P. Cousot and N. Halbwachs. 1978. Automatic Discovery of Linear Constraints Among Variables of a Program. In POPL.Google Scholar
- D. A. Cox, J. Little, and D. O’Shea. 2015. Ideals, Varieties, and Algorithms: An Introduction to Computational Algebraic Geometry and Commutative Algebra (4th ed.). Springer Publishing Company, Incorporated. Google Scholar
Cross Ref
- L. de Moura and N. Bjørner. 2008. Z3: An Efficient SMT Solver. In TACAS.Google Scholar
- S. de Oliveira, S. Bensalem, and V. Prevosto. 2016. Polynomial Invariants by Linear Algebra. In ATVA. Google Scholar
Cross Ref
- I. Dillig, T. Dillig, B. Li, and K. McMillan. 2013. Inductive Invariant Generation via Abductive Inference. In OOPSLA. Google Scholar
Digital Library
- J. Esparza, S. Kiefer, and M. Luttenberger. 2010. Newtonian Program Analysis. J. ACM 57, 6 (2010). Google Scholar
Digital Library
- A. Farzan and Z. Kincaid. 2015. Compositional Recurrence Analysis. In FMCAD. Google Scholar
Cross Ref
- A. Finkel and J. Leroux. 2002. How to Compose Presburger-Accelerations: Applications to Broadcast Protocols. In FST TCS. 145–156.Google Scholar
- P. Flajolet and R. Sedgewick. 2009. Analytic Combinatorics. Cambridge University Press. pdfs.semanticscholar.org/d347/dbb4b2eea7fca0183b55112b9cc07faa51ff.pdf. Google Scholar
Cross Ref
- A. Flores-Montoya and R. Hähnle. 2014. Resource analysis of complex programs with cost equations. In APLAS. Google Scholar
Cross Ref
- G. Gange, J. A. Navas, P. Schachte, H. Søndergaard, and P. J. Stuckey. 2016. An Abstract Domain of Uninterpreted Functions. In VMCAI. Google Scholar
Digital Library
- P. Granger. 1992. Improving the Results of Static Analyses Programs by Local Decreasing Iteration. In FSTTCS. Google Scholar
Cross Ref
- B.S. Gulavani and S. Gulwani. 2008. A Numerical Abstract Domain Based on Expression Abstraction and Max Operator with Application in Timing Analysis. In CAV. Google Scholar
Digital Library
- S. Gulwani, A. Tiwari, and G.C. Necula. 2004. Join Algorithms for the Theory of Uninterpreted Functions. In FSTTCS. Google Scholar
Digital Library
- A. Gurfinkel, T. Kahsai, A. Komuravelli, and J.A. Navas. 2015. The SeaHorn Verification Framework. In CAV. Google Scholar
Cross Ref
- M. Heizmann, J. Christ, D. Dietsch, E. Ermis, J. Hoenicke, M. Lindenmann, A. Nutz, C. Schilling, and A. Podelski. 2013. Ultimate Automizer with SMTInterpol (Competition Contribution). In TACAS.Google Scholar
- A. Humenberger, M. Jaroschek, and L. Kovacs. 2017. Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences. In ISSAC. Google Scholar
Digital Library
- J.-G.-M. 1983. Hypernumbers. I. Algebra. Studia Math. 77 (1983), 3–16. matwbn.icm.edu.pl/ksiazki/sm/sm77/sm7712.pdf Originally published in Polish in 1944.Google Scholar
- B. Jeannet and A. Miné. 2009. Apron: A Library of Numerical Abstract Domains for Static Analysis. In CAV. Google Scholar
Digital Library
- B. Jeannet, P. Schrammel, and S. Sankaranarayanan. 2014. Abstract Acceleration of General Linear Loops. In POPL. 529–540. Google Scholar
Digital Library
- M. Kauers and P. Paule. 2011. The Concrete Tetrahedron. SpringerWienNewYork.Google Scholar
- Z. Kincaid, J. Breck, A. Forouhi Boroujeni, and T. Reps. 2017. Compositional Recurrence Analysis Revisited. In PLDI. Google Scholar
Digital Library
- L. Kovács. 2008. Reasoning Algebraically About P-Solvable Loops. In TACAS.Google Scholar
- A. Miné. 2001. The Octagon Abstract Domain. In Working Conf. on Rev. Eng. 310–322. Google Scholar
Cross Ref
- M. Müller-Olm and H. Seidl. 2004. Precise Interprocedural Analysis through Linear Algebra. In POPL. Google Scholar
Digital Library
- T. Reps, M. Sagiv, and G. Yorsh. 2004. Symbolic Implementation of the Best Transformer. In VMCAI. 252–266. Google Scholar
Cross Ref
- T. Reps and A. Thakur. 2016. Automating Abstract Interpretation. In VMCAI. Google Scholar
Digital Library
- T. Reps, E. Turetsky, and P. Prabhu. 2016. Newtonian Program Analysis via Tensor Product. In POPL. Google Scholar
Digital Library
- E. Rodríguez-Carbonell and D. Kapur. 2004. Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations. In ISSAC. 266–273.Google Scholar
- S. Sankaranarayanan, H.B. Sipma, and Z. Manna. 2004. Non-Linear Loop Invariant Generation using Gröbner Bases. In POPL. Google Scholar
Digital Library
- A. Srikanth, B. Sahin, and W.R. Harris. 2017. Complexity Verification Using Guided Theorem Enumeration. In POPL. Google Scholar
Digital Library
- T. Terauchi and A. Aiken. 2005. Secure Information Flow As a Safety Problem. In Static Analysis Symp. Google Scholar
Digital Library
- A. Thakur. 2014. Symbolic Abstraction: Algorithms and Applications. Ph.D. Dissertation. Comp. Sci. Dept., Univ. of Wisconsin, Madison, WI. Tech. Rep. 1812.Google Scholar
- A. Thakur and T. Reps. 2012. A Method for Symbolic Computation of Abstract Operations. In CAV. Google Scholar
Digital Library
- H. Wilf. 1994. Generatingfunctionology, 2nd. Ed. Academic Press. www.math.upenn.edu/ wilf/gfologyLinked2.pdf.Google Scholar
Index Terms
Non-linear reasoning for invariant synthesis
Recommendations
Templates and recurrences: better together
PLDI 2020: Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and ImplementationThis paper is the confluence of two streams of ideas in the literature on generating numerical invariants, namely: (1) template-based methods, and (2) recurrence-based methods.
A template-based method begins with a template that contains unknown ...
Closed forms for numerical loops
This paper investigates the problem of reasoning about non-linear behavior of simple numerical loops. Our approach builds on classical techniques for analyzing the behavior of linear dynamical systems. It is well-known that a closed-form representation ...
Simplifying loop invariant generation using splitter predicates
CAV'11: Proceedings of the 23rd international conference on Computer aided verificationWe present a novel static analysis technique that substantially improves the quality of invariants inferred by standard loop invariant generation techniques. Our technique decomposes multi-phase loops, which require disjunctive invariants, into a ...






Comments