Affine Invariant Generation via Matrix Algebra
Résumé
Loop invariant generation, which automates the generation of
assertions that always hold inside loops, has many important applications
such as safety analysis, reachability analysis and complexity-bound analysis.
However, automated invariant generation for arbitrary loops is an undecidable
problem. In this paper, we target at an important category of loops, namely
affine loops, which widely exist in many programs but still lack general
approach to invariant generation. We, however, provide a sound and complete
approach based on matrix algebra to automatically synthesizing inductive
invariants in the form of an affine inequality. Specifically, for the situation
when the loop guard is tautological (i.e., ‘true’), we show that the eigenvalues
and their eigenvectors generate all meaningful affine inductive invariants.
Moreover, when the loop guard consists of one or more affine inequalities, we
solve the invariant generation problem by (i) first establishing through matrix
inverse the relationship between the invariants and a key parameter in the
application of Farkas’ Lemma, then (ii) solving the feasible domain of the key
parameter, and finally (iii) showing that the key parameter can be addressed
by a finite set of values w.r.t a tightness condition on the constraints for the
invariants. Experimental results using existing and new cases show that our
approach can generate affine invariants over linear dynamic systems that
inherently involve the non-trivial choices (e.g., eigenvalues, boundary points
of the feasible domain, etc.) of the key parameter.
Domaines
Informatique [cs]Origine | Fichiers produits par l'(les) auteur(s) |
---|