## Automatically generating loop invariants using quantifier elimination (2005)

### Cached

### Download Links

- [www.cs.unm.edu]
- [www.cs.unm.edu]
- [drops.dagstuhl.de]
- DBLP

### Other Repositories/Bibliography

Venue: | In Deduction and Applications |

Citations: | 27 - 0 self |

### BibTeX

@INPROCEEDINGS{Kapur05automaticallygenerating,

author = {Deepak Kapur},

title = {Automatically generating loop invariants using quantifier elimination},

booktitle = {In Deduction and Applications},

year = {2005}

}

### Years of Citing Articles

### OpenURL

### Abstract

Abstract. An approach for automatically generating loop invariants using quantifier-elimination is proposed. An invariant of a loop is hypothesized as a parameterized formula. Parameters in the invariant are discovered by generating constraints on the parameters by ensuring that the formula is indeed preserved by the execution path corresponding to every basic cycle of the loop. The parameterized formula can be successively refined by considering execution paths one by one; heuristics can be developed for determining the order in which the paths are considered. Initialization of program variables as well as the precondition and postcondition of the loop, if available, can also be used to further refine the hypothesized invariant. Constraints on parameters generated in this way are solved for possible values of parameters. If no solution is possible, this means that an invariant of the hypothesized form does not exist for the loop. Otherwise, if the parametric constraints are solvable, then under certain conditions on methods for generating these constraints, the strongest possible invariant of the hypothesized form can be generated from most general solutions of the parametric constraints. The approach is illustrated using the first-order theory of polynomial equations as well as Presburger arithmetic. 1.

### Citations

1880 |
Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints
- Cousot, Cousot
- 1977
(Show Context)
Citation Context ...y. Recently, there appears to be a revival of research activities relating to mechanically discovering loop invariants, especially using abstract interpretations and the associated widening operators =-=[4, 5, 20, 21, 24]-=-. This paper explores the use of quantifier elimination methods for generating loop invariants. A loop invariant is hypothesized to be a parameterized formula in a first-order theory in which certain ... |

1459 |
Theory of linear and integer programming
- Schrijver
- 1986
(Show Context)
Citation Context ..., d that satisfy the above formula, c1i + c2j + d ≤ 0 is an invariant. All solutions of P can be written in terms of the generator set consisting of 〈c1 = 0, c2 = −1, d = 0〉, 〈c1 = −1, c2 = 2, d = 2〉 =-=[26]-=-. Corresponding to each generator is an invariant. The conjunction of the invariants corresponding to these generators is (−j ≤ 0 ∧ −i + 2j + 2 ≤ 0), which can be shown to be the strongest invariant e... |

572 | Automatic discovery of linear restraints among variables of a program
- Cousot, Halbwachs
- 1978
(Show Context)
Citation Context ...y. Recently, there appears to be a revival of research activities relating to mechanically discovering loop invariants, especially using abstract interpretations and the associated widening operators =-=[4, 5, 20, 21, 24]-=-. This paper explores the use of quantifier elimination methods for generating loop invariants. A loop invariant is hypothesized to be a parameterized formula in a first-order theory in which certain ... |

179 |
Partial cylindrical algebraic decomposition for quantifier elimination
- Collins, Hong
- 1991
(Show Context)
Citation Context ...e field of complex numbers). The theory of real closed field admits quantifier-elimination. Decision procedures for the theory has been extensively studied and implemented over the last 40 years; see =-=[2]-=-. Specialized implementation of decision procedures along with the ones for low degree polynomial constraints are available–software packages REDLOG [6] and QEPCAD [11] implemented on top of computer ... |

160 |
Affine Relationships Among Variables of a Program
- Karr
- 1976
(Show Context)
Citation Context ...of loop iterations and then eliminating the variable s to obtain invariant predicates. They were however unable to demonstrate the effectiveness of their techniques for nontrivial loop programs. Karr =-=[17]-=- gave an algorithm for finding linear equalities as loop invariants. This work was extended by Cousot and Halbwachs [5], who applied the concept of abstract interpretation [4] to finding linear inequa... |

