In this report, we propose a quick survey of the currently known techniques for encoding a Boolean cardinality constraint into a cnf formula, and we discuss about the relevance of these encodings. We also propose models to facilitate analysis and design of cnf encodings for Boolean constraints.
BoolVar/pb v1.0 is an open source java library dedicated to the translation of pseudo-Boolean constraints into cnf formulae. Input constraints can be categorized with tags. Several encoding schemes are implemented in a way that each input constraint can be translated using one or several encoders, according to the related tags. The library can be easily extended by adding new encoders and / or new output formats. It is available at http://boolvar.sourceforge.net/.i n t [ ] coeffs = { 5 , 3 , 1 } ; setTags ( 1 ) ;To complete the building of the input model, it only remains to create the input constraint, which is simplified by using the static factory method makeLeq, and add it to the model. Constraint q = makeLeq ( coeffs , lits , 8 ) ; m . addConstraint ( q ) ;At this time, the input model is created. It can be print to the screen for verification purpose.System . out . println ( m . toString ( ) ) ;Now, the input model must be translated to an output problem, namely a cnf formula. This suppose to create an instance of the class CNFProlem in the following way:OutputProblem out = new CNFProblem ( ) ;
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.