Zchaff: A fast SAT solver
ECE 256B – Spring 2002
1 of 12
RCFB256B3450  Zchoff
* We’d like to build a complete decision procedure for SAT which is efficient.
Generalized
DPL
algorithm:
while (true)
{
if (! decide( ))
/* no unassigned variables */
return (sat)
while (! bcp ( )) {
if (! resolved_conflict ( ))
return (not sat);
}
}
bool resolve_conflict ( )
{
d= most recent assignment which is not exhausted;
if (d==Null)
return (false);
else
{
flip value of d;
mark d as exhausted;
undo invalidated assumptions; (i.e., u_bcp(d))
return (true)
}
}
Zchaff: A fast SAT solver
ECE 256B – Spring 2002
2 of 12
RCFB256B3450  Zchoff
* Decide ( ) chooses an unassigned variable and sets it to a value.
Keep a list of current assignments of length
(the decision depth). (Returns false only if all variables are exhausted.)
* bcp ( )
Boolean Constraint Propagation
bcp ( ) identifies unit clauses and trosetively sets forced literals until:
a) conflict is found (i.e., current assignments are not consistent)
b) all unit clauses are assigned.
⇒
a unit clause
is one which every literal but one is false
⇒
to satisfy clause that literal must be true.
Eg:
′
++
()
′
+
abc
abcad
if
a
→
false; last clause forces
d
→
true.
or if
a
→
true,
b
→
false; first clause must set
c
→
true.
bcp is a powerful lookahead mechanism since the forced literals can create additional unit clauses
⇒
run
to transitive closure.
* On the other hand: such implications are based only on the set of current
variable decisions.
⇒
if a
decision is backtracked, we must also remove all the implied assignments made by bcp ( ). It is typical to
record the decision values by the level
l
.
⇒
Thus if we associate each implied assignment by it level, we need only remove those implications higher
than
′
l
for a new assignment at level
′
l
. This is what u_bcp ( ) does.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentZchaff: A fast SAT solver
ECE 256B – Spring 2002
3 of 12
RCFB256B3450  Zchoff
Observation (Zhang):
Majority of run time of solver is in bcp
.
To make an efficient solver, we must have an efficient bcp. It seems that we need to check each clause to see
if it is a unit clause, but this is not so:
(we only care if the clause has all but one literal set.)
⇒
choose any two variables (not zero) in each clause. Then need only check the clauses that have
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 brewer
 Boolean satisfiability problem, zChaff, ECE 256B, fast SAT solver, Zchoff

Click to edit the document details