104 | Redlog: Computer algebra meets computer logic
- Dolzmann, Sturm
- 1997
(Show Context)
Citation Context ...ied and implemented over the last 40 years; see [2]. Specialized implementation of decision procedures along with the ones for low degree polynomial constraints are available–software packages REDLOG =-=[6]-=- and QEPCAD [11] implemented on top of computer algebra systems REDUCE and Maple, respectively, are particularly promising. Unlike in the cases of the theory of polynomial equations and Presburger ari... |

78 |
Mechanical Geometry Theorem Proving
- Chou
- 1988
(Show Context)
Citation Context ...ard CCR-0113611. Dagstuhl Seminar Proceedings 05431 Deduction and Applications http://drops.dagstuhl.de/opus/volltexte/2006/511 1s2 DEEPAK KAPUR geometry theorem proving by Wu Wen-Tsun [30, 31], Chou =-=[1]-=- and the author [12, 13]. 1 By considering every possible basic cycle arising from the execution of a given loop, the goal is to successively deduce constraints on these parameters such that for value... |

78 |
Basic Principles of Mechanical Theorem Proving in Geometries,Vol
- Wu
- 1993
(Show Context)
Citation Context ...y an NSF ITR award CCR-0113611. Dagstuhl Seminar Proceedings 05431 Deduction and Applications http://drops.dagstuhl.de/opus/volltexte/2006/511 1s2 DEEPAK KAPUR geometry theorem proving by Wu Wen-Tsun =-=[30, 31]-=-, Chou [1] and the author [12, 13]. 1 By considering every possible basic cycle arising from the execution of a given loop, the goal is to successively deduce constraints on these parameters such that... |

64 | invariant generation using non-linear constraint solving
- Colón, Sankaranarayanan, et al.
(Show Context)
Citation Context ...ork has been recently proposed by Müller-Olm and Seidl [21], who generate using linear algebra techniques, polynomial equations of bounded degree as invariants in programs with affine assignments. In =-=[3]-=-, Colón et al. have used Farakka’s lemma and non-linear constraint solving for finding invariant linear inequalities. This paper is inspired by [3]. Recently, Rodriguez-Carbonell and Kapur [23, 22] ha... |

