Assertion Checking over Combined Abstraction of Linear Arithmetic and Uninterpreted Functions

  • Sumit Gulwani
  • Ashish Tiwari
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3924)

Abstract

This paper presents results on the problem of checking equality assertions in programs whose expressions have been abstracted using combination of linear arithmetic and uninterpreted functions, and whose conditionals are treated as non-deterministic.

We first show that the problem of assertion checking for this combined abstraction is coNP-hard, even for loop-free programs. This result is quite surprising since assertion checking for the individual abstractions of linear arithmetic and uninterpreted functions can be performed efficiently in polynomial time.

Next, we give an assertion checking algorithm for this combined abstraction, thereby proving decidability of this problem despite the underlying lattice having infinite height. Our algorithm is based on an important connection between unification theory and program analysis. Specifically, we show that weakest preconditions can be strengthened by replacing equalities by their unifiers, without losing any precision, during backward analysis of programs.

References

  1. 1.
    Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: 15th Annual ACM Symposium on POPL, pp. 1–11 (1988)Google Scholar
  2. 2.
    Baader, F., Schulz, K.: Unification in the union of disjoint equational theories: Combining decision procedures. In: Kapur, D. (ed.) CADE 1992. LNCS (LNAI), vol. 607, pp. 50–65. Springer, Heidelberg (1992)Google Scholar
  3. 3.
    Baader, F., Snyder, W.: Unification theory. In: Handbook of Automated Reasoning, ch. 8, vol. I, pp. 445–532. Elsevier Science, Amsterdam (2001)CrossRefGoogle Scholar
  4. 4.
    Bachmair, L., Tiwari, A., Vigneron, L.: Abstract congruence closure. J. of Automated Reasoning 31(2), 129–168 (2003)MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Barrett, C.W., Dill, D.L., Levitt, J.R.: Validity checking for combinations of theories with equality. In: Srivas, M., Camilleri, A. (eds.) FMCAD 1996. LNCS, vol. 1166, pp. 187–201. Springer, Heidelberg (1996)CrossRefGoogle Scholar
  6. 6.
    Cousot, P., Cousot, R.: Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In: 4th Annual ACM Symposium on POPL, pp. 234–252 (1977)Google Scholar
  7. 7.
    Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: 5th ACM Symposium on POPL, pp. 84–96 (1978)Google Scholar
  8. 8.
    Gulwani, S., Necula, G.C.: Discovering affine equalities using random interpretation. In: 30th Annual ACM Symposium on POPL (January 2003)Google Scholar
  9. 9.
    Gulwani, S., Necula, G.C.: Global value numbering using random interpretation. In: 31st Annual ACM Symposium on POPL (January 2004)Google Scholar
  10. 10.
    Gulwani, S., Necula, G.C.: A polynomial-time algorithm for global value numbering. In: Giacobazzi, R. (ed.) SAS 2004. LNCS, vol. 3148, pp. 212–227. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  11. 11.
    Gulwani, S., Necula, G.C.: Precise interprocedural analysis using random interpretation. In: 32nd Annual ACM Symposium on POPL (January 2005)Google Scholar
  12. 12.
    Gulwani, S., Tiwari, A.: Combining abstract interpreters. Submitted for publication (November 2005)Google Scholar
  13. 13.
    Gulwani, S., Tiwari, A.: Assertion checking over combined abstraction of linear arithmetic and uninterpreted functions. Technical Report MSR-TR-2006-01, Microsoft Research (January 2006)Google Scholar
  14. 14.
    Karr, M.: Affine relationships among variables of a program. In: Acta Informatica, pp. 133–151. Springer, Heidelberg (1976)Google Scholar
  15. 15.
    Kildall, G.A.: A unified approach to global program optimization. In: 1st ACM Symposium on POPL, pp. 194–206 (October 1973)Google Scholar
  16. 16.
    Müller-Olm, M., Rüthing, O., Seidl, H.: Checking herbrand equalities and beyond. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 79–96. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  17. 17.
    Müller-Olm, M., Seidl, H.: A note on Karr’s algorithm. In: 31st International Colloquium on Automata, Languages and Programming, pp. 1016–1028 (2004)Google Scholar
  18. 18.
    Müller-Olm, M., Seidl, H.: Precise interprocedural analysis through linear algebra. In: 31st ACM Symposium on POPL, pp. 330–341 (January 2004)Google Scholar
  19. 19.
    Müller-Olm, M., Seidl, H.: Analysis of modular arithmetic. In: European Symposium on Programming, pp. 46–60 (2005)Google Scholar
  20. 20.
    Nelson, G., Oppen, D.: Simplification by cooperating decision procedures. ACM Transactions on Programming Languages and Systems 1(2), 245–257 (1979)CrossRefMATHGoogle Scholar
  21. 21.
    Schmidt-Schauss, M.: Unification in a combination of arbitrary disjoint equational theories. J. Symbolic Computation 8(1-2), 51–99 (1989)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Sumit Gulwani
    • 1
  • Ashish Tiwari
    • 2
  1. 1.Microsoft ResearchRedmondUSA
  2. 2.SRI InternationalMenlo ParkUSA

Personalised recommendations