JOURNAL ARTICLE

Automatically Generating Loop Invariants Using Quantifier Elimination

Deepak Kapur

Year: 2006 Journal:   Leibniz-Zentrum für Informatik (Schloss Dagstuhl)   Publisher: Schloss Dagstuhl – Leibniz Center for Informatics

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.

Keywords:
Parameterized complexity Quantifier elimination Initialization Invariant (physics) Mathematics Parametric statistics Loop (graph theory) Heuristics Path (computing) Applied mathematics Discrete mathematics Mathematical optimization Computer science Algorithm Combinatorics Programming language

Metrics

38
Cited By
4.33
FWCI (Field Weighted Citation Impact)
0
Refs
0.94
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Formal Methods in Verification
Physical Sciences →  Computer Science →  Computational Theory and Mathematics
Logic, programming, and type systems
Physical Sciences →  Computer Science →  Artificial Intelligence
Numerical Methods and Algorithms
Physical Sciences →  Computer Science →  Computational Theory and Mathematics

Related Documents

© 2026 ScienceGate Book Chapters — All rights reserved.