64 | An overview of Rewrite Rule Laboratory (RRL
- Kapur, Zhang
- 1995
(Show Context)
Citation Context ...ntifier-elimination; Enderton’s book [9] gives one such method. Fourier-Motzkin’s algorithm for projection (elimination of vaiables) as implemented in our theorem prover Rewrite Rule Laboratory (RRL) =-=[16, 15]-=- can also be used; this is illustrated below. Without any loss of generality, it can be assumed that the formula from which a variable x has to be eliminated is a conjunction of inequalities of the fo... |

62 | Applying Linear Quantifier Elimination
- Loos, Weispfenning
- 1993
(Show Context)
Citation Context ...l-known that Fourier-Motzkin’s algorithm can be bad in the worst case. Other algorithms including integer programming or linear programming in case of rationals can be used as well; see, for example, =-=[19]-=-.sAUTOMATICALLY GENERATING LOOP INVARIANTS 11 while true do if true → 〈i, j〉:=〈i + 4, j〉; [] true → 〈i, j〉:=〈i + 2, j + 1〉; end if end while If the invariant for the above loop is hypothesized to be a... |

49 |
The synthesis of loop predicates
- Wegbreit
- 1974
(Show Context)
Citation Context ...eliberately kept informal with lots of illustration. A more comprehensive technical treatment will be presented in a subsequent paper. 1.1. Related Work. In the seventies, Wegbreit and his colleagues =-=[27, 28, 10]-=-, Elpas et al [8], Manna and Katz [18] proposed writing the semantics of assignment statements in the body of a loop as recurrence equations (also called difference equations), finding an explicit exp... |

40 | Non-linear loop invariant generation using gröbner bases
- Sankaranarayanan, Sipma, et al.
- 2004
(Show Context)
Citation Context ...orm does not exist. The proposed approach is, however, simpler to understand and implement. It is somewhat related to an approach the author was made aware of in November/December 2003 as reported in =-=[25]-=-; polynomial invariants whose form is a priori determined (called templates) are computed using an extended Gröbner basis algorithm over templates. They also suggested comprehensive Gröbner basis algo... |

39 |
A synthesizer of inductive assertions
- German, Wegbreit
- 1975
(Show Context)
Citation Context ...ative programs, discovering invariants of loops automatically has been viewed as a considerable technical challenge. There have been many attempts to address this problem since the pioneering work of =-=[8, 10, 18]-=-; the success however has been limited. As a result, research in program verification has suffered considerably. Recently, there appears to be a revival of research activities relating to mechanically... |

35 |
Logical analysis of programs
- Katz, Manna
- 1976
(Show Context)
Citation Context ...ative programs, discovering invariants of loops automatically has been viewed as a considerable technical challenge. There have been many attempts to address this problem since the pioneering work of =-=[8, 10, 18]-=-; the success however has been limited. As a result, research in program verification has suffered considerably. Recently, there appears to be a revival of research activities relating to mechanically... |

29 | Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations
- Rodríguez-Carbonell, Kapur
- 2004
(Show Context)
Citation Context ...nts. In [3], Colón et al. have used Farakka’s lemma and non-linear constraint solving for finding invariant linear inequalities. This paper is inspired by [3]. Recently, Rodriguez-Carbonell and Kapur =-=[23, 22]-=- have proposed a general abstract framework for computing loop invariants using fixed point computation on formulas generated from the body of a given loop. They showed how this framework can be insta... |

23 | Polynomial Constants are Decidable
- Müller-Olm, Seidl
- 2002
(Show Context)
Citation Context ...y. Recently, there appears to be a revival of research activities relating to mechanically discovering loop invariants, especially using abstract interpretations and the associated widening operators =-=[4, 5, 20, 21, 24]-=-. This paper explores the use of quantifier elimination methods for generating loop invariants. A loop invariant is hypothesized to be a parameterized formula in a first-order theory in which certain ... |

23 |
Property extraction m well-founded property sets
- WEGBREIT
- 1975
(Show Context)
Citation Context ...eliberately kept informal with lots of illustration. A more comprehensive technical treatment will be presented in a subsequent paper. 1.1. Related Work. In the seventies, Wegbreit and his colleagues =-=[27, 28, 10]-=-, Elpas et al [8], Manna and Katz [18] proposed writing the semantics of assignment statements in the body of a loop as recurrence equations (also called difference equations), finding an explicit exp... |

18 |
Geometry theorem proving using Hilbert's nullstellensatz
- Kapur
- 1986
(Show Context)
Citation Context ...gstuhl Seminar Proceedings 05431 Deduction and Applications http://drops.dagstuhl.de/opus/volltexte/2006/511 1s2 DEEPAK KAPUR geometry theorem proving by Wu Wen-Tsun [30, 31], Chou [1] and the author =-=[12, 13]-=-. 1 By considering every possible basic cycle arising from the execution of a given loop, the goal is to successively deduce constraints on these parameters such that for values of parameters satisfyi... |

17 |
Reasoning about Numbers in Tecton
- Kapur, Nie
- 1994
(Show Context)
Citation Context ...ntifier-elimination; Enderton’s book [9] gives one such method. Fourier-Motzkin’s algorithm for projection (elimination of vaiables) as implemented in our theorem prover Rewrite Rule Laboratory (RRL) =-=[16, 15]-=- can also be used; this is illustrated below. Without any loss of generality, it can be assumed that the formula from which a variable x has to be eliminated is a conjunction of inequalities of the fo... |

16 | D.: An abstract interpretation approach for automatic generation of polynomial invariants
- Rodríguez-Carbonell, Kapur
- 2004
(Show Context)
Citation Context |

15 |
A Refutational Approach to Geometry Theorem Proving
- Kapur
- 1988
(Show Context)
Citation Context ...gstuhl Seminar Proceedings 05431 Deduction and Applications http://drops.dagstuhl.de/opus/volltexte/2006/511 1s2 DEEPAK KAPUR geometry theorem proving by Wu Wen-Tsun [30, 31], Chou [1] and the author =-=[12, 13]-=-. 1 By considering every possible basic cycle arising from the execution of a given loop, the goal is to successively deduce constraints on these parameters such that for values of parameters satisfyi... |

11 | An approach to solving systems of parametric polynomial equations
- Kapur
(Show Context)
Citation Context ...can easily verify that the forward semantics of the assignment statement will give an equivalent result.sAUTOMATICALLY GENERATING LOOP INVARIANTS 7 be done using parametric Gröbner basis construction =-=[14]-=- (also called comprehensive Gröbner basis in [29]). Crudely speaking, the simplification is done by case analysis on the coefficients of the terms appearing in a formula, e.g, whether A = 0 or not, B ... |

8 |
Research in Interactive ProgramProving Techniques
- Elspas, Green, et al.
- 1972
(Show Context)
Citation Context ...ative programs, discovering invariants of loops automatically has been viewed as a considerable technical challenge. There have been many attempts to address this problem since the pioneering work of =-=[8, 10, 18]-=-; the success however has been limited. As a result, research in program verification has suffered considerably. Recently, there appears to be a revival of research activities relating to mechanically... |

4 |
Real Quantifier Elimination in Practice
- Doltzmann, Sturm, et al.
(Show Context)
Citation Context ...lly closed field, these decision procedures in practice work only on toy small problems, unlike other methods which work reasonably well on many interesting problems; an interested reader may consult =-=[7]-=- for more details. We have done preliminary investigations and the results are not encouraging, primarily because of the number of variabless14 DEEPAK KAPUR to be eliminated from verification conditio... |

3 |
Mathematical Logic, An Introduction
- Enderton
- 1992
(Show Context)
Citation Context ...ions. 5.1. Presburger Arithmetic. Consider the theory of Prebsurger arithmetic over the integers with ≤, =, 0, s, +. 6 It is well known that this theory admits quantifier-elimination; Enderton’s book =-=[9]-=- gives one such method. Fourier-Motzkin’s algorithm for projection (elimination of vaiables) as implemented in our theorem prover Rewrite Rule Laboratory (RRL) [16, 15] can also be used; this is illus... |

2 |
et al. http://www.cs.usna.edu/ qepcad/B/WhatisQEPCAD.html
- Hong
(Show Context)
Citation Context ...nted over the last 40 years; see [2]. Specialized implementation of decision procedures along with the ones for low degree polynomial constraints are available–software packages REDLOG [6] and QEPCAD =-=[11]-=- implemented on top of computer algebra systems REDUCE and Maple, respectively, are particularly promising. Unlike in the cases of the theory of polynomial equations and Presburger arithmetic, nothing... |

2 |
Computing Interprocedurally Valid Relations
- Müller-Olm, Seidl
- 2004
(Show Context)
Citation Context |

2 |
A Comprehensive Gröbner Basis Algorithm
- Weispfenning
- 1990
(Show Context)
Citation Context ...he assignment statement will give an equivalent result.sAUTOMATICALLY GENERATING LOOP INVARIANTS 7 be done using parametric Gröbner basis construction [14] (also called comprehensive Gröbner basis in =-=[29]-=-). Crudely speaking, the simplification is done by case analysis on the coefficients of the terms appearing in a formula, e.g, whether A = 0 or not, B = 0 or not, etc; more details can be found in [14... |

2 |
On the decision problem and the elementary geometry
- Wu
- 1978
(Show Context)
Citation Context ...y an NSF ITR award CCR-0113611. Dagstuhl Seminar Proceedings 05431 Deduction and Applications http://drops.dagstuhl.de/opus/volltexte/2006/511 1s2 DEEPAK KAPUR geometry theorem proving by Wu Wen-Tsun =-=[30, 31]-=-, Chou [1] and the author [12, 13]. 1 By considering every possible basic cycle arising from the execution of a given loop, the goal is to successively deduce constraints on these parameters such that... |