Generating all polynomial invariants in simple loops

This paper presents a method for automatically generating all polynomial invariants in simple loops. It is first shown that the set of polynomials serving as loop invariants has the algebraic structure of an ideal. Based on this connection, a fixpoint procedure using operations on ideals and Grobner basis constructions is proposed for finding all polynomial invariants. Most importantly, it is proved that the procedure terminates in at most m+1 iterations, where m is the number of program variables. The proof relies on showing that the irreducible components of the varieties associated with the ideals generated by the procedure either remain the same or increase their dimension at every iteration of the fixpoint procedure. This yields a correct and complete algorithm for inferring conjunctions of polynomial equalities as invariants. The method has been implemented in Maple using the Groebner package. The implementation has been used to automatically discover non-trivial invariants for several examples to illustrate the power of the technique.

[1]  Steven M. German,et al.  A synthesizer of inductive assertions , 1975, IEEE Transactions on Software Engineering.

[2]  David Thomas,et al.  The Art in Computer Programming , 2001 .

[3]  Edward Cohen,et al.  Programming in the 1990s , 1990, Texts and Monographs in Computer Science.

[4]  Martín Abadi,et al.  Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2005, Long Beach, California, USA, January 12-14, 2005 , 2005, POPL.

[5]  Helmut Seidl,et al.  Precise interprocedural analysis through linear algebra , 2004, POPL.

[6]  David A. Cox,et al.  Ideals, Varieties, and Algorithms , 1997 .

[7]  Markus Müller-Olm,et al.  A Note on Karr's Algorithm , 2004, ICALP.

[8]  Ron K. Cytron,et al.  Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages , 1995, POPL 1995.

[9]  Enric Rodríguez-Carbonell,et al.  An Abstract Interpretation Approach for Automatic Generation of Polynomial Invariants , 2004, SAS.

[10]  Anne Kaldewaij,et al.  Programming - the derivation of algorithms , 1990, Prentice Hall international series in computer science.

[11]  Ben Wegbreit,et al.  Property extraction in well-founded property sets , 1975, IEEE Transactions on Software Engineering.

[12]  Patrick Cousot,et al.  Static determination of dynamic properties of programs , 1976 .

[13]  Deepak Kapur Automatically Generating Loop Invariants Using Quantifier Elimination , 2005, Deduction and Applications.

[14]  Zohar Manna,et al.  Logical analysis of programs , 1976, CACM.

[15]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[16]  David M. Bressoud Factorization and Primality Testing , 1989 .

[17]  C. A. R. Hoare The Verifying Compiler, a Grand Challenge for Computing Research , 2005, VMCAI.

[18]  Donal O'Shea,et al.  Ideals, varieties, and algorithms - an introduction to computational algebraic geometry and commutative algebra (2. ed.) , 1997, Undergraduate texts in mathematics.

[19]  Heinz Kredel,et al.  Gröbner Bases: A Computational Approach to Commutative Algebra , 1993 .

[20]  Enric Rodríguez-Carbonell,et al.  Program Verification Using Automatic Generation of Invariants , 2004, ICTAC.

[21]  Henny B. Sipma,et al.  Non-linear loop invariant generation using Gröbner bases , 2004, POPL.

[22]  Norihisa Suzuki,et al.  Implementation of an array bound checker , 1977, POPL.

[23]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[24]  Steven M. German,et al.  A Synthesizer of Inductive Assertions , 1975, IEEE Trans. Software Eng..

[25]  Enric Rodríguez-Carbonell,et al.  Automatic generation of polynomial invariants of bounded degree using abstract interpretation , 2007, Sci. Comput. Program..

[26]  Donald E. Knuth,et al.  The art of computer programming. Vol.2: Seminumerical algorithms , 1981 .

[27]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

[28]  Ben Wegbreit,et al.  The synthesis of loop predicates , 1974, CACM.

[29]  R. Stanley What Is Enumerative Combinatorics , 1986 .

[30]  Markus Müller-Olm,et al.  Computing polynomial program invariants , 2004, Inf. Process. Lett..

[31]  Zohar Manna,et al.  Inference Rules for Program Annotation , 1978, IEEE Transactions on Software Engineering.

[32]  Sumit Gulwani,et al.  Precise interprocedural analysis using random interpretation , 2005, POPL '05.

[33]  Enric Rodríguez-Carbonell,et al.  Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations , 2004, ISSAC '04.

[34]  Michael Karr,et al.  Affine relationships among variables of a program , 1976, Acta Informatica.

[35]  Michael Colón,et al.  Approximating the Algebraic Relational Semantics of Imperative Programs , 2004, SAS.