Skip to main content

Speeding up the Constraint-Based Method in Difference Logic

  • Conference paper
  • First Online:
Theory and Applications of Satisfiability Testing – SAT 2016 (SAT 2016)

Abstract

Over the years the constraint-based method has been successfully applied to a wide range of problems in program analysis, from invariant generation to termination and non-termination proving. Quite often the semantics of the program under study as well as the properties to be generated belong to difference logic, i.e., the fragment of linear arithmetic where atoms are inequalities of the form \(u - v \le k\). However, so far constraint-based techniques have not exploited this fact: in general, Farkas’ Lemma is used to produce the constraints over template unknowns, which leads to non-linear SMT problems. Based on classical results of graph theory, in this paper we propose new encodings for generating these constraints when program semantics and templates belong to difference logic. Thanks to this approach, instead of a heavyweight non-linear arithmetic solver, a much cheaper SMT solver for difference logic or linear integer arithmetic can be employed for solving the resulting constraints. We present encouraging experimental results that show the high impact of the proposed techniques on the performance of the VeryMax verification system.

Partially supported by Spanish MINECO under grant TIN2015-69175-C4-3-R.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    Note that equalities can be considered as conjunctions of inequalities.

  2. 2.

    For \(\varphi \in \mathcal {F}(\mathcal{X})\), the formula \(\varphi ' \!\in \! \mathcal {F}(\mathcal{X}')\) is the version of \(\varphi \) using primed variables.

  3. 3.

    Here a simplified procedure for proving an assertion is described in order to highlight the key contribution of this work, that is, how to circumvent non-linearities.

  4. 4.

    When the generated invariants consisting of a single inequality do not prove the assertion, as indicated in Section 2 the procedure can be iterated by strengthening the transitions, thereby allowing the synthesis of invariant conjunctions of inequalities.

  5. 5.

    This yields a non-linear formula if templates and \(\mathcal{S}\) include general linear inequalities.

  6. 6.

    Executables, benchmarks and detailed tables with the results of all the experiments in this paper can be found at www.cs.upc.edu/~erodri/sat16.tgz.

  7. 7.

    This is the time limit used in VeryMax for this type of queries in previous works [20].

  8. 8.

    Note that this does not mean that they are unsafe.

