I am trying to solve a SAT problem with 12000+ boolean variables using Z3.
I expect that most of the variables will evaluate to false in the solution.
Is there a way to guide or hint Z3 as SAT solver to try “polarity false” first?
I’ve tried it with cryptominisat 2 and got good results.
I am trying to solve a SAT problem with 12000+ boolean variables using Z3.
Share
Z3 is a collection of solvers and preprocessors. We can provide hints for some of the solvers.
When the command
(check-sat)is used, Z3 will select the solver automatically for us.We should
(check-sat-using <strategy>)if we want to select the solver ourselves.For example, the following command will instruct Z3 to use a Boolean SAT solver.
We can force it to always try “polarity false” first by using:
We can also control the preprocessing steps. If we want to put the formula in CNF before invoking
sat, we should use:EDIT: if you are using the DIMACS input format and Z3 v4.3.1, then you can’t set parameters for all available solvers using the command line. The next release will address this limitation. In the meantime, you can download the work-in-progress branch using:
and compile Z3. Then, to force polarity false, we use the command line option
The command
z3 -pm:satwill display all available options for this module.END EDIT
Here is a complete example in SMT 2.0 (also available online):