Invariant Synthesis for Combined Theories

  • Dirk Beyer
  • Thomas A. Henzinger
  • Rupak Majumdar
  • Andrey Rybalchenko
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4349)


We present a constraint-based algorithm for the synthesis of invariants expressed in the combined theory of linear arithmetic and uninterpreted function symbols. Given a set of programmer-specified invariant templates, our algorithm reduces the invariant synthesis problem to a sequence of arithmetic constraint satisfaction queries. Since the combination of linear arithmetic and uninterpreted functions is a widely applied predicate domain for program verification, our algorithm provides a powerful tool to statically and automatically reason about program correctness. The algorithm can also be used for the synthesis of invariants over arrays and set data structures, because satisfiability questions for the theories of sets and arrays can be reduced to the theory of linear arithmetic with uninterpreted functions. We have implemented our algorithm and used it to find invariants for a low-level memory allocator written in C.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ball, T., Rajamani, S.K.: The Slam project: Debugging system software via static analysis. In: Proc. POPL, pp. 1–3. ACM, New York (2002)Google Scholar
  2. 2.
    Bradley, A.R., Manna, Z., Sipma, H.B.: What’s decidable about arrays? In: Emerson, E.A., Namjoshi, K.S. (eds.) VMCAI 2006. LNCS, vol. 3855, pp. 427–442. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Chang, C.C., Keisler, H.J.: Model Theory, 3rd edn. North-Holland, Amsterdam (1990)zbMATHGoogle Scholar
  4. 4.
    Collins, G.E.: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In: Automata Theory and Formal Languages, pp. 134–183. Springer, New York (1975)Google Scholar
  5. 5.
    Colón, M., Sankaranarayanan, S., Sipma, H.B.: Linear invariant generation using non-linear constraint solving. In: Hunt Jr., W.A., Somenzi, F. (eds.) CAV 2003. LNCS, vol. 2725, pp. 420–432. Springer, Heidelberg (2003)Google Scholar
  6. 6.
    Cousot, P.: Proving program invariance and termination by parametric abstraction, Lagrangian relaxation and semidefinite programming. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, Springer, Heidelberg (2005)Google Scholar
  7. 7.
    Cousot, P., Cousot, R.: Comparing the Galois connection and widening/narrowing approaches to abstract interpretation. In: Bruynooghe, M., Wirsing, M. (eds.) PLILP 1992. LNCS, vol. 631, pp. 269–295. Springer, Heidelberg (1992)CrossRefGoogle Scholar
  8. 8.
    Flanagan, C., et al.: Extended static checking for Java. In: Proc. PLDI, pp. 234–245. ACM, New York (2002)Google Scholar
  9. 9.
    Floyd, R.W.: Assigning meanings to programs. In: Mathematical Aspects of Computer Science, pp. 19–32. AMS (1967)Google Scholar
  10. 10.
    Gulwani, S., Tiwari, A.: Combining abstract interpreters. In: Proc. PLDI, pp. 376–386. ACM, New York (2006)Google Scholar
  11. 11.
    Henzinger, T.A., et al.: Lazy abstraction. In: Proc. POPL, pp. 58–70. ACM, New York (2002)Google Scholar
  12. 12.
    Holzbaur, C.: OFAI clp(q,r) Manual, Edition 1.3.3. Austrian Research Institute for Artificial Intelligence, Vienna. TR-95-09 (1995)Google Scholar
  13. 13.
    Kapur, D.: Automatically generating loop invariants using quantifier elimination. In: Proc. Deduction and Applications, vol. 05431. IBFI Schloss Dagstuhl (2006)Google Scholar
  14. 14.
    Kapur, D., Zarba, C.: A reduction approach to decision procedures. Technical Report TR-CS-2005-44, University of New Mexico (2005)Google Scholar
  15. 15.
    Laboratory, T.I.S.: SICStus Prolog User’s Manual. Swedish Institute of Computer Science, PO Box 1263 SE-164 29 Kista, Sweden. Release 3.8.7 (October 2001)Google Scholar
  16. 16.
    Manna, Z., Pnueli, A.: Temporal verification of reactive systems: Safety. Springer, Heidelberg (1995)Google Scholar
  17. 17.
    McCarthy, J.: Towards a mathematical science of computation. In: Proc. IFIP Congress, pp. 21–28. North-Holland, Amsterdam (1962)Google Scholar
  18. 18.
    Nelson, G.: Techniques for program verification. Technical Report CSL81-10, Xerox Palo Alto Research Center (1981)Google Scholar
  19. 19.
    Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Constraint-based linear-relations analysis. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 53–68. Springer, Heidelberg (2004)Google Scholar
  20. 20.
    Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Non-linear loop invariant generation using Gröbner bases. In: Proc. POPL, pp. 318–329. ACM, New York (2004)Google Scholar
  21. 21.
    Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Scalable analysis of linear systems using mathematical programming. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 25–41. Springer, Heidelberg (2005)Google Scholar
  22. 22.
    Schrijver, A.: Theory of Linear and Integer Programming. Wiley, Chichester (1986)zbMATHGoogle Scholar
  23. 23.
    Sofronie-Stokkermans, V.: Hierarchic reasoning in local theory extensions. In: Nieuwenhuis, R. (ed.) Automated Deduction – CADE-20. LNCS (LNAI), vol. 3632, pp. 219–234. Springer, Heidelberg (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Dirk Beyer
    • 1
  • Thomas A. Henzinger
    • 2
  • Rupak Majumdar
    • 3
  • Andrey Rybalchenko
    • 2
    • 4
  1. 1.Simon Fraser University, Surrey, B.C.Canada
  2. 2.EPFL, LausanneSwitzerland
  3. 3.University of California, Los AngelesUSA
  4. 4.Max-Planck-Institut für Informatik, SaarbrückenGermany

Personalised recommendations