References

  1. Colón, M.A., 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)

    Chapter  Google Scholar 

  2. Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Petri net analysis using invariant generation. In: Dershowitz, N. (ed.) Verification: Theory and Practice. LNCS, vol. 2772, pp. 682–701. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  3. Sankaranarayanan, S., Sipma, H.B., Manna, Z.: Constructing invariants for hybrid systems. Formal Methods Syst. Des. 32(1), 25–55 (2008)

    Article  MATH  Google Scholar 

  4. Beyer, D., Henzinger, T.A., Majumdar, R., Rybalchenko, A.: Invariant synthesis for combined theories. In: Cook, B., Podelski, A. (eds.) VMCAI 2007. LNCS, vol. 4349, pp. 378–394. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  5. Larraz, D., Rodríguez-Carbonell, E., Rubio, A.: SMT-based array invariant generation. In: Giacobazzi, R., Berdine, J., Mastroeni, I. (eds.) VMCAI 2013. LNCS, vol. 7737, pp. 169–188. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  6. Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 239–251. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  7. Larraz, D., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Proving termination of imperative programs using Max-SMT. In: Proceeding FMCAD 2013, pp. 218–225. IEEE (2013)

    Google Scholar 

  8. Larraz, D., Nimkar, K., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Proving non-termination using Max-SMT. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 779–796. Springer, Heidelberg (2014)

    Google Scholar 

  9. Borralleras, C., Lucas, S., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: SAT modulo linear arithmetic for solving polynomial constraints. Journal of Automated Reasoning 48(1), 107–131 (2012)

    Article  MathSciNet  MATH  Google Scholar 

  10. Jovanović, D., de Moura, L.: Solving non-linear arithmetic. In: Gramlich, B., Miller, D., Sattler, U. (eds.) IJCAR 2012. LNCS, vol. 7364, pp. 339–354. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  11. Larraz, D., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Minimal-model-guided approaches to solving polynomial constraints and extensions. In: Sinz, C., Egly, U. (eds.) SAT 2014. LNCS, vol. 8561, pp. 333–350. Springer, Heidelberg (2014)

    Google Scholar 

  12. Cousot, P., Cousot, R.: Abstract interpretation : a unified lattice model for the static analysis of programs by construction or approximation of fixpoints. In: Proceeding POPL 1977, pp. 238–252. ACM Press (1977)

    Google Scholar 

  13. Cousot, P., Halbwachs, N.: Automatic discovery of linear restraints among variables of a program. In: Proceeding POPL 1978, pp. 84–96. ACM Press (1978)

    Google Scholar 

  14. Cousot, P., Cousot, R.: Static determination of dynamic properties of programs. In: Proceeding 2nd International Symposium on Programming, pp. 106–130 (1976)

    Google Scholar 

  15. Miné, A.: A new numerical abstract domain based on difference-bound matrices. In: Danvy, O., Filinski, A. (eds.) PADO 2001. LNCS, vol. 2053, pp. 155–172. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  16. Miné, A.: The octagon abstract domain. High. Order Symbolic Comput. 19(1), 31–100 (2006)

    Article  MATH  Google Scholar 

  17. Menasche, M., Berthomieu, B.: Time petri nets for analyzing and verifying time dependent communication protocols. In: Protocol Specification, Testing, and Verification, pp. 161–172 (1983)

    Google Scholar 

  18. Dill, D.L.: Timing assumptions and verification of finite-state concurrent systems. Automatic Verification Methods for Finite State Systems. LNCS, vol. 407, pp. 197–212. Springer, Heidelberg (1989)

    Chapter  Google Scholar 

  19. Yovine, S.: Model checking timed automata. In: Lectures on Embedded Systems, European Educational Forum, School on Embedded Systems. vol. 1494. LNCS, pp. 114–152. Springer, Heidelberg (1996)

    Google Scholar 

  20. Brockschmidt, M., Larraz, D., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: Compositional safety verification with Max-SMT. In: Proceeding FMCAD 2015, pp. 33–40. IEEE (2015)

    Google Scholar 

  21. Kapur, D., Zhang, Z., Horbach, M., Zhao, H., Lu, Q., Nguyen, T.V.: Geometric quantifier elimination heuristics for automatically generating octagonal and max-plus invariants. In: Bonacina, M.P., Stickel, M.E. (eds.) Automated Reasoning and Mathematics. LNCS, vol. 7788, pp. 189–228. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  22. Monniaux, D.: Automatic modular abstractions for linear constraints. In: Proceeding POPL 2009, pp. 140–151. ACM (2009)

    Google Scholar 

  23. 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)

    Chapter  Google Scholar 

  24. Monniaux, D.: A quantifier elimination algorithm for linear real arithmetic. In: Cervesato, I., Veith, H., Voronkov, A. (eds.) LPAR 2008. LNCS (LNAI), vol. 5330, pp. 243–257. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  25. Schrijver, A.: Theory of Linear and Integer Programming. Wiley, Amsterdam (1998)

    MATH  Google Scholar 

  26. Dechter, R., Meiri, I., Pearl, J.: Temporal constraint networks. Artif. Intell. 49(1–3), 61–95 (1991)

    Article  MathSciNet  MATH  Google Scholar 

  27. Cormen, T.H., Stein, C., Rivest, R.L., Leiserson, C.E.: Introduction to Algorithms, 2nd edn. McGraw-Hill Higher Education, New York (2001)

    MATH  Google Scholar 

  28. Frisch, A.M., Peugniez, T.J., Doggett, A.J., Nightingale, P.W.: Solving non-boolean satisfiability problems with stochastic local search: a comparison of encodings. J. Autom. Reasoning 35(1–3), 143–179 (2005)

    MathSciNet  MATH  Google Scholar 

  29. Argelich, J., Manyà, F.: Solving over-constrained problems with SAT technology. In: Bacchus, F., Walsh, T. (eds.) SAT 2005. LNCS, vol. 3569, pp. 1–15. Springer, Heidelberg (2005)

    Chapter  Google Scholar 

  30. Press, W.H., Teukolsky, S.A., Vetterling, W.T., Flannery, B.P.: Numerical Recipes: The Art of Scientific Computing. Cambridge Univ. Press, NewYork (1989)

    MATH  Google Scholar 

  31. Marques-Silva, J., Argelich, J., Graça, A., Lynce, I.: Boolean lexicographic optimization: algorithms & applications. Ann. Math. Artif. Intell. 62(3–4), 317–343 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  32. Sebastiani, R., Trentin, P.: OptiMathSAT: a tool for optimization modulo theories. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 447–454. Springer, Heidelberg (2015)

    Chapter  Google Scholar 

  33. Bjørner, N., Phan, A.-D., Fleckenstein, L.: \({\nu }z\) - an optimizing SMT solver. In: Baier, C., Tinelli, C. (eds.) TACAS 2015. LNCS, vol. 9035, pp. 194–199. Springer, Heidelberg (2015)

    Google Scholar 

  34. Bofill, M., Nieuwenhuis, R., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A.: The Barcelogic SMT solver. In: Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 294–298. Springer, Heidelberg (2008)

    Chapter  Google Scholar 

  35. Nieuwenhuis, R., Oliveras, A.: On SAT modulo theories and optimization problems. In: Biere, A., Gomes, C.P. (eds.) SAT 2006. LNCS, vol. 4121, pp. 156–169. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Enric Rodríguez-Carbonell .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2016 Springer International Publishing Switzerland

About this paper

Cite this paper

Candeago, L., Larraz, D., Oliveras, A., Rodríguez-Carbonell, E., Rubio, A. (2016). Speeding up the Constraint-Based Method in Difference Logic. In: Creignou, N., Le Berre, D. (eds) Theory and Applications of Satisfiability Testing – SAT 2016. SAT 2016. Lecture Notes in Computer Science(), vol 9710. Springer, Cham. https://doi.org/10.1007/978-3-319-40970-2_18

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-40970-2_18

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-40969-6

  • Online ISBN: 978-3-319-40970-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics