Reputation: 63
Suppose I have a CNF expression with variables (a,b,c,d,e,f,g)
. How would I go about using a SAT solver to find an assignment for (d,e,f)
given that {a,b,c,g} = {1,0,0,1}
and {a,b,c,g} = {1,1,1,1}
? If it was one assumption, calling a sat solver to find assignments for {d,e,f}
would be straight-forward (E.g., by adding unit clauses to the CNF). But what if I have multiple assumptions? Is this possible?
Upvotes: 1
Views: 450
Reputation: 1098
It is not quite clear if you want a practical answer or an interesting theoretical answer. I will go after practical.
For each set of assumptions, call a sat solver that supports solve with assumptions on that set of assumptions (example). Do this sequentially on the same solver instance.
Pros:
F & G
where F is over variables X, G is over variables Y and X and Y share no variables, resolution -- the inference rule used in CDCL -- cannot derive clauses mixing F and G. There is no obvious gain of mixing the two together instead of splitting them apart unless one instance is much easier to prove unsat and stop early.)Cons:
I know this is a bit of an obvious answer, but it is worth trying. If that fails, you can try doing fancier things like solving w.r.t. the assumptions A union A'
, and only if that is unsat solving falling back on this strategy of A then A'. This won't help for your example as (a,b,c,g) = (1,0,0,1)
and (a,b,c,g) = (1,1,1,1)
are mutually exclusive.
Upvotes: 0
Reputation: 5532
Here are the steps for what (I think) harold was trying to describe to you. You have some CNF formula F over the variables a, b, c, d, e, f and g.
The solver will find a satisfying assignment consistent with both (a,b,c,g)'s and (aa,bb,cc,gg)'s preset values.
Upvotes: 4