Advertisement

Journal of Automated Reasoning

, Volume 58, Issue 3, pp 341–362 | Cite as

A Decision Procedure for (Co)datatypes in SMT Solvers

  • Andrew Reynolds
  • Jasmin Christian Blanchette
Article

Abstract

We present a decision procedure that combines reasoning about datatypes and codatatypes. The dual of the acyclicity rule for datatypes is a uniqueness rule that identifies observationally equal codatatype values, including cyclic values. The procedure decides universal problems and is composable via the Nelson–Oppen method. It has been implemented in CVC4, a state-of-the-art SMT solver. An evaluation based on problems generated from formalizations developed with Isabelle demonstrates the potential of the procedure.

Keywords

(Co)inductive datatypes Automatic theorem provers SMT solvers Decision procedures 

Notes

Acknowledgments

We owe a great debt to the development team of CVC4, including Clark Barrett and Cesare Tinelli, and in particular Morgan Deters, who jointly with the first author developed the initial version of the theory solver for datatypes in CVC4. Our present and former bosses, Viktor Kuncak, Stephan Merz, Tobias Nipkow, Cesare Tinelli, and Christoph Weidenbach, have either encouraged the research on codatatypes or at least benevolently tolerated it, both of which we are thankful for. Peter Gammie and Andreas Lochbihler pointed us to useful benchmarks. Andrei Popescu helped clarify our thoughts regarding codatatypes and indicated related work. Dmitriy Traytel took part in discussions about degenerate codatatypes. Pascal Fontaine, Andreas Lochbihler, Andrei Popescu, Christophe Ringeissen, Mark Summerfield, Dmitriy Traytel, and the anonymous reviewers suggested many textual improvements. The second author’s work was partially supported by the Deutsche Forschungsgemeinschaft project “Den Hammer härten” (Grant NI 491/14-1) and the Inria technological development action “Contre-exemples utilisables par Isabelle et Coq” (CUIC).

