skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Non-linear reasoning for invariant synthesis

Published:27 December 2017Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

invariantsynthesis.webm

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Z. Ammarguellat and W. L. Harrison, III. 1990. Automatic recognition of induction variables and recurrence relations by abstract interpretation. In PLDI. 283–295. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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 ScholarGoogle Scholar
  7. R. Bagnara, E. Rodríguez-Carbonell, and E. Zaffanella. 2005b. Generation of Basic Semi-Algebraic Invariants Using Convex Polyhedra. In SAS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarCross RefCross Ref
  9. G. Barthe, P.R. D’Argenio, and T. Rezk. 2004. Secure Information Flow by Self-Composition. In Comp. Sec. Found. Workshop. Google ScholarGoogle ScholarCross RefCross Ref
  10. L. Berg. 1967. Introduction to the Operational Calculus. North-Holland Publishing Co., Amsterdam.Google ScholarGoogle Scholar
  11. D. Beyer and M.E. Keremoglu. 2011. CPAchecker: A Tool for Configurable Software Verification. In CAV. Google ScholarGoogle ScholarCross RefCross Ref
  12. 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 ScholarGoogle Scholar
  13. B. Boigelot and P. Wolper. 1994. Symbolic verification with periodic sets. In CAV. 55–67. Google ScholarGoogle ScholarCross RefCross Ref
  14. M. Bozga, R. Iosif, and F. Konečný. 2010. Fast Acceleration of Ultimately Periodic Relations. In CAV. 227–242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. M. Brockschmidt, F. Emmes, S. Falke, C. Fuhs, and J. Giesl. 2014. Alternating runtime and size complexity analysis of integer programs. In TACAS. Google ScholarGoogle ScholarCross RefCross Ref
  16. B. Buchberger. 1976. A Theoretical Basis for the Reduction of Polynomials to Canonical Forms. SIGSAM Bull. 10, 3 (Aug. 1976), 19–29. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. B.-Y.E. Chang and K.R.M Leino. 2005. Abstract Interpretation with Alien Expressions and Heap Structures. In VMCAI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. S. Cohen. 2003. Computer Algebra and Symbolic Computation: Mathematical Methods. A K Peters/CRC Press.Google ScholarGoogle Scholar
  19. M. A. Colón. 2004. Approximating the Algebraic Relational Semantics of Imperative Programs. In SAS. 296–311. Google ScholarGoogle ScholarCross RefCross Ref
  20. P. Cousot and R. Cousot. 1979. Systematic Design of Program Analysis Frameworks. In POPL. 269–282. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. P. Cousot and N. Halbwachs. 1978. Automatic Discovery of Linear Constraints Among Variables of a Program. In POPL.Google ScholarGoogle Scholar
  22. 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 ScholarGoogle ScholarCross RefCross Ref
  23. L. de Moura and N. Bjørner. 2008. Z3: An Efficient SMT Solver. In TACAS.Google ScholarGoogle Scholar
  24. S. de Oliveira, S. Bensalem, and V. Prevosto. 2016. Polynomial Invariants by Linear Algebra. In ATVA. Google ScholarGoogle ScholarCross RefCross Ref
  25. I. Dillig, T. Dillig, B. Li, and K. McMillan. 2013. Inductive Invariant Generation via Abductive Inference. In OOPSLA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Esparza, S. Kiefer, and M. Luttenberger. 2010. Newtonian Program Analysis. J. ACM 57, 6 (2010). Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. A. Farzan and Z. Kincaid. 2015. Compositional Recurrence Analysis. In FMCAD. Google ScholarGoogle ScholarCross RefCross Ref
  28. A. Finkel and J. Leroux. 2002. How to Compose Presburger-Accelerations: Applications to Broadcast Protocols. In FST TCS. 145–156.Google ScholarGoogle Scholar
  29. P. Flajolet and R. Sedgewick. 2009. Analytic Combinatorics. Cambridge University Press. pdfs.semanticscholar.org/d347/dbb4b2eea7fca0183b55112b9cc07faa51ff.pdf. Google ScholarGoogle ScholarCross RefCross Ref
  30. A. Flores-Montoya and R. Hähnle. 2014. Resource analysis of complex programs with cost equations. In APLAS. Google ScholarGoogle ScholarCross RefCross Ref
  31. G. Gange, J. A. Navas, P. Schachte, H. Søndergaard, and P. J. Stuckey. 2016. An Abstract Domain of Uninterpreted Functions. In VMCAI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. P. Granger. 1992. Improving the Results of Static Analyses Programs by Local Decreasing Iteration. In FSTTCS. Google ScholarGoogle ScholarCross RefCross Ref
  33. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Gulwani, A. Tiwari, and G.C. Necula. 2004. Join Algorithms for the Theory of Uninterpreted Functions. In FSTTCS. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Gurfinkel, T. Kahsai, A. Komuravelli, and J.A. Navas. 2015. The SeaHorn Verification Framework. In CAV. Google ScholarGoogle ScholarCross RefCross Ref
  36. 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 ScholarGoogle Scholar
  37. A. Humenberger, M. Jaroschek, and L. Kovacs. 2017. Automated Generation of Non-Linear Loop Invariants Utilizing Hypergeometric Sequences. In ISSAC. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. 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 ScholarGoogle Scholar
  39. B. Jeannet and A. Miné. 2009. Apron: A Library of Numerical Abstract Domains for Static Analysis. In CAV. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. B. Jeannet, P. Schrammel, and S. Sankaranarayanan. 2014. Abstract Acceleration of General Linear Loops. In POPL. 529–540. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. Kauers and P. Paule. 2011. The Concrete Tetrahedron. SpringerWienNewYork.Google ScholarGoogle Scholar
  42. Z. Kincaid, J. Breck, A. Forouhi Boroujeni, and T. Reps. 2017. Compositional Recurrence Analysis Revisited. In PLDI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. L. Kovács. 2008. Reasoning Algebraically About P-Solvable Loops. In TACAS.Google ScholarGoogle Scholar
  44. A. Miné. 2001. The Octagon Abstract Domain. In Working Conf. on Rev. Eng. 310–322. Google ScholarGoogle ScholarCross RefCross Ref
  45. M. Müller-Olm and H. Seidl. 2004. Precise Interprocedural Analysis through Linear Algebra. In POPL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. T. Reps, M. Sagiv, and G. Yorsh. 2004. Symbolic Implementation of the Best Transformer. In VMCAI. 252–266. Google ScholarGoogle ScholarCross RefCross Ref
  47. T. Reps and A. Thakur. 2016. Automating Abstract Interpretation. In VMCAI. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. T. Reps, E. Turetsky, and P. Prabhu. 2016. Newtonian Program Analysis via Tensor Product. In POPL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. E. Rodríguez-Carbonell and D. Kapur. 2004. Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations. In ISSAC. 266–273.Google ScholarGoogle Scholar
  50. S. Sankaranarayanan, H.B. Sipma, and Z. Manna. 2004. Non-Linear Loop Invariant Generation using Gröbner Bases. In POPL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. A. Srikanth, B. Sahin, and W.R. Harris. 2017. Complexity Verification Using Guided Theorem Enumeration. In POPL. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. T. Terauchi and A. Aiken. 2005. Secure Information Flow As a Safety Problem. In Static Analysis Symp. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. A. Thakur. 2014. Symbolic Abstraction: Algorithms and Applications. Ph.D. Dissertation. Comp. Sci. Dept., Univ. of Wisconsin, Madison, WI. Tech. Rep. 1812.Google ScholarGoogle Scholar
  54. A. Thakur and T. Reps. 2012. A Method for Symbolic Computation of Abstract Operations. In CAV. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. H. Wilf. 1994. Generatingfunctionology, 2nd. Ed. Academic Press. www.math.upenn.edu/ wilf/gfologyLinked2.pdf.Google ScholarGoogle Scholar

Index Terms

  1. Non-linear reasoning for invariant synthesis

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!