SatBox: Reuse of SAT Solvers

The Davis-Putnam-Logemann-Loveland (DPLL) method is one of the major practical methods for the satisfiability (SAT) problem of propositional logic. In the last decade, many techniques are proposed to increase the high performance of SAT solvers. A great effort by the SAT community has been made to present these SAT techniques clearly and neatly so that it will be easier for people to implement them in other search/reasoning systems. However, it is still a great challenge to implement these SAT techniques as efficient as the top SAT solvers, as it involves a lot of complicated details and needs a lot of fine-tuning. To meet this challenge, we started the SatBox project. SatBox is a set of library functions which can be used in any backtrack search system to support propositional variable abstraction, boolean constraint propagation, conflict-direct learning and intelligent back-jumping. Satbox can do everything as in the standard DPLL method except the splitting rule. As a result, SatBox is not a complete search tool but a tool for partial model construction. All the state-of-the-arts SAT solvers can be modified easily to implement these library functions and support such an interface, so that any progress made in the development of SAT solvers can be brought into Satbox.


The code of SatBox1.0 based on SATO

Most Basic Functions Provided in SatBox


Most Basic Functions Required by SatBox


Example of Using SatBox

Here is an implementation of the standard DPLL method using SatBox. The only missing functions are read_one_clause, which reads a clause from the input, and select_next_literal, which returns the next splitting literal.

   int DPLL ()
   {
     int literal, result, literal_array[100], output[1000];

     satbox_init(1000); // assuming at most 1000 variables
     while (read_one_clause(literal_array, &size)) {
       if (size == 0) return UNSATISFIABLE; // an empty input clause is found.
       satbox_input_clause(literal_array, size);
     }

     while (true) {
       literal = select_next_literal();
       if (literal == 0) return SATISFIABLE; // no more unassigned literals
       result = satbox_decide_true(literal, output);
       if (result == 0) return UNSATISFIABLE; // no backtrack available
     }       
   }


Hantao Zhang