Skip to main content
Log in

Generating invariants for non-linear loops by linear algebraic methods

  • Original Article
  • Published:
Formal Aspects of Computing

Abstract

We present new computational methods that can automate the discovery and the strengthening of non-linear interrelationships among the variables of programs containing non-linear loops, that is, that give rise to multivariate polynomial and fractional relationships. Our methods have complexities lower than the mathematical foundations of the previous approaches, which used Gröbner basis computations, quantifier eliminations or cylindrical algebraic decompositions. We show that the preconditions for discrete transitions can be viewed as morphisms over a vector space of degree bounded by polynomials. These morphisms can, thus, be suitably represented by matrices. We also introduce fractional and polynomial consecution, as more general forms for approximating consecution. The new relaxed consecution conditions are also encoded as morphisms represented by matrices. By so doing, we can reduce the non-linear loop invariant generation problem to the computation of eigenspaces of specific morphisms. Moreover, as one of the main results, we provide very general sufficient conditions allowing for the existence and computation of whole loop invariant ideals. As far as it is our knowledge, it is the first invariant generation methods that can handle multivariate fractional loops.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Arnaudiesa JM, Valibouze A (1997) Lagrange resolvents. J Pure Appl Algebra 117−118: 23–40

  2. Bensalem S, Bozga M, Ghirvu J-C, Lakhnech L (2000) A transformation approach for generating non-linear invariants. Stat Anal Sympos 5: 101–114

    Google Scholar 

  3. Bensalem S, Lakhnech Y, Saidi H (1996) Powerful techniques for the automatic generation of invariants. In: Alur R, Henzinger TA (eds) Proceedings of the 8th international conference on computer aided verification CAV, vol 1102, pp 323–335

  4. Buchberger B (1996) Symbolic computation: computer algebra and logic. In: Frontiers of combining systems. Proceedings of the 1st international workshop, Munich, pp 193–220

  5. Cousot P, Cousot R (1977) Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: Symposium of the principles of programming languages, pp 238–252. ACM Press, New York

  6. Cousot P, Cousot R (1992) Abstract interpretation and application to logic programs. J Logic Program 13(2–3): 103–179

    Article  MATH  MathSciNet  Google Scholar 

  7. Collins GE (1975) Quantifier elimination for the elementary theory of real closed fields by cylindrical algebraic decomposition. In: LNCS. Springer, New York

    Google Scholar 

  8. Cousot P (2005) Proving program invariance and termination by parametric abstraction, lagrangian relaxation and semidefinite programming. In: Conference on VMCAI, pp 1–24, Paris, LNCS, vol 3385, 17–19 January 2005

  9. Chen Y, Xia B, Yang L, Zhan N (2007) Generating polynomial invariants with discoverer and QEPCAD. In: Formal methods and hybrid, real-time systems, pp 67–82

  10. Dijkstra EW (1976) A discipline of programming. Prentince-Hall, London

    MATH  Google Scholar 

  11. Faugere J-C (1999) A new efficient algorithm for computing Grobner bases (f4). J Pure Appl Algebra 139(1–3): 61–88

    Article  MATH  MathSciNet  Google Scholar 

  12. Floyd RW (1967) Assigning meanings to programs. In: Proceedings of the 19th symposium on applied mathematics, pp 19–37

  13. Gulwani S, Tiwari A (2006) Assertion checking over combined abstraction of linear arithmetic and uninterpreted functions. In: Sestoft P (ed) European symposium on programming, ESOP 2006, LNCS, vol 3924, pp 279–293

  14. Gulwani S, Tiwari A (2008) Constraint-based approach for analysis of hybrid systems. In: Proceedings of the 14th international conference on computer aided verification (CAV)

  15. Hoare CAR (1969) An axiomatic basis for computer programming. Commun ACM 12(10): 576–580

    Article  MATH  Google Scholar 

  16. Jebelean T, Kovacs L, Popov N (2006) Experimental program verification in the theorema system. Int J Softw Tools Technol Transf (STTT) (in press)

  17. Kapur D (2004) Automatically generating loop invariants using quantifier elimination. In: Proceedings of the IMACS international conference on applications of computer algebra

  18. Kovacs L, Jebelean T (2006) Finding polynomial invariants for imperative loops in the theorema system. In: Proceedings of the verify’06 workshop, pp 52–67, 15–16 August 2006

  19. Kovacs L (2008) Reasoning algebraically about p-solvable loops. In: TACAS 2008, Proceedings of the 14th international conference on tools and algorithms for the construction and analysis of systems, LNCS, vol 4963, pp 249–264.

  20. Lang S (2002) Algebra. Springer, New York

    Book  MATH  Google Scholar 

  21. Müller-Olm M, Seidl H (2002) Polynomial constants are decidable. In: Static analysis symposium, LNCS, pp 4–19

  22. Manna Z, Pnueli A (1995) Temporal verification of reactive systems: safety. Springer, New York

    Book  Google Scholar 

  23. Platzer A, Clarke EM (2008) Clarke Computing differential invariants of hybrid systems as fixedpoints. In: Proceedings of the computer-aided verification, CAV 2008, Princeton, LNCS. Springer, New York

  24. Prajna S, Jadbabaie A (2004) Safety verification of hybrid systems using barrier certificates

  25. Rodríguez-Carbonell E, Kapur D (2007) Automatic generation of polynomial invariants of bounded degree using abstract interpretation. Sci Comput Program 64(1): 54–75

    Article  MATH  Google Scholar 

  26. Rodríguez-Carbonell E, Kapur D (2007) Generating all polynomial invariants in simple loops. J Symb Comput 42(4): 443–476

    Article  MATH  Google Scholar 

  27. Rebiha R, Moura AV (2009) Automated malware invariant generation. In: 6th international conference on forensic computer science, ICoFSC2009 and ICCYBER2009 (best paper award)

  28. Rebiha R, Moura AV (2011) Algebraic formal methods for invariant generation. In: Ph.D. Dissertation, Faculty of Informatics USI, University of Lugano, Switzerland, pp 1–209

  29. Rebiha R, Moura AV (2011) Algebraic formal methods for invariant generation. In: Ph.D. Dissertation, Insitute of Computing UNICAMP, University of Campinas, Sao Paulo, pp 1–214

  30. Rebiha R, Moura AV (2011) Semantic malware resistance using inductive invariants. Int J Forensic Comput Sci (IJoFCS0) (best paper award, 5)

  31. Rebiha R, Matringe N, Moura AV (2008) Endomorphism for non-trivial semi-algebraic loop invariant generation. In: Technical report TR-IC-08-31, Institute of Computing, University of Campinas

  32. Rebiha R, Matringe N, Moura AV (2008) Endomorphisms for non-trivial non-linear loop invariant generation. In: 5th international conference on theoretical aspects of computing, pp 425–439, LNCS

  33. Rebiha R, Matringe N, Moura AV (2010) Generatin invariants for non-linear hybrid systems by linear algebraic methods. In: 17th international static analysis symposium, SAS2010, LNCS

  34. Schrijver A (1986) Theory of linear and integer programming. Wiley, New York

    MATH  Google Scholar 

  35. Stein W, Joyner D (2005) SAGE: system for algebra and geometry experimentation. ACM SIGSAM Bull 39(2): 61–64

    Article  Google Scholar 

  36. Sankaranarayanan S, Sipma H, Manna Z (2004) Constructing invariants for hybrid system. In: Hybrid systems: computation and control (HSCC), LNCS, vol. 2993, pp 539–554. Springer, New York

  37. Sankaranarayanan S, Sipma HB, Manna Z (2004) Non-linear loop invariant generation using grobner bases. In: POPL ’04, Proceedings of the 31st ACM SIGPLAN-SIGACT symposium on principles of programming languages, pp 318–329. ACM Press, New York

  38. Tiwari A (2008) Generating box invariants. In: Proceedings of the 11th international conference on hybrid systems: computation and control (HSCC)

  39. Weispfenning V (1997) Quantifier elimination for real algebra—the quadratic case and beyond. Appl Algebra Eng Commun Comput 8(2): 85–101

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Rachid Rebiha.

Additional information

E. Allen Emerson

FAPESP BEPE grant 2013/04734-9, FAPESP grant 2011/08947-1.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Rebiha, R., Moura, A.V. & Matringe, N. Generating invariants for non-linear loops by linear algebraic methods. Form Asp Comp 27, 805–829 (2015). https://doi.org/10.1007/s00165-015-0333-3

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-015-0333-3

Keywords

Navigation