## Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations (2004)

Venue: | In International Symposium on Symbolic and Algebraic Computation 2004 (ISSAC04 |

Citations: | 30 - 4 self |

### BibTeX

@INPROCEEDINGS{Rodríguez-carbonell04automaticgeneration,

author = {Enric Rodríguez-carbonell and Deepak Kapur},

title = {Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations},

booktitle = {In International Symposium on Symbolic and Algebraic Computation 2004 (ISSAC04},

year = {2004},

pages = {266--273},

publisher = {ACM Press}

}

### OpenURL

### Abstract

This paper presents the algebraic foundation for an approach for generating polynomial loop invariants in imperative programs. It is first shown that the set of polynomials serving as loop invariants has the algebraic structure of an ideal. Using this connection, a procedure for finding loop invariants is given in terms of operations on ideals, for which Gröbner basis constructions can be employed. Most importantly, it is proved that if the assignment statements in a loop are solvable (in particular, affine) mappings with positive eigenvalues, then the procedure terminates in at most 2m + 1 iterations, where m is the number of variables in the loop. The proof is done by showing that the irreducible subvarieties of the variety associated with the polynomial ideal approximating the invariant polynomial ideal of the loop either stay the same or increase their dimension in every iteration. This yields a correct and complete algorithm for inferring conjunctions of polynomial equations as invariants. The method has been implemented in Maple using the Groebner package. The implementation has been used to automatically discover nontrivial invariants for several examples to illustrate the power of the techniques.

### Citations

2028 |
Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints
- Cousot, Cousot
- 1977
(Show Context)
Citation Context ...an be quite helpful. Karr [13] gave an algorithm for finding linear equalities as loop invariants. This work was extended by Cousot and Halbwachs [5], who applied the model of abstract interpretation =-=[4]-=- for finding invariant linear inequalities using widening operators. Like our techniques, both of these papers were based on forward propagation and fixed point computation (see [21]). Recently, Colón... |

1543 |
A Discipline of Programming
- Dijkstra
- 1976
(Show Context)
Citation Context ...mple programming language consisting of multiple assignment statements, nondeterministic conditional statements and loop constructs is assumed; this is similar to Dijkstra’s guarded command language (=-=[7]-=-). Using the proposed approach, it is possible to handle loop and conditional tests expressed as conjunction of polynomial equations; however, we assume them to be true to keep the presentation simple... |

731 |
The art of computer programming, Volume2, Seminumerical algorithms
- Knuth
- 1973
(Show Context)
Citation Context ... [12] 3 2 1 2 4 < 5 s. √ [7] 3 2 1 2 4 < 6 s. fermat2 factor [1] 3 2 1 2 4 < 4 s. wensley2 division [20] 4 2 3 2 4 < 5 s. euclidex gcd (*) 6 2 5 2 5 < 6 s. lcm2 lcm [7] 4 2 1 2 5 < 5 s. factor factor =-=[15]-=- 4 4 1 3 7 < 20 s. 7. CONCLUSION The main contributions of this paper are: 1. We prove that the set of invariant polynomials of a loop has the algebraic structure of an ideal. Moreover, for any finite... |

616 | Automatic Discovery of Linear Restraints among Variables of a Program
- Cousot, Halbwachs
- 1978
(Show Context)
Citation Context ...w that quantifier elimination and elimination theory can be quite helpful. Karr [13] gave an algorithm for finding linear equalities as loop invariants. This work was extended by Cousot and Halbwachs =-=[5]-=-, who applied the model of abstract interpretation [4] for finding invariant linear inequalities using widening operators. Like our techniques, both of these papers were based on forward propagation a... |

273 |
Ideals, Varieties and Algorithms: An Introduction to Computational Algebraic Geometry and Commutative Algebra
- Cox, Little, et al.
- 1992
(Show Context)
Citation Context ... the body of the loop, the procedure terminates in at most 2 iterations. The procedure for discovering invariants has been implemented in Maple using the Groebner package for manipulating ideals (see =-=[6]-=- as an introduction to Gröbner basis algorithm, commutative algebra and algebraic geometry). The procedure has been sucessfully applied on several nontrivial imperative loop programs to automatically ... |

173 |
Affine Relationships Among Variables of a Program
- Karr
- 1976
(Show Context)
Citation Context ... was not normally possible; and ii), eliminating loop counters had to be done by hand. For polynomial invariants, we show that quantifier elimination and elimination theory can be quite helpful. Karr =-=[13]-=- gave an algorithm for finding linear equalities as loop invariants. This work was extended by Cousot and Halbwachs [5], who applied the model of abstract interpretation [4] for finding invariant line... |

129 | Enumerative Combinatorics, Volume 1
- Stanley
- 1997
(Show Context)
Citation Context ...nd ii), a sequence (ϕs)s∈N is of the form ϕs = rX Pl(s)(γl) s , s ≥ 0 l=1 with the Pl’s polynomials for 1 ≤ l ≤ r if and only if its generating function Φ(z) = P∞ s=0 ϕszs is a rational function (see =-=[19]-=- for an introduction to generating functions). To represent g s as a polynomial mapping, auxiliary variables are introduced to substitute for exponentials of eigenvalues (e.g., u, v for 2 s , (1/2) s ... |

95 | The Verifying Compiler: A Grand Challenge for Computing
- Hoare
(Show Context)
Citation Context ...use the few existing tools ([10]) for this purpose at that moment were not sufficiently effective. Nonetheless, for life-critical applications it is still imperative to verify properties of programs (=-=[11]-=-). With substantial progress in automated reasoning, several techniques for verification have emerged in the form of static analysis of programs (type checking, type inference, extended static checkin... |

84 | Linear invariant generation using non-linear constraint solving. 420-432
- Colón, Sankaranarayanan, et al.
- 2003
(Show Context)
Citation Context ...nding invariant linear inequalities using widening operators. Like our techniques, both of these papers were based on forward propagation and fixed point computation (see [21]). Recently, Colón et al =-=[3]-=- have applied nonlinear constraint solving for discovering linear inequalities without having to use widening operators and/or fix-point computation. Karr’s approach has been recently extended by Müll... |

59 |
Programming: the derivation of algorithms
- Kaldewaij
- 1990
(Show Context)
Citation Context ... it works quite fast. 1 freire1 2 2 3 4 5 6 7 8 9 √ freire2 3 [9] 2 1 1 2 2 < 3 s. √ [9] 3 1 6 4 2 < 5 s. cohencu cube [2] 4 1 4 2 2 < 5 s. cousot toy [5] 2 2 0 - 4 < 4 s. divbin dijkstra2 division 2 =-=[12]-=- 3 2 1 2 4 < 5 s. √ [7] 3 2 1 2 4 < 6 s. fermat2 factor [1] 3 2 1 2 4 < 4 s. wensley2 division [20] 4 2 3 2 4 < 5 s. euclidex gcd (*) 6 2 5 2 5 < 6 s. lcm2 lcm [7] 4 2 1 2 5 < 5 s. factor factor [15] ... |

53 |
The Synthesis of Loop Predicates
- Wegbreit
- 1974
(Show Context)
Citation Context ...< 5 s. cohencu cube [2] 4 1 4 2 2 < 5 s. cousot toy [5] 2 2 0 - 4 < 4 s. divbin dijkstra2 division 2 [12] 3 2 1 2 4 < 5 s. √ [7] 3 2 1 2 4 < 6 s. fermat2 factor [1] 3 2 1 2 4 < 4 s. wensley2 division =-=[20]-=- 4 2 3 2 4 < 5 s. euclidex gcd (*) 6 2 5 2 5 < 6 s. lcm2 lcm [7] 4 2 1 2 5 < 5 s. factor factor [15] 4 4 1 3 7 < 20 s. 7. CONCLUSION The main contributions of this paper are: 1. We prove that the set ... |

44 | Non-linear loop invariant generation using Gröbner bases
- Sankaranarayanan, Sipma, et al.
- 2004
(Show Context)
Citation Context ...signments. They used backward propagation and weakest preconditions, instead of forward propagation and strongest postconditions. During the course of this research, we learned in November 2003 about =-=[18]-=-, in which the authors proposed a method for generating nonlinear polynomial loop invariants. The method starts with a template polynomial with undetermined coefficients and attempts to find values fo... |

41 |
A Synthesizer of Inductive Assertions
- German, Wegbreit, et al.
- 1975
(Show Context)
Citation Context ...rs, needed to establish the validity of the verification conditions, were not powerful enough and (ii) the user had to manually annotate programs with loop invariants, because the few existing tools (=-=[10]-=-) for this purpose at that moment were not sufficiently effective. Nonetheless, for life-critical applications it is still imperative to verify properties of programs ([11]). With substantial progress... |

40 |
Factorization and Primality Testing
- Bressoud
- 1989
(Show Context)
Citation Context ...3 [9] 2 1 1 2 2 < 3 s. √ [9] 3 1 6 4 2 < 5 s. cohencu cube [2] 4 1 4 2 2 < 5 s. cousot toy [5] 2 2 0 - 4 < 4 s. divbin dijkstra2 division 2 [12] 3 2 1 2 4 < 5 s. √ [7] 3 2 1 2 4 < 6 s. fermat2 factor =-=[1]-=- 3 2 1 2 4 < 4 s. wensley2 division [20] 4 2 3 2 4 < 5 s. euclidex gcd (*) 6 2 5 2 5 < 6 s. lcm2 lcm [7] 4 2 1 2 5 < 5 s. factor factor [15] 4 4 1 3 7 < 20 s. 7. CONCLUSION The main contributions of t... |

38 |
Logical analysis of programs
- Katz, Manna
- 1976
(Show Context)
Citation Context ...ariants was an active research topic in the early 70’s, but interest in it dwindled in the 80’s. Now, it seems to have caught on again. Our techniques build upon the difference equations method ([8], =-=[14]-=-), which proceeds in two steps: i) by means of recurrence equations (also called difference equations), an explicit expression is found for the value of each variable as a function of the number of lo... |

26 |
Property extraction in wellfounded property sets
- Wegbreit
- 1975
(Show Context)
Citation Context ...act interpretation [4] for finding invariant linear inequalities using widening operators. Like our techniques, both of these papers were based on forward propagation and fixed point computation (see =-=[21]-=-). Recently, Colón et al [3] have applied nonlinear constraint solving for discovering linear inequalities without having to use widening operators and/or fix-point computation. Karr’s approach has be... |

9 |
Research in interactive program—proving techniques
- Elspas, Green, et al.
- 1972
(Show Context)
Citation Context ...f invariants was an active research topic in the early 70’s, but interest in it dwindled in the 80’s. Now, it seems to have caught on again. Our techniques build upon the difference equations method (=-=[8]-=-, [14]), which proceeds in two steps: i) by means of recurrence equations (also called difference equations), an explicit expression is found for the value of each variable as a function of the number... |