References

  1. 1.
    Barrett, C., Conway, C.L., Deters, M., Hadarean, L., Jovanović, D., King, T., Reynolds, A., Tinelli, C.: CVC4. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV ’11, LNCS, vol. 6806, pp. 171–177. Springer (2011)Google Scholar
  2. 2.
    Barrett, C., Fontaine, P., Tinelli, C.: The SMT-LIB standard: version 2.5. Technical report, University of Iowa (2015). http://smt-lib.org/
  3. 3.
    Barrett, C., Shikanian, I., Tinelli, C.: An abstract decision procedure for satisfiability in the theory of inductive data types. J. Satisf. Boolean Model. Comput. 3, 21–46 (2007)MathSciNetzbMATHGoogle Scholar
  4. 4.
    Bjørner, N.S.: Integrating decision procedures for temporal verification. Ph.D. thesis, Stanford University (1998)Google Scholar
  5. 5.
    Blanchette, J.C., Böhme, S., Paulson, L.C.: Extending Sledgehammer with SMT solvers. J. Autom. Reason. 51(1), 109–128 (2013)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Blanchette, J.C., Hölzl, J., Lochbihler, A., Panny, L., Popescu, A., Traytel, D.: Truly modular (co)datatypes for Isabelle/HOL. In: Klein, G., Gamboa, R. (eds.) ITP 2014, LNCS, vol. 8558, pp. 93–110. Springer (2014)Google Scholar
  7. 7.
    Blanchette, J.C., Nipkow, T.: Nitpick: a counterexample generator for higher-order logic based on a relational model finder. In: Kaufmann, M., Paulson, L.C. (eds.) ITP 2010, LNCS, vol. 6172, pp. 131–146. Springer (2010)Google Scholar
  8. 8.
    Blanchette, J.C., Paskevich, A.: TFF1: the TPTP typed first-order form with rank-1 polymorphism. In: Bonacina, M.P. (ed.) CADE-24, LNCS, vol. 7898, pp. 414–420. Springer (2013)Google Scholar
  9. 9.
    Blanchette, J.C., Popescu, A., Traytel, D.: Witnessing (co)datatypes. In: Vitek, J. (ed.) ESOP 2015, LNCS, vol. 9032, pp. 359–382. Springer (2015)Google Scholar
  10. 10.
    Carayol, A., Morvan, C.: On rational trees. In: Ésik, Z. (ed.) CSL 2006, LNCS, vol. 4207, pp. 225–239. Springer (2006)Google Scholar
  11. 11.
    Cruanes, S.: Extending superposition with integer arithmetic, structural induction, and beyond. Ph.D. thesis, École polytechnique (2015). https://who.rocq.inria.fr/Simon.Cruanes/files/thesis
  12. 12.
    de Moura, L., Bjørner, N.: Efficient E-matching for SMT solvers. In: Pfenning, F. (ed.) CADE-21, LNCS, vol. 4603, pp. 183–198. Springer (2007)Google Scholar
  13. 13.
    de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008, LNCS, vol. 4963, pp. 337–340. Springer (2008)Google Scholar
  14. 14.
    Djelloul, K., Dao, T., Frühwirth, T.W.: Theory of finite or infinite trees revisited. Theory Pract. Logic Program. 8(4), 431–489 (2008)MathSciNetCrossRefzbMATHGoogle Scholar
  15. 15.
    Endrullis, J., Grabmayer, C., Klop, J.W., van Oostrom, V.: On equal \(\mu \)-terms. Theor. Comput. Sci. 412(28), 3175–3202 (2011)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Gammie, P., Lochbihler, A.: The Stern–Brocot tree. Archive of Formal Proofs (2016). http://afp.sf.net/entries/Stern_Brocot.shtml, Formal proof development
  17. 17.
    Ganzinger, H., Hagen, G., Nieuwenhuis, R., Oliveras, A., Tinelli, C.: DPLL(\(T\)): fast decision procedures. In: Alur, R., Peled, D. (eds.) CAV ’04, LNCS, vol. 3114, pp. 175–188. Springer (2004)Google Scholar
  18. 18.
    Ge, Y., de Moura, L.: Complete instantiation for quantified formulas in satisfiability modulo theories. In: CAV ’09, LNCS, vol. 5643, pp. 306–320. Springer (2009)Google Scholar
  19. 19.
    Gunter, E.L.: Why we can’t have SML-style datatype declarations in HOL. In: Claesen, L.J.M., Gordon, M.J.C. (eds.) TPHOLs ’92, IFIP Transactions, vol. A-20, pp. 561–568. North-Holland/Elsevier (1993)Google Scholar
  20. 20.
    Hopcroft, J.: An \(n \log n\) algorithm for minimizing states in a finite automaton. In: Kohavi, Z., Paz, A. (eds.) Theory of Machines and Computations, pp. 189–196. Academic Press, London (1971)CrossRefGoogle Scholar
  21. 21.
    Jovanović, D., Barrett, C.: Sharing is caring: combination of theories. In: Tinelli, C., Sofronie-Stokkermans, V. (eds.) FroCoS 2011, LNCS, vol. 6989, pp. 195–210. Springer (2011)Google Scholar
  22. 22.
    Kersani, A., Peltier, N.: Combining superposition and induction: a practical realization. In: Fontaine, P., Ringeissen, C., Schmidt, R.A. (eds.) FroCoS 2013, LNCS, vol. 8152, pp. 7–22. Springer (2013)Google Scholar
  23. 23.
    Klein, G., Nipkow, T., Paulson, L. (eds.): Archive of Formal Proofs. http://afp.sf.net/
  24. 24.
    Kozen, D.: Results on the propositional \(\mu \)-calculus. Theor. Comput. Sci. 27, 333–354 (1983)MathSciNetCrossRefzbMATHGoogle Scholar
  25. 25.
    Leino, K.R.M., Moskal, M.: Co-induction simply—automatic co-inductive proofs in a program verifier. In: Jones, C.B., Pihlajasaari, P., Sun, J. (eds.) FM 2014, LNCS, vol. 8442, pp. 382–398. Springer (2014)Google Scholar
  26. 26.
    Leroy, X.: A formally verified compiler back-end. J. Autom. Reason. 43(4), 363–446 (2009)MathSciNetCrossRefzbMATHGoogle Scholar
  27. 27.
    Lochbihler, A.: Verifying a compiler for Java threads. In: Gordon, A.D. (ed.) ESOP 2010, LNCS, vol. 6012, pp. 427–447. Springer (2010)Google Scholar
  28. 28.
    Lochbihler, A.: Making the Java memory model safe. ACM Trans. Program. Lang. Syst. 35(4), 12:1–65 (2014)Google Scholar
  29. 29.
    Nelson, G., Oppen, D.C.: Simplification by cooperating decision procedures. ACM Trans. Program. Lang. Syst. 1(2), 245–257 (1979)CrossRefzbMATHGoogle Scholar
  30. 30.
    Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL: a proof assistant for higher-order logic, LNCS, vol. 2283. Springer (2002)Google Scholar
  31. 31.
    Pham, T., Whalen, M.W.: RADA: a tool for reasoning about algebraic data types with abstractions. In: Meyer, B., Baresi, L., Mezini, M. (eds.) ESEC/FSE ’13, pp. 611–614. ACM (2013)Google Scholar
  32. 32.
    Reynolds, A., Blanchette, J.C.: A decision procedure for (co)datatypes in SMT solvers. In: Felty, A., Middeldorp, A. (eds.) CADE-25, LNCS, vol. 9195, pp. 197–213. Springer (2015)Google Scholar
  33. 33.
    Reynolds, A., Blanchette, J.C., Tinelli, C.: Model finding for recursive functions in SMT. In: Ganesh, V., Jovanović, D. (eds.) SMT 2015 (2015)Google Scholar
  34. 34.
    Reynolds, A., Kuncak, V.: Induction for SMT solvers. In: D’Souza, D., Lal, A., Larsen, K.G. (eds.) VMCAI 2015, LNCS, vol. 8931, pp. 80–98. Springer (2014)Google Scholar
  35. 35.
    Reynolds, A., Tinelli, C., Goel, A., Krstić, S., Deters, M., Barrett, C.: Quantifier instantiation techniques for finite model finding in SMT. In: Bonacina, M.P. (ed.) CADE-24, LNCS, vol. 7898, pp. 377–391. Springer (2013)Google Scholar
  36. 36.
    Reynolds, A., Tinelli, C., de Moura, L.: Finding conflicting instances of quantified formulas in SMT. In: FMCAD 2014, pp. 195–202. IEEE (2014)Google Scholar
  37. 37.
    Rutten, J.J.M.M.: Universal coalgebra—a theory of systems. Theor. Comput. Sci. 249, 3–80 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  38. 38.
    Stump, A., Sutcliffe, G., Tinelli, C.: StarExec: a cross-community infrastructure for logic solving. In: Demri, S., Kapur, D., Weidenbach, C. (eds.) IJCAR 2014, LNCS, vol. 8562, pp. 367–373. Springer (2014)Google Scholar
  39. 39.
    Suter, P., Köksal, A.S., Kuncak, V.: Satisfiability modulo recursive programs. In: Yahav, E. (ed.) SAS 2011, LNCS, vol. 6887, pp. 298–315. Springer (2011)Google Scholar
  40. 40.
    Tinelli, C., Zarba, C.G.: Combining nonstably infinite theories. J. Autom. Reason. 34(3), 209–238 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  41. 41.
    Wand, D.: Polymorphic+typeclass superposition. In: de Moura, L., Konev, B., Schulz, S. (eds.) PAAR 2014 (2014)Google Scholar
  42. 42.
    Weber, T.: SAT-based finite model generation for higher-order logic. Ph.D. thesis, Technische Universität München (2008). http://mediatum.ub.tum.de/doc/676608/file

Copyright information

© Springer Science+Business Media Dordrecht 2016

Authors and Affiliations

  • Andrew Reynolds
    • 1
  • Jasmin Christian Blanchette
    • 2
    • 3
  1. 1.École Polytechnique Fédérale de Lausanne (EPFL)LausanneSwitzerland
  2. 2.Inria & LORIANancyFrance
  3. 3.Max-Planck-Institut für InformatikSaarbrückenGermany

Personalised recommendations