## An abstract interpretation approach for automatic generation of polynomial invariants (2004)

Venue: | In 11th Static Analysis Symposium |

Citations: | 17 - 4 self |

### BibTeX

@INPROCEEDINGS{Rodríguez-carbonell04anabstract,

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

title = {An abstract interpretation approach for automatic generation of polynomial invariants},

booktitle = {In 11th Static Analysis Symposium},

year = {2004},

pages = {280--295},

publisher = {Springer}

}

### OpenURL

### Abstract

www.cs.unm.edu/~kapur Abstract. A method for generating polynomial invariants of imperative programs is presented using the abstract interpretation framework. It is shown that for programs with polynomial assignments, an invariant consisting of a conjunction of polynomial equalities can be automatically generated for each program point. The proposed approach takes into account tests in conditional statements as well as in loops, insofar as they can be abstracted to be polynomial equalities and disequalities. The semantics of each statement is given as a transformation on polynomial ideals. Merging of paths in a program is defined as the intersection of the polynomial ideals associated with each path. For a loop junction, a widening operator based on selecting polynomials up to a certain degree is proposed. The algorithm for finding invariants using this widening operator is shown to terminate in finitely many steps. The proposed approach has been implemented and successfully tried on many programs. A table providing details about the programs is given. 1

### Citations

2004 |
Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints
- Cousot, Cousot
- 1977
(Show Context)
Citation Context ...riants for imperative programs is developed in this paper. It is analogous to the approach proposed in [6] for finding linear inequalities as invariants based on the abstract interpretation framework =-=[5]-=-. The proposed method, in contrast, generates polynomial equations as invariants by interpreting the semantics of programming language constructs in terms ⋆ This research was partially supported by an... |

1535 |
A Discipline of Programming
- DIJKSTRA
- 1976
(Show Context)
Citation Context ...efs (∗) 2 8 1 1 1 5 3.69 fermat divisor [2] 2 5 0 3 2 1-1-1 1.55 prod4br product (∗) 3 6 3 1 1 1 8.49 freire1 integer sqrt [11] 2 3 0 1 1 1 0.75 hard integer division [22] 2 6 1 2 1 3-3 2.19 lcm2 lcm =-=[10]-=- 2 6 1 1 1 1 2.03 readers simulation [22] 2 6 3 1 1 2 4.15 3 These examples are available at www.lsi.upc.es/~erodris8 Conclusions We have presented an approach based on abstract interpretation for gen... |

731 |
The art of Computer Programming, volume 2 Seminumerical Algorithms
- Knuth
- 1968
(Show Context)
Citation Context ... b)∧xu+yv = ab, which implies u+v = lcm(a, b). Example 3. The next example is an implementation of extended Euclid’s algorithm to compute Bezout’s coefficients (p, r) of two natural numbers x, y (see =-=[17]-=-), using a division program extracted from [3]. Notice that it has several levels of nested loops and non-linear polynomial assignments. var x, y, a, b, p, q, r, s: integer end var (a, b, p, q, r, s):... |

604 | Automatic Discovery of Linear Restraints among Variables of a
- Cousot, Halbwachs
- 1978
(Show Context)
Citation Context ...are circuits and designs, software and protocol analysis. A method for generating polynomial invariants for imperative programs is developed in this paper. It is analogous to the approach proposed in =-=[6]-=- for finding linear inequalities as invariants based on the abstract interpretation framework [5]. The proposed method, in contrast, generates polynomial equations as invariants by interpreting the se... |

346 |
Macaulay 2, a software system for research in algebraic geometry. Available at http://www.math.uiuc.edu/Macaulay2
- Grayson, Stillman
(Show Context)
Citation Context ... the basis with degree ≤ d. The procedure for finding invariants using this widening operator is shown to terminate in finitely many steps. The proposed algorithm has been implemented using Macaulay2 =-=[12]-=-, an algebraic geometry tool that supports operations on polynomial ideals such as the computation of Gröbner bases. Using this implementation, loop invariants for several numerical programs have been... |

267 | Ideals, Varieties, and Algorithms. An Introduction to - Cox, Little, et al. - 1997 |