8 |
Programming in the 1990’s
- Cohen
- 1990
(Show Context)
Citation Context ... 6 seconds to complete on all of the other examples in the table, indicating that it works quite fast. 1 freire1 2 2 3 4 5 6 7 8 9 √ freire2 3 [9] 2 1 1 2 2 < 3 s. √ [9] 3 1 6 4 2 < 5 s. cohencu cube =-=[2]-=- 4 1 4 2 2 < 5 s. cousot toy [5] 2 2 0 - 4 < 4 s. divbin dijkstra2 division 2 [12] 3 2 1 2 4 < 5 s. √ [7] 3 2 1 2 4 < 6 s. fermat2 factor [1] 3 2 1 2 4 < 4 s. wensley2 division [20] 4 2 3 2 4 < 5 s. e... |

3 | Computing interprocedurally valid relations in affine programs
- Müller-Olm, Seidl
- 2004
(Show Context)
Citation Context ...linear constraint solving for discovering linear inequalities without having to use widening operators and/or fix-point computation. Karr’s approach has been recently extended by Müller-Olm and Seidl =-=[16]-=- for finding polynomial equalities of bounded degree as invariants of programs with affine assignments. They used backward propagation and weakest preconditions, instead of forward propagation and str... |

2 |
Program Verification Using Automatic Generation of Polynomial Invariants. www.lsi.upc.es/~erodri
- Rodríguez-Carbonell, Kapur
(Show Context)
Citation Context ... hardware using theorem proving techniques. However, the annotation burden remains. Our work attempts to deal with the problem of automatically generating loop invariants, which is still unsolved. In =-=[17]-=-, an abstract framework for finding invariants of simple loops with assignments and conditional statements was presented. Properties of the language used for expressing invariants were identified so t... |