Solving Sparse Linear Constraints

  • Shuvendu K. Lahiri
  • Madanlal Musuvathi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4130)


Linear arithmetic decision procedures form an important part of theorem provers for program verification. In most verification benchmarks, the linear arithmetic constraints are dominated by simple difference constraints of the form xy + c. Sparse linear arithmetic (SLA) denotes a set of linear arithmetic constraints with a very few non-difference constraints. In this paper, we propose an efficient decision procedure for SLA constraints, by combining a solver for difference constraints with a solver for general linear constraints. For SLA constraints, the space and time complexity of the resulting algorithm is dominated solely by the complexity for solving the difference constraints. The decision procedure generates models for satisfiable formulas. We show how this combination can be extended to generate implied equalities. We instantiate this framework with an equality generating Simplex as the linear arithmetic solver, and present preliminary experimental evaluation of our implementation on a set of linear arithmetic benchmarks.


Space Complexity Linear Constraint Decision Procedure Theorem Prover Satisfying Assignment 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Ball, T., Lahiri, S.K., Musuvathi, M.: Zap: Automated theorem proving for software analysis. In: Sutcliffe, G., Voronkov, A. (eds.) LPAR 2005. LNCS (LNAI), vol. 3835, pp. 2–22. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  2. 2.
    Barrett, C.W., Dill, D.L., Stump, A.: Checking satisfiability of first-order formulas by incremental translation to SAT. In: Brinksma, E., Larsen, K.G. (eds.) CAV 2002. LNCS, vol. 2404, pp. 236–249. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Bellman, R.: On a routing problem. Quarterly of Applied Mathematics 16(1), 87–90 (1958)MATHMathSciNetGoogle Scholar
  4. 4.
    Cherkassky, B.V., Goldberg, A.V.: Negative-cycle detection algorithms. In: European Symposium on Algorithms, pp. 349–363 (1996)Google Scholar
  5. 5.
    Cormen, T.H., Leiserson, C.E., Rivest, R.L.: Introduction to Algorithms. MIT Press, Cambridge (1990)MATHGoogle Scholar
  6. 6.
    Dantzig, G.: Linear programming and extensions. Princeton University Press, Princeton (1963)MATHGoogle Scholar
  7. 7.
    Detlefs, D.L., Nelson, G., Saxe, J.B.: Simplify: A theorem prover for program checking. Technical report, HPL-2003-148 (2003)Google Scholar
  8. 8.
    Flanagan, C., Joshi, R., Ou, X., Saxe, J.: Theorem proving using lazy proof explication. In: Hunt Jr., W.A., Somenzi, F. (eds.) CAV 2003. LNCS, vol. 2725, pp. 355–367. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  9. 9.
    Ford Jr., L.R., Fulkerson, D.R.: Flows in Networks (1962)Google Scholar
  10. 10.
    Harvey, W., Stuckey, P.J.: A unit two variable per inequality integer constraint solver for constraint logic programming. In: Proceedings of the 20th Australasian Computer Science Conference (ACSC 1997), pp. 102–111 (1997)Google Scholar
  11. 11.
    ILOG CPLEX, Available at
  12. 12.
    Jaffar, J., Maher, M.J., Stuckey, P.J., Yap, H.C.: Beyond finite domains. In: Borning, A. (ed.) PPCP 1994. LNCS, vol. 874, pp. 86–94. Springer, Heidelberg (1994)Google Scholar
  13. 13.
    Karmarkar, N.: A new polynomial-time algorithm for linear programming. Combinatorica 4(4), 373–396 (1984)MATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Lahiri, S.K., Musuvathi, M.: An efficient decision procedure for UTVPI constraints. In: Gramlich, B. (ed.) FroCos 2005. LNCS (LNAI), vol. 3717, pp. 168–183. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  15. 15.
    Lahiri, S.K., Musuvathi, M.: An Efficient Nelson-Oppen Decision Procedure for Difference Constraints over Rationals. In: Workshop on Pragmatics of Decision Procedures in Automated Reasoning (PDPAR 2005). ENTCS, vol. 144, pp. 27–41 (2005)Google Scholar
  16. 16.
    Lahiri, S.K., Musuvathi, M.: Solving sparse linear constraints. Technical Report MSR-TR-2006-47, Microsoft Research (2006)Google Scholar
  17. 17.
  18. 18.
    Necula, G.C., Lee, P.: Proof generation in the touchstone theorem prover. In: McAllester, D. (ed.) CADE 2000. LNCS, vol. 1831, pp. 25–44. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  19. 19.
    Nelson, G., Oppen, D.C.: Simplification by cooperating decision procedures. ACM Transactions on Programming Languages and Systems (TOPLAS) 2(1), 245–257 (1979)CrossRefGoogle Scholar
  20. 20.
    Papadimitriou, C.H.: On the complexity of integer programming. J. ACM 28(4), 765–768 (1981)MATHCrossRefMathSciNetGoogle Scholar
  21. 21.
    Pratt, V.: Two easy theories whose combination is hard. Technical report, Massachusetts Institute of Technology, Cambridge, Mass (September 1977)Google Scholar
  22. 22.
    Rueß, H., Shankar, N.: Solving linear arithmetic constraints. Technical Report CSL-SRI-04-01, SRI International (January 2004)Google Scholar
  23. 23.
    Schrijver, A.: Theory of Linear and Integer Programming. Wiley, Chichester (1986)MATHGoogle Scholar
  24. 24.
    Seshia, S.A., Bryant, R.E.: Deciding quantifier-free Presburger formulas using parameterized solution bounds. In: LICS 2004: Logic in Computer Science, pp. 100–109 (July 2004)Google Scholar
  25. 25.
    Sheini, H.M., Sakallah, K.A.: A scalable method for solving satisfiability of integer linear arithmetic logic. In: Bacchus, F., Walsh, T. (eds.) SAT 2005. LNCS, vol. 3569, pp. 241–256. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  26. 26.
    SMT-LIB: The Satisfiability Modulo Theories Library, available at

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Shuvendu K. Lahiri
    • 1
  • Madanlal Musuvathi
    • 1
  1. 1.Microsoft Research 

Personalised recommendations