Abstract
Boolean satisfiability (SAT) solvers are at the core of efficient approaches for solving a vast multitude of practical problems. Moreover, albeit targeting an NP-complete problem, SAT solvers are increasingly used for tackling problems beyond NP. Despite the success of SAT in practice, modeling with SAT and more importantly implementing SAT-based problem solving solutions is often a difficult and error-prone task. This paper proposes the PySAT toolkit, which enables fast Python-based prototyping using SAT oracles and SAT-related technology. PySAT provides a simple API for working with a few state-of-the-art SAT oracles and also integrates a number of cardinality constraint encodings, all aiming at simplifying the prototyping process. Experimental results presented in the paper show that PySAT-based implementations can be as efficient as those written in a low-level language.
This work was supported by FCT funding of post-doctoral grants SFRH/BPD/103609/2014, SFRH/BPD/120315/2016, FCT grant ABSOLV (028986/02/SAICT/2017), and LASIGE Research Unit, ref. UID/CEC/00408/2013.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The method get_model() (get_core(), resp.) can be used if a prior SAT call was made and returned True (False, resp.). The get_core() method additionally assumes the SAT call was provided with a list of assumptions.
References
Ansótegui, C., Bonet, M.L., Levy, J.: SAT-based MaxSAT algorithms. Artif. Intell. 196, 77–105 (2013)
Asín, R., Nieuwenhuis, R., Oliveras, A., Rodríguez-Carbonell, E.: Cardinality networks and their applications. In: Kullmann, O. (ed.) SAT 2009. LNCS, vol. 5584, pp. 167–180. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02777-2_18
Audemard, G., Lagniez, J.-M., Simon, L.: Improving glucose for incremental SAT solving with assumptions: application to MUS extraction. In: Järvisalo, M., Van Gelder, A. (eds.) SAT 2013. LNCS, vol. 7962, pp. 309–317. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39071-5_23
Bacchus, F., Hyttinen, A., Järvisalo, M., Saikko, P.: Reduced cost fixing in MaxSAT. In: Beck, J.C. (ed.) CP 2017. LNCS, vol. 10416, pp. 641–651. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66158-2_41
Bailleux, O., Boufkhad, Y.: Efficient CNF encoding of Boolean cardinality constraints. In: Rossi, F. (ed.) CP 2003. LNCS, vol. 2833, pp. 108–122. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-45193-8_8
Batcher, K.E.: Sorting networks and their applications. In: AFIPS Conference, pp. 307–314 (1968)
Biere, A.: Lingeling, plingeling and treengeling entering the SAT competition 2013. In: Balint, A., Belov, A., Heule, M., Järvisalo, M. (eds.) Proceedings of SAT Competition 2013, volume B-2013-1 of Department of Computer Science Series of Publications B, pp. 51–52. University of Helsinki (2013)
Biere, A.: Lingeling essentials, a tutorial on design and implementation aspects of the SAT solver lingeling. In: Pragmatics of SAT workshop, p. 88 (2014)
Biere, A., Heule, M., van Maaren, H., Walsh, T. (eds.): Handbook of Satisfiability. Frontiers in Artificial Intelligence and Applications, vol. 185. IOS Press, Amsterdam (2009)
Cadoli, M., Schaerf, A.: Compiling problem specifications into SAT. Artif. Intell. 162(1–2), 89–120 (2005)
CryptoMiniSat. https://github.com/msoos/cryptominisat/
Eén, N., Sörensson, N.: An extensible SAT-solver. In: Giunchiglia, E., Tacchella, A. (eds.) SAT 2003. LNCS, vol. 2919, pp. 502–518. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-24605-3_37
Eén, N., Sörensson, N.: Temporal induction by incremental SAT solving. Electron. Notes Theor. Comput. Sci. 89(4), 543–560 (2003)
Fu, Z., Malik, S.: On solving the partial MAX-SAT problem. In: Biere, A., Gomes, C.P. (eds.) SAT 2006. LNCS, vol. 4121, pp. 252–265. Springer, Heidelberg (2006). https://doi.org/10.1007/11814948_25
Gent, I., Nightingale, P.: A new encoding of alldifferent into SAT. In: International Workshop on Modelling and Reformulating Constraint Satisfaction Problem, pp. 95–110 (2004)
Glucose 3 and Glucose 4.1. http://www.labri.fr/perso/lsimon/glucose/
graphviz. https://www.graphviz.org/
Gurobi. http://www.gurobi.com/
IBM ILOG: CPLEX optimizer 12.7.0 (2016). http://www-01.ibm.com/software/commerce/optimization/cplex-optimizer
Janota, M.: MiFuMax – a literate MaxSAT solver. JSAT 9, 83–88 (2015)
Lingeling bbc-9230380-160707. http://fmv.jku.at/lingeling/
Martins, R., Joshi, S., Manquinho, V., Lynce, I.: Incremental cardinality constraints for MaxSAT. In: O’Sullivan, B. (ed.) CP 2014. LNCS, vol. 8656, pp. 531–548. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-10428-7_39
Matplotlib. https://matplotlib.org/
Eighth Max-SAT Evaluation. http://www.maxsat.udl.cat/13/
MaxSAT Evaluation 2017. http://mse17.cs.helsinki.fi/
MiFuMax. http://sat.inesc-id.pt/~mikolas/
MiniCard 1.2. https://github.com/liffiton/minicard/
MiniSat 2.2. http://minisat.se/MiniSat.html
MiniSat GitHub. https://github.com/niklasso/minisat/
Morgado, A., Heras, F., Liffiton, M.H., Planes, J., Marques-Silva, J.: Iterative and core-guided MaxSAT solving: a survey and assessment. Constraints 18(4), 478–534 (2013)
networkx. https://networkx.github.io/
NumPy. http://www.numpy.org/
Ogawa, T., Liu, Y., Hasegawa, R., Koshimura, M., Fujita, H.: Modulo based CNF encoding of cardinality constraints and its application to MaxSAT solvers. In: ICTAI, pp. 9–17 (2013)
pandas. https://pandas.pydata.org/
PBLib. http://tools.computational-logic.org/content/pblib.php
Philipp, T., Steinke, P.: PBLib – a library for encoding pseudo-boolean constraints into CNF. In: Heule, M., Weaver, S. (eds.) SAT 2015. LNCS, vol. 9340, pp. 9–16. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-24318-4_2
Prestwich, S.D.: CNF encodings. In: Handbook of Satisfiability, pp. 75–97 (2009)
PyMiniSolvers. https://github.com/liffiton/PyMiniSolvers/
PyPI. https://pypi.python.org/
PySAT. https://pysathq.github.io/
Pytorch. http://pytorch.org/
satispy. https://github.com/netom/satispy/
scikit-learn. http://scikit-learn.org/
SciPy. https://scipy.org/
Silva, J.M.: Minimal unsatisfiability: models, algorithms and applications (invited paper). In: ISMVL, pp. 9–14 (2010)
Sinz, C.: Towards an optimal CNF encoding of Boolean cardinality constraints. In: van Beek, P. (ed.) CP 2005. LNCS, vol. 3709, pp. 827–831. Springer, Heidelberg (2005). https://doi.org/10.1007/11564751_73
Soos, M.: Enhanced Gaussian elimination in DPll-based SAT solvers. In: POS@SAT, pp. 2–14 (2010)
Soos, M., Nohl, K., Castelluccia, C.: Extending SAT solvers to cryptographic problems. In: Kullmann, O. (ed.) SAT 2009. LNCS, vol. 5584, pp. 244–257. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02777-2_24
Tseitin, G.S.: On the complexity of derivations in the propositional calculus. Stud. Math. Math. Log. Part II, 115–125 (1968)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer International Publishing AG, part of Springer Nature
About this paper
Cite this paper
Ignatiev, A., Morgado, A., Marques-Silva, J. (2018). PySAT: A Python Toolkit for Prototyping with SAT Oracles. In: Beyersdorff, O., Wintersteiger, C. (eds) Theory and Applications of Satisfiability Testing – SAT 2018. SAT 2018. Lecture Notes in Computer Science(), vol 10929. Springer, Cham. https://doi.org/10.1007/978-3-319-94144-8_26
Download citation
DOI: https://doi.org/10.1007/978-3-319-94144-8_26
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-94143-1
Online ISBN: 978-3-319-94144-8
eBook Packages: Computer ScienceComputer Science (R0)