Million
Million

Reputation: 124

How does the SAT solver produce the model(assignment[s])?

Here is a very simple cnf instance as (x1 or x2 or x3)&(x1 or x2)&(x2 or x3)and the formula is definitely satisfiable, the solution is x1 = x2 = x3 = 1, that is enough. So,my question is how the solver produce the assignment using DPLL or other procedure? Thanks.

Upvotes: 0

Views: 252

Answers (1)

Valentin Montmirail
Valentin Montmirail

Reputation: 2640

Well, basically, for the case of CDCL

(CDCL SAT solvers implement DPLL, but can learn new clauses and backtrack non-chronologically. Clause learning with conflict analysis does not affect soundness or completeness. Conflict analysis identifies new clauses using the resolution operation. Therefore each learnt clause can be inferred from the original clauses and other learnt clauses by a sequence of resolution steps. If cN is the new learnt clause, then ϕ is satisfiable if and only if ϕ ∪ {cN} is also satisfiable. Moreover, the modified backtracking step also does not affect soundness or completeness, since backtracking information is obtained from each new learnt clause.).(Source : Wikipedia)

it's working as follow :

At first pick a branching variable, x1. A yellow circle means an arbitrary decision.

enter image description here

Now apply unit propagation, which yields that x4 must be 1 (i.e. True). A gray circle means a forced variable assignment during unit propagation. The resulting graph is called implication graph.

enter image description here

Arbitrarily pick another branching variable, x3.

enter image description here

Apply unit propagation and find the new implication graph.

enter image description here

Here the variable x8 and x12 are forced to be 0 and 1, respectively.

enter image description here

Pick another branching variable, x2.

enter image description here

Find implication graph.

enter image description here

Pick another branching variable, x7.

enter image description here

Find implication graph.

enter image description here

Found a conflict!

enter image description here

Find the cut that lead to this conflict. From the cut, find a conflicting condition.

enter image description here

Take the negation of this condition and make it a clause.

enter image description here

Add the conflict clause to the problem.

enter image description here

Non-chronological back jump to appropriate decision level.

enter image description here

Back jump and set variable values accordingly.

enter image description here

(Answer completely from Wikipedia: Conflict-Driven_Clause_Learning#Example)

Here is a list (not complete for sure) of solvers who use the CDCL algorithm, you should check them out :

Upvotes: 1

Related Questions