A blocking clause-based AllSAT solver, implemented on top of MiniSat-C v1.14.1 obtained from The MiniSat Page, is presented.
One way to extend an ordinary SAT solver to AllSAT solving is to use blocking clauses. That is, whenever a solver finds a solution, take complement by considering a solution as a product of literals, i.e., cube, add it to CNF, and restart the solver from scratch. The obtained clause here is called a blocking clause. This approach was first introduced by McMillan 2002. Continueing search at the point where a solution is found is not straightforward, as mentioned in Jin et al 2005. This kind of blocking clauses can only "block" the single assignment we have just found, although it is nevertheless valuable because of nonchronological backtracking. To block many solutions, it is common to perform simplication of satisfying assignment by removing "redundant" literals and to compute the corresponding blocking clause.
In our implementation, whether simplification is performed or not can be selected by defining macro in Makefile (see below). Several techniques for simplification have been proposed (see Morgado and Marques-Silva 2005, Yu et al. 2014), however computing the minimum one is intractable, and we have to compromise ourselves with approximation, which means the simplified solutions may not be optimal. Our implementation performs simplification in a greedy manner and does not employ special optimizations except for a failthful implementation of the blocking clause mechanism stated above. Although there is still room for improvement on our simplification algorithm, we decided to release because no such implementation is available elsewhere.
Input boolean formula should be in DIMACS CNF format. For details of DIMACS CNF format and benchmark problems, see SATLIB.
Makefile
.
If an output file is specified, all satisfying assignments to a CNF are generated in DIMACS CNF format without problem line.
Notice: there may be as many number of assignments as can not be stored in a disk space.
If simplification is performed, computed assingments are partial, which means some variables may not appear.
If you want to use timelimit or progress report functionality, define TIMELIMIT in Makefile
.
Usage: ./minisat_all [options] input-file [output-file] -t<int> timelimit(sec): place an integer without space after 't' -i<int> interval(sec) reporting number of solutions: the same as above
minisat_all is implemented by modifying MiniSat-C_v1.14.1. Please check the license file included in this software.