MathCheck: A Math Assistant via a Combination of Computer Algebra Systems and SAT Solvers

  • Edward Zulkoski
  • Vijay Ganesh
  • Krzysztof Czarnecki
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9195)


We present a method and an associated system, called MathCheck, that embeds the functionality of a computer algebra system (CAS) within the inner loop of a conflict-driven clause-learning SAT solver. SAT+CAS systems, a la MathCheck, can be used as an assistant by mathematicians to either counterexample or finitely verify open universal conjectures on any mathematical topic (e.g., graph and number theory, algebra, geometry, etc.) supported by the underlying CAS system. Such a SAT+CAS system combines the efficient search routines of modern SAT solvers, with the expressive power of CAS, thus complementing both. The key insight behind the power of the SAT+CAS combination is that the CAS system can help cut down the search-space of the SAT solver, by providing learned clauses that encode theory-specific lemmas, as it searches for a counterexample to the input conjecture (just like the T in DPLL(T)). In addition, the combination enables a more efficient encoding of problems than a pure Boolean representation.

In this paper, we leverage the graph-theoretic capabilities of an open-source CAS, called SAGE. As case studies, we look at two long-standing open mathematical conjectures from graph theory regarding properties of hypercubes: the first conjecture states that any matching of any d-dimensional hypercube can be extended to a Hamiltonian cycle; and the second states that given an edge-antipodal coloring of a hypercube, there always exists a monochromatic path between two antipodal vertices. Previous results have shown the conjectures true up to certain low-dimensional hypercubes, and attempts to extend them have failed until now. Using our SAT+CAS system, MathCheck, we extend these two conjectures to higher-dimensional hypercubes. We provide detailed performance analysis and show an exponential reduction in search space via the SAT+CAS combination relative to finite brute-force search.


  1. 1.
    Audemard, G., Simon, L.: Predicting learnt clauses quality in modern SAT solvers. IJCAI 9, 399–404 (2009)Google Scholar
  2. 2.
    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 2011. LNCS, vol. 6806, pp. 171–177. Springer, Heidelberg (2011) CrossRefGoogle Scholar
  3. 3.
    Biere, A., Heule, M.J.H., van Maaren, H., Walsh, T.(eds.): Handbook of Satisfiability. FAIA, vol. 185. IOS Press (February 2009)Google Scholar
  4. 4.
    Bouton, T., de Oliveira, D.C.B., Déharbe, D., Fontaine, P.: veriT: an open, trustable and efficient SMT-solver. In: CADE (2009)Google Scholar
  5. 5.
    Chen, Y-C., Li, K-L.: Matchings extend to perfect matchings on hypercube networks. In: IMECS, vol. 1. Citeseer (2010)Google Scholar
  6. 6.
    de Moura, L., Bjørner, N.S.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008) CrossRefGoogle Scholar
  7. 7.
    Devos, M., Norine, S.: Edge-antipodal Colorings of Cubes.
  8. 8.
    Dooms, G., Deville, Y., Dupont, P.E.: CP(Graph): introducing a graph computation domain in constraint programming. In: van Beek, P. (ed.) CP 2005. LNCS, vol. 3709, pp. 211–225. Springer, Heidelberg (2005) CrossRefGoogle Scholar
  9. 9.
    Feder, T., Subi, C.: On hypercube labellings and antipodal monochromatic paths. Discrete Appl. Math. 161(10), 1421–1426 (2013)MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Fink, J.: Perfect matchings extend to hamilton cycles in hypercubes. J. Comb. Theor. B 97(6), 1074–1076 (2007)MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Fink, J.: Connectivity of matching graph of hypercube. SIDMA 23(2), 1100–1109 (2009)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Ganesh, V., Dill, D.L.: A decision procedure for bit-vectors and arrays. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 519–531. Springer, Heidelberg (2007) CrossRefGoogle Scholar
  13. 13.
    Ganesh, V., O’Donnell, C.W., Soos, M., Devadas, S., Rinard, M.C., Solar-Lezama, A.: Lynx: a programmatic sat solver for the rna-folding problem. In: Cimatti, A., Sebastiani, R. (eds.) SAT 2012. LNCS, vol. 7317, pp. 143–156. Springer, Heidelberg (2012) CrossRefGoogle Scholar
  14. 14.
    Gebser, M., Janhunen, T., Rintanen, J.: SAT modulo graphs: acyclicity. In: Fermé, E., Leite, J. (eds.) JELIA 2014. LNCS, vol. 8761, pp. 137–151. Springer, Heidelberg (2014) Google Scholar
  15. 15.
    Gregor, P.: Perfect matchings extending on subcubes to hamiltonian cycles of hypercubes. Discrete Math. 309(6), 1711–1713 (2009)MathSciNetCrossRefMATHGoogle Scholar
  16. 16.
    Heule, M.J.H., Hunt, W.A., Wetzler, N.: Trimming while checking clausal proofs. In: FMCAD, pp. 181–188. IEEE (2013)Google Scholar
  17. 17.
    Holm, J., De Lichtenberg, K., Thorup, M.: Poly-logarithmic deterministic fully-dynamic algorithms for connectivity, minimum spanning tree, 2-edge, and biconnectivity. J. ACM (JACM) 48(4), 723–760 (2001)CrossRefMATHGoogle Scholar
  18. 18.
    Konev, B., Lisitsa, A.: A SAT attack on the Erdős discrepancy conjecture. In: SAT (2014)Google Scholar
  19. 19.
    Nieuwenhuis, R., Oliveras, A., Tinelli, C.: Abstract DPLL and abstract DPLL modulo theories. In: Baader, F., Voronkov, A. (eds.) LPAR 2004. LNCS (LNAI), vol. 3452, pp. 36–50. Springer, Heidelberg (2005) CrossRefGoogle Scholar
  20. 20.
    Ruskey, F., Savage, C.: Hamilton cycles that extend transposition matchings in Cayley graphs of \(S_n\). SIDMA 6(1), 152–166 (1993)MathSciNetCrossRefMATHGoogle Scholar
  21. 21.
    Sebastiani, R.: Lazy satisfiability modulo theories. J. Satisfiability Boolean Model. Comput. 3, 141–224 (2007)MathSciNetMATHGoogle Scholar
  22. 22.
    Soh, T., Le Berre, D., Roussel, S., Banbara, M., Tamura, N.: Incremental SAT-based method with native boolean cardinality handling for the hamiltonian cycle problem. In: Fermé, E., Leite, J. (eds.) JELIA 2014. LNCS, vol. 8761, pp. 684–693. Springer, Heidelberg (2014) Google Scholar
  23. 23.
    Stein, W.A.(et al).: Sage Mathematics Software (Version 6.3) (2010)Google Scholar
  24. 24.
    Thurley, M.: sharpSAT – counting models with advanced component caching and implicit BCP. In: Biere, A., Gomes, C.P. (eds.) SAT 2006. LNCS, vol. 4121, pp. 424–429. Springer, Heidelberg (2006) CrossRefGoogle Scholar
  25. 25.
    Velev, M.N., Gao, P.: Efficient SAT techniques for absolute encoding of permutation problems: application to hamiltonian cycles. In: SARA (2009)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  • Edward Zulkoski
    • 1
  • Vijay Ganesh
    • 1
  • Krzysztof Czarnecki
    • 1
  1. 1.University of WaterlooWaterlooCanada

Personalised recommendations