Abstract
We present a new constraint solver over Boolean variables, available as library(clpb) (documentation: http://eu.swi-prolog.org/man/clpb.html) in SWI-Prolog. Our solver distinguishes itself from other available CLP(\(\mathcal {B}\)) solvers by several unique features: First, it is written entirely in Prolog and is hence portable to different Prolog implementations. Second, it is the first freely available BDD-based CLP(\(\mathcal {B}\)) solver. Third, we show that new interface predicates allow us to solve new types of problems with CLP(\(\mathcal {B}\)) constraints. We also use our implementation experience to contrast features and state necessary requirements of attributed variable interfaces to optimally support CLP(\(\mathcal {B}\)) constraints in different Prolog systems. Finally, we also present some performance results and comparisons with SICStus Prolog.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
The documentation of SICStus Prolog 4.3.2 contains the exact wording of current support terms of the clpb module that ships with the system: “The library module is a direct port from SICStus Prolog 3. It is not supported by SICS in any way.”.
- 2.
- 3.
A Prolog DCG primer is available at http://www.metalevel.at/dcg.html.
- 4.
See http://projecteuler.net for more information.
- 5.
The code of all benchmarks is available at http://www.metalevel.at/clpb-bench.
- 6.
The variant is freely available at http://www.metalevel.at/clpb-zdd.
References
Benhamou, F., Touraïvane, T.: Prolog IV: langage et algorithmes. In: JFPLC, pp. 51–64 (1995)
Bryant, R.E.: Graph-based algorithms for boolean function manipulation. IEEE Trans. Comput. 35(8), 677–691 (1986)
Burckel, S., Hoarau, S., Mesnard, F., Neumerkel, U.: cTI: Bottom-up termination inference for logic programs. In: 15. WLP, pp. 123–134 (2000)
Carlsson, M.: Boolean Constraints in SICStus Prolog. SICS TR, T91, 09 (1991)
Codognet, P., Diaz, D.: A simple and efficient boolean solver for constraint logic programming. J. Autom. Reason. 17(1), 97–129 (1996)
Colin, S., Mesnard, F., Rauzy, A.: Un module Prolog de mu-calcul booléen: une réalisation par BDD. In: JFPLC 1999, Huitièmes Journées Francophones de Programmation Logique et Programmation par Contraintes, pp. 23–38 (1999)
Demoen, B.: Dynamic attributes, their hProlog implementation, and a first evaluation. Report CW 350, Department of Computer Science, K.U. Leuven, October 2002
Diaz, D., Abreu, S., Codognet, P.: On the implementation of GNU Prolog. TPLP 12(1–2), 253–282 (2012)
Dincbas, M., Hentenryck, P.V., Simonis, H., Aggoun, A., Graf, T., Berthier, F.: The constraint logic programming language CHIP. In: FGCS, pp. 693–702 (1988)
Hooker, J.N.: Projection, consistency, and George Boole. Constraints 21(1), 59–76 (2016). http://dx.doi.org/10.1007/s10601-015-9201-2
Jaffar, J., Lassez, J.L.: Constraint logic programming. In: POPL, pp.111–119 (1987)
Knuth, D.E.: The Art of Computer Programming, Volume 4, Fascicle 1: Bitwise Tricks & Techniques; Binary Decision Diagrams, 12th edn. Addison-Wesley Professional, Reading, Massachusetts (2009)
Mantadelis, T., Rocha, R., Kimmig, A., Janssens, G.: Preprocessing boolean formulae for BDDs in a probabilistic context. In: Janhunen, T., Niemelä, I. (eds.) JELIA 2010. LNCS, vol. 6341, pp. 260–272. Springer, Heidelberg (2010)
Marques-Silva, J.: Algebraic Simplification Techniques for Propositional Satisfiability. In: Dechter, R. (ed.) CP 2000. LNCS, vol. 1894, p. 537. Springer, Heidelberg (2000)
Minato, S.: Zero-suppressed BDDs for set manipulation in combinatorial problems. In: Design Automation Conference (DAC), pp. 272–277 (1993)
Neumerkel, U.: Teaching Prolog and CLP (tutorial). In: ICLP (1997)
Neumerkel, U., Kral, S.: Declarative program development in Prolog with GUPU. In: Proceedings of the 12th International Workshop on Logic Programming Environments, WLPE, pp. 77–86 (2002)
Selman, B., Kautz, H., Cohen, B.: Local search strategies for satisfiability testing. In: Second DIMACS Implementation Challenge (1993)
Tarau, P.: Pairing functions, boolean evaluation and binary decision diagrams. CoRR abs/0808.0555 (2008). arxiv.org/abs/0808.0555
Tarau, P., Luderman, B.: Boolean evaluation with a pairing and unpairing function. In: SYNASC 2012, pp. 384–390 (2012)
Wielemaker, J., Schrijvers, T., Triska, M., Lager, T.: SWI-Prolog. TPLP 12(1–2), 67–96 (2012)
Zhang, H.: SATO: an efficient propositional prover. In: McCune, W. (ed.) CADE 1997. LNCS, vol. 1249. Springer, Heidelberg (1997)
Acknowledgments
First and foremost, I thank Ulrich Neumerkel for introducing me to constraint logic programming and to testing constraint solvers. For their encouragement about CLP(\(\mathcal {B}\)), I thank Nysret Musliu and Fred Mesnard. My gratitude also goes to Jan Wielemaker for providing a robust and free Prolog system, for his fast reaction times and much appreciated support when discussing and implementing new features. I thank Mats Carlsson for the visionary CLP(\(\mathcal {B}\)) solver of SICStus Prolog and sending me a complimentary version of his system. For their supremely well-written documents about BDDs, I thank Donald Knuth and Henrik Reif Andersen. These books and papers further increased my interest in the subject and were very useful during development. I also thank the anonymous reviewers for their helpful comments.
With all my heart, I thank my partner Barbara for her love.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer International Publishing Switzerland
About this paper
Cite this paper
Triska, M. (2016). The Boolean Constraint Solver of SWI-Prolog (System Description). In: Kiselyov, O., King, A. (eds) Functional and Logic Programming. FLOPS 2016. Lecture Notes in Computer Science(), vol 9613. Springer, Cham. https://doi.org/10.1007/978-3-319-29604-3_4
Download citation
DOI: https://doi.org/10.1007/978-3-319-29604-3_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-29603-6
Online ISBN: 978-3-319-29604-3
eBook Packages: Computer ScienceComputer Science (R0)