0

So I have a cnf, and two lists of variables K and C. The variables of K is added to the cnf as unit clauses (either negated or not depending on a boolean array) before sending it of to a sat-solver. When the sat-solver returns a model I only care about the variables that also occur in C and all other variables in the model is discarded.

Since the cnf is to be run repeatedly (with different variables from K set to true or false) it would be worth it to spend several hours to simplify the cnf and remove unnecessary variables (unnecessary is any variables that are not in either K or C) if it means shaving a few minutes off each time it is to be solved.

My question is whether I can use resolution variable elimination as described in this pdf or this bloggpost to eliminate some variables as long as I don't eliminate any variable that occurs in either K or C. Or if this will change the resulting model with respect to the variables in C?

jørgen k. s.
  • 135
  • 1
  • 2
  • 8
  • 1
    The really short answer is "In Theory: no". I recommend trying to do the proof that a set of clauses `C` is equisatisfiable with the set of clauses `C'` that are the result of resolution variable elimination of `C` on `v`. In the proof, you will extend a model `M'` of `C'` to a model of `C` by assigning `v`. Does `v` have to be true, false or can it be either to extend `M'` to model C? – Tim May 09 '18 at 04:47
  • 1
    Walking through the proof will tell you what bookkeeping you will need to do to recover all models that are extensions of the original model. You can try to follow the implementation of `extendModel` in [minisat] (https://github.com/niklasso/minisat/blob/master/minisat/simp/SimpSolver.cc#L578-L592) that is undoing `SimpSolver::eliminateVar` to recover *a* model. It might take 1-2h to follow though. – Tim May 09 '18 at 04:47

0 Answers0