169 |
Affine relationships among variables of a program
- Karr
- 1976
(Show Context)
Citation Context ...mplement of the method proposed by Cousot and Halbwachs [6], who applied the framework of abstract interpretation [5] for finding invariant linear inequalities. That work extended Karr’s algorithm in =-=[16]-=- for finding invariant linear equalities at any program point. Recently, there has been a renewed surge of interest in automatically deriving invariants of imperative programs. In [4] Colón et al. hav... |

127 | Efficient chaotic iteration strategies with widenings
- Bourdoncle
- 1993
(Show Context)
Citation Context ...on discovers loop invariants. Section 8 concludes and discusses ideas for extending this research. 1 The method also works for unnested loops with spaghetti control flow, using Bourdoncle’s algorithm =-=[1]-=- to find adequate widening points in the control-flow graph.s1.1 Related Work As stated above, the proposed approach is a complement of the method proposed by Cousot and Halbwachs [6], who applied the... |

79 | Linear invariant generation using non-linear constraint solving
- Colón, Sankaranarayanan, et al.
- 2003
(Show Context)
Citation Context ...’s algorithm in [16] for finding invariant linear equalities at any program point. Recently, there has been a renewed surge of interest in automatically deriving invariants of imperative programs. In =-=[4]-=- Colón et al. have used non-linear constraint solving based on Farkas’ lemma to attack the problem of finding invariant linear inequalities. Extending Karr’s work, for programs with affine assignments... |

76 |
Computer Algebra. Systems and algorithms for algebraic computation
- Davenport, Siret, et al.
- 1993
(Show Context)
Citation Context ...n be seen that the ideal I(A) is an ideal of variety. Moreover, if I is an ideal of variety, then I(V(I) − V(J)) = I : J, where − denotes difference of sets. For further detail on these concepts, see =-=[8, 7]-=-. A term in a set ¯x = (x1, ..., xn) of variables is an expression of the form ¯x ¯α = x α1 1 xα2 2 · · · xαn n , where ¯α = (α1, ..., αn) ∈ N n . The set of terms is denoted by T . A monomial is an e... |

59 |
Programming: the derivation of algorithms
- Kaldewaij
- 1990
(Show Context)
Citation Context ... (in seconds). Table 1. Table of examples PROGRAM COMPUTING SOURCE d VAR IF LOOP DEPTH INV TIME cohencu cube [3] 3 5 0 1 1 4 2.45 dershowitz real division [9] 2 7 1 1 1 3 1.71 divbin integer division =-=[13]-=- 2 5 1 2 1 2-1 1.91 euclidex1 Bezout’s coefs [17] 2 10 0 2 2 3-4 7.15 euclidex2 Bezout’s coefs (∗) 2 8 1 1 1 5 3.69 fermat divisor [2] 2 5 0 3 2 1-1-1 1.55 prod4br product (∗) 3 6 3 1 1 1 8.49 freire1... |

44 | Non-linear loop invariant generation using gröbner bases
- Sankaranarayanan, Sipma, et al.
- 2004
(Show Context)
Citation Context ...omputing such invariants, and was shown to be sound and complete. However, that method cannot handle nested loops; furthermore, tests in conditional statements and loops are abstracted to be true. In =-=[22]-=-, a method is proposed for generating nonlinear polynomials as invariants, which starts with a template polynomial with undetermined coefficients and attempts to find values for the coefficients so th... |

