Sugar: a SAT-based Constraint Solver
Table of Contents
Overview
Sugar is a SAT-based Constraint Solver. Constraint Satisfaction Problem (CSP) is encoded to a Boolean CNF formula, and it is solved by an external SAT solver. Sugar also can solve Constraint Optimization Problems (COP) and Max-CSP. Sugar is an award winning solver of global constraint categories at the International CSP Solver Competitions in 2008 and 2009, and of four categories at the 2008 International Max-CSP Solver Competition. See the results of Sugar in CSP Solver Competitions for more details.
What's New
- Sugar version 2.3.4 is released.
- Sugar version 2.3.3 is released.
- Sugar version 2.3.2 is released.
- Sugar Free Sugar
- Sugar version 2.2.1 is released.
- Sugar version 2.2.0 is released.
- Sugar version 2.1.3 is released.
- Sugar version 2.1.2 is released.
- Sugar version 2.1.0 is released.
- Nonogram Solver in Copris. First release of
- CSP-to-CSP translator. You can implement your own encoder as a plug-in of Sugar. It is also possible to use Prolog-like input and output format. Sugar version 2.0.0 is released. Now Sugar can be used as a
- Scarab: A Rapid Prototyping Tool for SAT-based Constraint Programming Systems. First release of
- PBSugar: A SAT-based Pseudo-Boolean Solver. First release of
- SugarTracer version 1.0.0 is released.
- Copris (Constraint Programming in Scala) version 1.0.2 are released. Sugar version 1.15.1 and
- Azucar is another SAT-based constraint solver using compact order encoding. It is designed to be an enhanced version of Sugar.
- Copris (Constraint Programming in Scala) version 1.0.0 are released. Sugar version 1.15.0 and
- the 2009 International CSP Solver Competition. See the results of Sugar in CSP Solver Competitions for more details. Sugar version 1.14.6 became a winner of all 3 global constraint categories at
- Sugar version 1.14.6 is released.
- the 2008 International CSP Solver Competition, and of four categories of the 2008 International Max-CSP Solver Competition. See the results of Sugar in CSP Solver Competitions for more details. Sugar version 1.13 became a winner of the global constraint category at
Description
Sugar is a SAT-based constraint solver based on a SAT-encoding method named order encoding {TamuraTKB09}. In the order encoding, a comparison \(x \le a\) (alternatively \(x \ge a\)) is encoded by a different Boolean variable for each integer variable \(x\) and integer value \(a\). It is an extension of the encoding method proposed by Crawford and Baker for the Job-shop scheduling problems {CrawfordB94} to the finite-domain linear CSP (Constraint Satisfaction Problems). This encoding is proved to translate some tractable CSP to tractable SAT by Petke and Jeavons in {PetkeJ11}. There are some important related works: totalizer by Bailleux and Boufkhad for encoding Boolean cardinality constraints {BailleuxB03}, regular encoding by Ansótegui and Manyà {AnsoteguiM04}, ladder encoding by Gent and Nightingale {GentN04}, and lazy clause generation by Ohrimenko, Stuckey, and Codish {OhrimenkoSC09}.
- Sugar can solve COP (Constraint Optimization Problems) and Max-CSP in addition to CSP.
- Sugar can handle problems written in abridged notation of XCSP 2.1 format used at the International CSP and Max-CSP Solver Competitions.
- Various CSP instances in XCSP format can be found at Benchmarks in XCSP 2.1.
- Sugar became a winner in GLOBAL categories of 2008 and 2009 CSP Solver Competitions. See Promoting robust black-box solvers through competitions by Christophe Lecoutre, Olivier Roussel, and M. R. C. van Dongen.
Download
- Version 2.3.4 (released
- See https://gitlab.com/cspsat/prog-sugar
- This software is distributed under the BSD 3-Clause License.)
- Example programs of using Sugar from Java are included in package/sugar-java-api-v2-1-3.zip.
- Copris (Constraint Programming in Scala) is avaiable as a separate package.
)
- Version 2.3.3 (released
- package/sugar-v2-3-3.zip (961179 bytes, md5sum 389e71bcccbc856668e1e48f0a871826)
)
- Version 2.3.2 (released
- package/sugar-v2-3-2.zip (960636 bytes, md5sum 7c325d38912ba0829f26ac6c02b66c72)
)
- Version 2.2.1 (released
- package/sugar-v2-2-1.zip (897658 bytes, md5sum eae69722159bea918a5dd6f4efe82e02)
)
- Version 2.2.0 (released
- package/sugar-v2-2-0.zip (895881 bytes, md5sum f7ccf99db39aeeeecb928e323ea68736)
)
- Version 2.1.3 (released
- package/sugar-v2-1-3.zip (827862 bytes, md5sum 3779ea05a83bef2d3d376e130c248c37)
)
- Version 2.1.2 (released
- package/sugar-v2-1-2.zip (812138 bytes, md5sum 6a31901a4a4a36239b0b5f0a97da71cd)
)
- Version 2.1.0 (released
- package/sugar-v2-1-0.zip (739147 bytes, md5sum 4afae4c42f832473655955f387ff90c3)
)
- Version 2.0.0 (released
- package/sugar-v2-0-0.zip (768657 bytes, md5sum 1144fe59e1dd1275aa3ba2bf77b6e88b)
)
- Version 1.15.1 (released
- package/sugar-v1-15-1.zip (602890 bytes, md5sum 8705c246a2c4df6ccab11fec9a5bc923)
)
- Version 1.15.0 (released
- package/sugar-v1-15-0.zip (602728 bytes, md5sum be1fbb7e7b15b8aa52db507e56720bda)
)
- Version 1.14.7 (released
- package/sugar-v1-14-7.zip (580920 bytes, md5sum 0960ddb011f8ea59f86a5b39832eab2d)
)
- Version 1.14.6 (released
- package/sugar-v1-14-6.zip (579181 bytes, md5sum 11a0a7198913d793b4946c8726572a04)
- This version is the final version submitted to all categories of the 2009 International CSP Solver Competition
)
- Version 1.13 (released
- package/sugar-v1-13.zip (525853 bytes, md5sum 12d917fdd5c579ac796d70d22148a44d)
- This version is the final version submitted to all categories of the 2008 International CSP and Max-CSP Solver Competitions
)
- Version 1.12 (released
- package/sugar-v1-12.zip (524408 bytes, md5sum 4da26a467bdc3ed3f299c6d8fe295be4)
)
Documents
- Syntax of Sugar CSP
- Using Sugar on Microsoft Windows with Cygwin
- Using Sugar on Microsoft Windows with Cygwin (in Japanese)
- CSP-to-CSP Translation by Sugar
- Solving Puzzles with Sugar Constraint Solver (in Japanese)
Sudoku, Kakuro (Cross Sums), Akari (Light Up), Shikaku, Number Link, Masyu, Slitherlink, Nurikabe, Hashiwokakero, Hitori, Fillomino, Heyawake, Masyu, Nonogram, etc. - Some Tips of Implementing Order Encoding (under construction…)
Technical Papers and Presentations
When you want to refer to our work in your technical paper, please cite our published paper rather than just quoting the URL of this web page.
- Naoyuki Tamura, Akiko Taga, Satoshi Kitagawa, Mutsunori Banbara:
Compiling Finite Linear CSP into SAT,
Constraints,
Volume 14, Number 2, pp.254–272, June, 2009.
DOI 10.1007/s10601-008-9061-0 (Open Access, You can freely download the paper)
Evaluation Results
Some evaluation results can be found at the web page of CSP2SAT which is an early implementation of order encoding.
Links
Related Projects
- Azucar
Azucar is developed as an enhancement version of Sugar, and it uses compact order encoding by Tomoya Tanjo. In compact order encoding, integer variables are represented by a numeral system of some base, and each digit is encoded by order encoding. Therefore, the size of generated SAT instance can be much smaller than the one generated by Sugar, and you can expect the bound propagation of the most significant digit. - Copris: Constraint Programming in Scala
- Scarab: A Rapid Prototyping Tool for SAT-based Constraint Programming Systems
In Scarab, order encoding is implemented by 60 lines of code in Scala. - Cream: Class Library for Constraint Programming in Java
- CSPSAT Projects (since 2008)
SAT-based CSP Solvers and Related Pages
- BEE (by Amit Metodi and Mike Codish)
- meSAT (by Mirko Stojadinovic)
- Sat4j CP (by Daniel Le Berre)
- FznTini
- Opturion CPX Discrete Optimiser (New!)
SAT Solvers and Related Pages
- clasp solver
- Glucose solver
- GlueMiniSat solver
- Lingeling solver
- MiniSat solver
- PicoSAT solver
- PrecoSAT solver
- Sat4j solver (Java based)
- SAT competitions
- SAT Live!
CSP Solvers and Related Pages
- Constraint Solvers Catalogue
- International CSP Solver Competitions
- Christophe Lecoutre, Olivier Roussel, and M. R. C. van Dongen: Promoting robust black-box solvers through competitions, Constraints, July 2010, Volume 15, Issue 3, pp 317-326.
- 2009 the Fourth International CSP Solver Competition
- 2008 the Third International CSP and Max-CSP Solver Competitions
- 2006 the Second International CSP and Max-CSP Solver Competitions
- 2005 the First International CSP and Max-CSP Solver Competitions (PDF)
- XCSP Benchmark Instances
- MiniZinc Challenge
References
- [TamuraTKB09] Naoyuki Tamura, Akiko Taga, Satoshi Kitagawa, and Mutsunori Banbara. Compiling finite linear CSP into SAT, Constraints, 14(2):254-272, 2009.
- [PetkeJ11] Justyna Petke and Peter Jeavons. The order encoding: From tractable CSP to tractable SAT. In Proceedings of the 14th International Conference on Theory and Applications of Satisfiability Testing (SAT 2011), LNCS 6695, pages 371-372, 2011.
- [CrawfordB94] James M. Crawford and Andrew B. Baker. Experimental results on the application of satisfiability algorithms to scheduling problems. In Proceedings of the 12th National Conference on Artificial Intelligence (AAAI 1994), pages 1092-1097, 1994.
- [BailleuxB03] Olivier Bailleux and Yacine Boufkhad. Efficient CNF encoding of Boolean cardinality constraints. In Proceedings of the 9th International Joint Conference on Principles and Practice of Constraint Programming (CP 2003), LNCS 2833, pages 108-122, 2003.
- [AnsoteguiM04] Carlos Ansótegui and Felip Manyà. Mapping problems with finite-domain variables into problems with Boolean variables. In Proceedings of the 7th International Conference on Theory and Applications of Satisfiability Testing (SAT 2004), LNCS 3542, pages 1-15, 2004.
- [GentN04] I. P. Gent and P. Nightingale. A new encoding of alldifferent into SAT. In Proceedings of the 3rd International Workshop on Modelling and Reformulating Constraint Satisfaction Problems, 2004.
- [OhrimenkoSC09] O. Ohrimenko, P.J. Stuckey, and M. Codish. Propagation via lazy clause generation. Constraints, 14(3):357-391, 2009.