On invariant checking

Checking whether a given formula is an invariant at a given program location (especially, inside a loop) can be quite nontrivial even for simple loop programs, given that it is in general an undecidable property. This is especially the case if the given formula is not an inductive loop invariant, as most automated techniques can only check or generate inductive loop invariants. In this paper, conditions are identified on simple loops and formulas when this check can be performed automatically. A general theorem is proved which gives a necessary and sufficient condition for a formula to be an invariant under certain restrictions on a loop. As a byproduct of this analysis, a new kind of loop invariant inside the loop body, called inside-loop invariant, is proposed. Such an invariant is more general than an inductive loop invariant typically used in the Floyd-Hoare axiomatic approach to program verification. The use of such invariants for program debugging is explored; it is shown that such invariants can be more useful than traditional inductive loop invariants especially when one is interested in checking extreme/side conditions such as underflow, accessing array/collection data structures outside the range, divide by zero, etc.

[1]  Yinghua Chen,et al.  Generating Polynomial Invariants with DISCOVERER and QEPCAD , 2007, Formal Methods and Hybrid Real-Time Systems.

[2]  Bican Xia,et al.  Program Verification by Reduction to Semi-algebraic Systems Solving , 2008, ISoLA.

[3]  Bican Xia,et al.  Symbolic decision procedure for termination of linear programs , 2009, Formal Aspects of Computing.

[4]  Deepak Kapur,et al.  A Quantifier-Elimination Based Heuristic for Automatically Generating Inductive Assertions for Programs , 2006, J. Syst. Sci. Complex..

[5]  Jacques Loeckx,et al.  The Foundations of Program Verification , 1987 .

[6]  Andreas Podelski,et al.  A Complete Method for the Synthesis of Linear Ranking Functions , 2004, VMCAI.

[7]  C. A. R. Hoare,et al.  An axiomatic basis for computer programming , 1969, CACM.

[8]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

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

[10]  Zohar Manna,et al.  Verification Constraint Problems with Strengthening , 2006, ICTAC.

[11]  Stephen McCamant,et al.  The Daikon system for dynamic detection of likely invariants , 2007, Sci. Comput. Program..

[12]  A. Miné Weakly Relational Numerical Abstract Domains , 2004 .

[13]  C. A. R. HOARE,et al.  An axiomatic basis for computer programming , 1969, CACM.

[14]  Enric Rodríguez-Carbonell,et al.  Generating all polynomial invariants in simple loops , 2007, J. Symb. Comput..

[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]  Chaochen Zhou,et al.  Discovering Non-linear Ranking Functions by Solving Semi-algebraic Systems , 2007, ICTAC.

[17]  Patrick Cousot,et al.  Proving Program Invariance and Termination by Parametric Abstraction, Lagrangian Relaxation and Semidefinite Programming , 2005, VMCAI.

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

[19]  Henny B. Sipma,et al.  Linear Invariant Generation Using Non-linear Constraint Solving , 2003, CAV.

[20]  Zohar Manna,et al.  Property-directed incremental invariant generation , 2008, Formal Aspects of Computing.

[21]  Zhenbing Zeng,et al.  Termination of a Class of the Program with Polynomial Guards , 2009, 2009 International Conference on Information Management and Engineering.

[22]  Christopher W. Brown QEPCAD B: a program for computing with semi-algebraic sets using CADs , 2003, SIGS.

[23]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[24]  Ashish Tiwari,et al.  Termination of Linear Programs , 2004, CAV.