39 |
Factorization and Primality Testing
- Bressoud
- 1989
(Show Context)
Citation Context ...owitz real division [9] 2 7 1 1 1 3 1.71 divbin integer division [13] 2 5 1 2 1 2-1 1.91 euclidex1 Bezout’s coefs [17] 2 10 0 2 2 3-4 7.15 euclidex2 Bezout’s coefs (∗) 2 8 1 1 1 5 3.69 fermat divisor =-=[2]-=- 2 5 0 3 2 1-1-1 1.55 prod4br product (∗) 3 6 3 1 1 1 8.49 freire1 integer sqrt [11] 2 3 0 1 1 1 0.75 hard integer division [22] 2 6 1 2 1 3-3 2.19 lcm2 lcm [10] 2 6 1 1 1 1 2.03 readers simulation [2... |

30 | Automatic generation of polynomial loop invariants: Algebraic foundations
- Rodriguez-Carbonell, Kapur
- 2004
(Show Context)
Citation Context ...3 = 〈x1 − x 2 t+1 � 2, (x2 − s)〉 . It is clear that only the first polynomial x1 − x 2 2 yields an invariant for the loop, as it persists to be in I3 after arbitrarily many executions of the loop. In =-=[20]-=-, we gave an algebraic geometry-based approach to capture the effect of arbitrarily many iterations. Ideal-theoretic manipulations were employed to consider the effect of executing a path arbitrarily ... |

19 | An Equational Approach to Theorem Proving in First-Order Predicate Calculus
- Kapur, Narendran
- 1985
(Show Context)
Citation Context ...in kinds of statements can be considered this way; in particular, restrictions on tests in conditionals and loops, as well as on assignments, must be imposed. However, using the approach discussed in =-=[15]-=-, where an ideal-theoretic interpretation of first-order predicate calculus is presented, it might be possible to give an algebraic semantics of arbitrary programming constructs using ideal-theoretic ... |

15 |
A refutational approach to geometry theorem proving
- Kapur
- 1988
(Show Context)
Citation Context ...pj(¯x) = 0)} .sFor simplicity, below we just show how to express the assertion for the true path in terms of ideals when C is an atomic formula. More complex boolean expressions can be handled easily =-=[14]-=-. Polynomial Equalities. If C is a polynomial equality, i.e., it is of the form q = 0 with q ∈ K[¯x], then the states of the true path are V(q) ∩ V(I); in this case we take as output IV(〈q〉 + I) = IV(... |

8 |
Programming in the 1990’s
- Cohen
- 1990
(Show Context)
Citation Context ...Example 3. The next example is an implementation of extended Euclid’s algorithm to compute Bezout’s coefficients (p, r) of two natural numbers x, y (see [17]), using a division program extracted from =-=[3]-=-. Notice that it has several levels of nested loops and non-linear polynomial assignments. var x, y, a, b, p, q, r, s: integer end var (a, b, p, q, r, s):=(x, y, 1, 0, 0, 1); while b �= 0 do var c, k:... |

7 |
Inference Rules for Program Annotation
- Dershowitz, Manna
- 1978
(Show Context)
Citation Context ...mn gives the time taken by the implementation (in seconds). Table 1. Table of examples PROGRAM COMPUTING SOURCE d VAR IF LOOP DEPTH INV TIME cohencu cube [3] 3 5 0 1 1 4 2.45 dershowitz real division =-=[9]-=- 2 7 1 1 1 3 1.71 divbin integer division [13] 2 5 1 2 1 2-1 1.91 euclidex1 Bezout’s coefs [17] 2 10 0 2 2 3-4 7.15 euclidex2 Bezout’s coefs (∗) 2 8 1 1 1 5 3.69 fermat divisor [2] 2 5 0 3 2 1-1-1 1.5... |

3 | Computing interprocedurally valid relations in affine programs
- Müller-Olm, Seidl
- 2004
(Show Context)
Citation Context ...d non-linear constraint solving based on Farkas’ lemma to attack the problem of finding invariant linear inequalities. Extending Karr’s work, for programs with affine assignments Müller-Olm and Seidl =-=[18]-=- proposed an interprocedural method for computing polynomial equations of bounded degree as invariants. In [21], we developed an abstract framework for generating invariants of loops. This framework w... |

2 |
Program Verification Using Automatic Generation of Polynomial Invariants. www.lsi.upc.es/~erodri
- Rodríguez-Carbonell, Kapur
(Show Context)
Citation Context ...lities. Extending Karr’s work, for programs with affine assignments Müller-Olm and Seidl [18] proposed an interprocedural method for computing polynomial equations of bounded degree as invariants. In =-=[21]-=-, we developed an abstract framework for generating invariants of loops. This framework was instantiated to generate conjunctions of polynomial equations as invariants for loop programs. The method us... |