An Abstract Interpretation Approach for Automatic Generation of Polynomial Invariants
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.
Unable to display preview. Download preview PDF.
- 5.Cousot, P., Cousot, R.: Abstract Interpretation: a Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In: Conference Record of the Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 238–252 (1977)Google Scholar
- 6.Cousot, P., Halbwachs, N.: Automatic Discovery of Linear Restraints among Variables of a Program. In: Conference Record of the Fifth Annual ACM SIGPLANSIGACT Symposium on Principles of Programming Languages, pp. 84–97 (1978)Google Scholar
- 7.Cox, D., Little, J., O’Shea, D.: Ideals, Varieties and Algorithms. An Introduction to Computational Algebraic Geometry and Commutative Algebra. Springer, Heidelberg (1998)Google Scholar
- 9.Dershowitz, N., Manna, Z.: Inference rules for program annotation. In: Proceedings of the 3rd International Conference on Software Engineering, pp. 158–167 (1978)Google Scholar
- 11.Freire, P.: http://www.pedrofreire.com/crea2_en.htm?
- 12.Grayson, D.R., Stillman, M.E.: Macaulay 2, a Software System for Research in Algebraic Geometry, Available at http://www.math.uiuc.edu/Macaulay2/
- 13.Kaldewaij, A.: Programming. The Derivation of Algorithms. Prentice-Hall, Englewood Cliffs (1990)Google Scholar
- 15.Kapur, D., Narendran, P.: An equational approach to theorem proving in firstorder predicate calculus. In: Proceedings of the Ninth International Joint Conference on Artificial Intelligence (IJCAI 1985), August 1985, pp. 1146–1153 (1985)Google Scholar
- 18.Müller-Olm, M., Seidl, H.: Computing Interprocedurally Valid Relations in Affine Programs. In: ACM SIGPLAN Principles of Programming Languages (POPL 2004), pp. 330–341 (2004)Google Scholar
- 19.Rodríguez-Carbonell, E., Kapur, D.: An Abstract Interpretation Approach for Automatic Generation of Polynomial Invariants (extended version), http://www.lsi.upc.es/~erodri
- 20.Rodríguez-Carbonell, E., Kapur, D.: Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations. To appear in International Symposium on Symbolic and Algebraic Computation 2004, ISSAC 2004 (2004), www.lsi.upc.es/~erodri
- 21.Rodríguez-Carbonell, E., Kapur, D.: Program Verification Using Automatic Generation of Polynomial Invariants, http://www.lsi.upc.es/~erodri
- 22.Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Non-linear Loop Invariant Generation Using Gröbner Bases. In: ACM SIGPLAN Principles of Programming Languages (POPL 2004), pp. 318–329 (2004)Google Scholar