, Volume 19, Issue 4, pp 380–403 | Cite as

meSAT: multiple encodings of CSP to SAT

  • Mirko Stojadinović
  • Filip Marić


One approach for solving Constraint Satisfaction Problems (CSP) (and related Constraint Optimization Problems (COP)) involving integer and Boolean variables is reduction to propositional satisfiability problem (SAT). A number of encodings (e.g., direct, log, support, order) for this purpose exist as well as specific encodings for some constraints that are often encountered (e.g., cardinality constraints, global constraints). However, there is no single encoding that performs well on all classes of problems and there is a need for a system that supports multiple encodings. We present a system that translates specifications of finite linear CSP problems into SAT instances using several well-known encodings, and their combinations. We also present a methodology for selecting a suitable encoding based on simple syntactic features of the input CSP instance. Thorough evaluation has been performed on large publicly available corpora and our encoding selection method improves upon the efficiency of existing encodings and state-of-the-art tools used in comparison.


Encoding CSP to SAT Algorithm portfolio CSP SAT 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Amadini, R., Gabbrielli, M., Mauro, J. (2013). An empirical evaluation of portfolios approaches for solving CSPs. In CoRR 2013, LNCS 7874 (pp. 316–324). Springer.Google Scholar
  2. 2.
    Asín, R., Nieuwenhuis, R., Oliveras, A., Rodríguez-Carbonell, E. (2009). Cardinality networks and their applications. In SAT 2009, LNCS 5584 (pp. 167–180). Springer.Google Scholar
  3. 3.
    Banbara, M., Matsunaka, H., Tamura, N., Inoue, K. (2010). Generating combinatorial test cases by efficient SAT encodings suitable for CDCL SAT solvers. In LPAR (Yogyakarta), LNCS 6397 (pp. 112–126). Springer.Google Scholar
  4. 4.
    Beldiceanu, N., Carlsson, M., Rampon, J.-X. (2005). Global constraint catalog Technical report. SICS.Google Scholar
  5. 5.
    Ben-Haim, Y., Ivrii, A., Margalit, O., Matsliah, A. (2012). Perfect hashing and CNF encodings of cardinality constraints. In SAT 2012, LNCS 7317 (pp. 397–409). Springer.Google Scholar
  6. 6.
    Biere, A., Heule, M. J. H., van Maaren, H., Walsh, T., (eds.) (2009). Handbook of satisfiability, volume 185 of frontiers in artificial intelligence and applications. IOS Press.Google Scholar
  7. 7.
    Bofill, M., Suy, J., Villaret, M. (2010). A system for solving constraint satisfaction problems with smt. In SAT 2010, LNCS 6175 (pp. 300–305). Springer.Google Scholar
  8. 8.
    Cadoli, M., Palopoli, L., Schaerf, A., Vasile, D. (1999). NP-SPEC: An executable specification language for solving all problems in NP. In PADL 1999, LNCS 1551 (pp. 16–30). Springer.Google Scholar
  9. 9.
    Cadoli, M., & Andrea, S. (2005). SPEC2SAT: Compiling problem specifications into SAT. Artificial Intelligence, 162 (1–2), 89–120.CrossRefMathSciNetGoogle Scholar
  10. 10.
    Chen, J. (2010). A new SAT encoding of the at-most-one constraint. In Proceedings of the 9th international workshop on constraint modelling and reformulation.Google Scholar
  11. 11.
    Codish, M., & Zazon-Ivry, M. (2010). Pairwise cardinality networks. In LPAR (Dakar), LNCS 6355 (pp. 154–172). Springer.Google Scholar
  12. 12.
    Eén, N., & Sörensson, N. (2003). An extensible SAT-solver. In SAT 2003, LNCS 2919 (pp. 502–518). Springer.Google Scholar
  13. 13.
    Gavanelli, M. The log-support encoding of CSP into SAT. In CP 2007, LNCS 4741 (pp. 815–822).Google Scholar
  14. 14.
    Van Gelder, A. (2008). Another look at graph coloring via propositional satisfiability. Discrete Applied Mathematics, 156 (2), 230–243.CrossRefzbMATHMathSciNetGoogle Scholar
  15. 15.
    Gent, I.P. (2002). Arc consistency in SAT. In ECAI 2002 (pp. 121–125). IOS Press.Google Scholar
  16. 16.
    Horbach, A. (2010). A boolean satisfiability approach to the resource-constrained project scheduling problem. Annals OR, 181 (1), 89–107.CrossRefzbMATHMathSciNetGoogle Scholar
  17. 17.
    Huang, J. (2008). Universal booleanization of constraint models. In CP 2008, LNCS 5202, (pp. 144–158). Springer.Google Scholar
  18. 18.
    Hutter, F., Hoos, H. H., Leyton-Brown, K., Stützle, T. (2009). ParamILS: An automatic algorithm configuration framework. Journal of Artificial Intelligence Research (JAIR), 36, 267–306.zbMATHGoogle Scholar
  19. 19.
    Janičić, P. (2012). Uniform reduction to SAT. Logical Methods in Computer Science, 8(3), 1–39.Google Scholar
  20. 20.
    Kiziltan, Z., Mandrioli, L., Barry, OS., Mauro, J. (2011). A classification-based approach to manage a solver portfolio for csps. In Proceedings of the 22nd Irish conference on artificial intelligence and cognitive science, AICS-2011.Google Scholar
  21. 21.
    Malitsky, Y., & Sellmann, M. (2012). Instance-specific algorithm configuration as a method for non-model-based portfolio generation. In CPAIOR 2012, LNCS 7298 (pp. 244–259). Springer.Google Scholar
  22. 22.
    Marić, F., & Janičić, P. (2010). URBIVA: Uniform reduction to bit-vector arithmetic. In IJCAR 2010, LNCS 6173 (pp. 346–352). Springer.Google Scholar
  23. 23.
    Metodi, A., & Codish, M. (2012). Compiling finite domain constraints to SAT with BEE. TPLP, 12 (4–5), 465–483.zbMATHGoogle Scholar
  24. 24.
    Nethercote, N., Stuckey, P.J., Becket, R., Brand, S., Duck, G.J., Tack, G. Minizinc: Towards a standard CP modelling language. In CP 2007 (pp. 529–543).Google Scholar
  25. 25.
    Nikolić, M. (2010). Statistical methodology for comparison of sat solvers. In SAT 2010, LNCS 6175 (pp. 209–222). Springer.Google Scholar
  26. 26.
    Nikolić, M., Marić, F., Janičić, P. (2009). Instance-based selection of policies for SAT solvers. In SAT 2009, LNCS 5584 (pp. 326–340).Google Scholar
  27. 27.
    Nikolić, M., Marić, F., Janičić, P. (2011). Simple algorithm portfolio for SAT. Artificial Intelligence Review, 40(4), 457–465.CrossRefGoogle Scholar
  28. 28.
    Ohrimenko, O., Stuckey, P. J., Codish, M. (2009). Propagation via lazy clause generation. Constraints, 14 (3), 357–391.CrossRefzbMATHMathSciNetGoogle Scholar
  29. 29.
    O’Mahony, E., Hebrard, E., Holland, A., Nugent, C., O’Sullivan, B. (2008). Using case-based reasoning in an algorithm portfolio for constraint solving. In Proceedings of the 19th Irish conference on artificial intelligence and cognitive science. AICS-2008.Google Scholar
  30. 30.
    Rossi, F., van Beek, P., Walsh, T., (eds.) (2006). Handbook of constraint programming. Elsevier.Google Scholar
  31. 31.
    Roussel, O., & Lecoutre, C. (2009). XML representation of constraint networks: format XCSP 2.1. CoRR, abs/0902.2362.Google Scholar
  32. 32.
    Sinz, C. (2005). Towards an optimal CNF encoding of boolean cardinality constraints. In CP 2005, LNCS 3709 (pp. 827–831). Springer.Google Scholar
  33. 33.
    Soh, T., Inoue, K., Tamura, N., Banbara, M., Nabeshima, H. (2010). A SAT-based method for solving the two-dimensional strip packing problem. Fundamental Information, 102 (3–4), 467–487.zbMATHMathSciNetGoogle Scholar
  34. 34.
    Tamura, N., & Banbara, M. (2008). Sugar: A CSP to sat translator based on order encoding. In Proceedings of the third constraint solver competition (pp. 65–69).Google Scholar
  35. 35.
    Tamura, N., Taga, A., Kitagawa, S., Banbara, M. (2009). Compiling finite linear CSP into SAT. Constraints, 14 (2), 254–272.CrossRefzbMATHMathSciNetGoogle Scholar
  36. 36.
    Tanjo, T., Tamura, N., Banbara, M. (2011). A compact and efficient SAT-encoding of finite domain CSP. In SAT 2011, LNCS 6695 (pp. 375–376). Springer.Google Scholar
  37. 37.
    Tanjo, T., Tamura, N., Banbara, M. Azucar: A SAT-based CSP solver using compact order encoding - (tool presentation). In: SAT 2012, LNCS 7317 (pp. 456–462).Google Scholar
  38. 38.
    Tomovic, A., Janicic, P., Keselj, V. (2006). n-gram-based classification and unsupervised hierarchical clustering of genome sequences. Computer Methods and Programs in Biomedicine, 81 (2), 137–153.CrossRefGoogle Scholar
  39. 39.
    Tseitin, G. S. (1983). On the complexity of derivation in propositional calculus. In Automation of reasoning 2: Classical papers on computational logic 1967–1970 (pp. 466–483). Springer.Google Scholar
  40. 40.
    van Hoeve, W. J. (2001). The alldifferent constraint: A survey. CoRR, cs.PL/0105015.Google Scholar
  41. 41.
    Walsh, T. (2000). SAT vs CSP. In Dechter, R. (ed.), CP 2000, LNCS 1894 (pp. 441–456). Springer.Google Scholar
  42. 42.
    Xu, L., Hutter, F., Hoos, H. H., Leyton-Brown, K. (2008). Satzilla: Portfolio-based algorithm selection for SAT. Journal of Artificial Intelligence Research (JAIR), 32, 565–606.zbMATHGoogle Scholar

Copyright information

© Springer Science+Business Media New York 2014

Authors and Affiliations

  1. 1.Faculty of MathematicsUniversity of BelgradeBelgradeSerbia

Personalised recommendations