Post on 15-Oct-2019
DPLLmethod
DPLL method
DPLLmethod
Summary
DPLL procedure
DPLL example
DPLLmethod
DPLL procedure: Intro
Basic facts
Pobably the most e�cient procedure for checking
satis�ability of ground clauses
Input: a set of ground clauses
Output: decides whether the set of clauses is unsatis�ableor not
if the set of clauses is satis�able the algorithm outputs an
assignment that satis�es the set of clauses
DPLLmethod
DPLL procedure: history
History
DPLL = Davis-Putnam-Logemann-Loveland.
Introduced in two article in 1960.
Impressive engineering work to make it e�cient over the
years.
DPLLmethod
The SAT problem
SAT
Given a propositional formula �nd an assignment that
satis�es the formula or show that such an assignment does
not exists
SAT is decidable, but computationally untractable: SAT isNP-Complete
NP-Complete: any NP problems can be reduced to SAT in
polynomial time: e.g. Travelling Salesman Problem.
Since SAT is NP-Complete it is very important to �nd
e�cient procedures
Many applications to practical problems: e.g. hardware
veri�cation.
DPLLmethod
DPLL procedure: general concepts
general concepts
Start from a ground CNF formula
Try to build an assignment that veri�es the formula
The assignment is built using a backtracking mechanism
DPLLmethod
DPLL procedure: simple sketch
Simple sketch
A tree of possible assignments is used to guide theprocedure
Each node is a set of clauses Si
At each node one of the Literal is assigned a truth value
Truth values are propagated to reduce the number of
future assignments
DPLLmethod
DPLL procedure: Algorithm
Algorithm
Input: S = C0 = {C1, · · · ,Ck} whereCi = L1 ∨ L2 ∨ · · · ∨ Lri .Set C0 as the root of the tree.
Apply (inference) rules to leaves, expanding the tree.
A branch of the tree is no longer expanded if Si = { } or� ∈ Si where � is the empty clause.
If Si = { } then S is satis�able and we can stop the
procedure.
If � ∈ Si for all branches then the set is unsatis�able.
DPLLmethod
DPLL procedure: Applying rules
Applying Rules
We apply a given set of rules that preserve satis�ability.
When we apply a rule, we build at the same time a partial
interpretation for S .
Rules:
1 Tautology elimination
2 One-Literal
3 Pure Literal
4 Splitting
DPLLmethod
Tautology Elimination
Tautology Elimination
Delete all the ground clauses from S that are tautologies. The
remaining set S ′ is unsatis�able i� S is unsatis�able.
Example (Tautology elimination)
S = {(¬P ∨ Q ∨ P ∨ ¬R) ∧ Q ∧ R}S ′ = {Q ∧ R}
DPLLmethod
One-Literal
One-Literal (Unit clause)
If there is a unit ground clause L ∈ S , obtain S ′ from S by
deleting those ground clauses in S containing L. If S ′ = { } thenS is satis�able Otherwise obtain a set S ′′ from S ′ by deleting ¬Lfrom all clauses. S is unsatis�able i� S ′′ is.unsatis�able. When
we apply this rule we �x L = > in the partial assignment.
Example (One-Literal)
S = {P ∨ Q ∨ ¬R,P ∨ ¬Q,¬P,R,U}Apply One-Literal rule with L = ¬P :S ′ = {P ∨ Q ∨ ¬R,P ∨ ¬Q,R,U}Remove ¬L = P from cluases in S ′ S ′′ = {Q ∨ ¬R,¬Q,R,U}We �x L = > therefore P = ⊥
DPLLmethod
Pure-Literal
De�nition (Pure Literal)
L ∈ S is a pure literal i� ¬L 6∈ S
Pure-Literal Rule
If there is a pure literal L ∈ S , obtain S ′ from S by deleting all
clauses where L appears. S ′ is unsatis�able i� S ′ is unsatis�able.When we apply this rule we �x L = > in the partial assignment.
Example (Pure-Literal)
S = {P ∨ Q,P ∨ ¬Q,R ∨ Q,R ∨ ¬Q}Apply Pure-Literal rule with L = P :
S ′ = {R ∨ Q,R ∨ ¬Q}We �x L = > therefore P = >
DPLLmethod
Splitting
Splitting Rule
If we can write S in the following form:
S = (C1 ∨ L) ∧ · · · ∧ (Cm ∨ L)∧(D1 ∨ ¬L) ∧ · · · ∧ (Dm ∨ ¬L)∧Sr
Where Ci and Di are clauses in which L and ¬L do not appear,
and where Sr is a set of clauses where L and ¬L do not appear.
Then we can obtain two sets S ′ = C1 ∧ · · · ∧ Cm ∧ Sr and S ′′ =D1 ∧ · · · ∧ Dm ∧ Sr . The set S is unsatis�able i� S ′ and S ′′ areunsatis�able. When we apply this rule we split the tree and we
�x L = > for the branch of S ′′ and L = ⊥ in the branch of S ′.
DPLLmethod
Splitting:Example
Example (Splitting)
S = {P ∨ ¬Q ∨ R,¬P ∨ Q,Q ∨ ¬R,¬Q ∨ ¬R}Apply Splitting on P
S ′ = {¬Q ∨ R,Q ∨ ¬R,¬Q ∨ ¬R}, P = ⊥S ′′ = {Q,Q ∨ ¬R,¬Q ∨ ¬R}, P = >
DPLLmethod
DPLL Example I
Example (Example I)
S = (P ∨ Q ∨ ¬R) ∧ (P ∨ ¬Q) ∧ ¬P ∧ R ∧ U
{ } (P ∨ Q ∨ ¬R) ∧ (P ∧ ¬Q) ∧ ¬P ∧ R ∧ U One-Literal on ¬P{¬P} (Q ∨ ¬R) ∧ ¬Q ∧ R ∧ U One-Literal on ¬Q
{¬P,¬Q} ¬R ∧ R ∧ U One-Literal on R
{¬P,¬Q} ¬R ∧ R ∧ U One-Literal on R
{¬P,¬Q,R} � ∧ U unsatis�able
DPLLmethod
DPLL Example II
Example (Example II)
S = (P ∨ Q) ∧ ¬Q ∧ (¬P ∨ Q ∨ ¬R)
{ } S = (P ∨ Q) ∧ ¬Q ∧ (¬P ∨ Q ∨ ¬R) One-Literal on ¬Q{¬Q} P ∧ (¬P ∨ ¬R) One-Literal on P
{¬Q,P} ¬R One-Literal on ¬R{¬Q,P,¬R} { } Satis�able
DPLLmethod
Soundness of DPLL rules
Soundness
DPLL rules must be sound
If the original set S is unsatis�able then the remaining set
S ′ after applying the rule is still unsatis�able and viceversa.
Soundness of Tautology Elimination
Need to show that S ′ is unsatis�able i� S is unsatis�able.
Since a tautology is satis�ed by every interpretation, S ′ is unsat-is�able i� S is unsatis�able.
DPLLmethod
Soundness of One-Literal I
Soundness of One-Literal I
Recall that:
S ′ obtained by removing all clauses containing L from S .
S ′′ obtained by removing ¬L from clauses in S ′.
Need to show that:
If S ′ = { } then S is satis�able.
If S ′ is empty then any clause in S contains L therefore any
interpretation containing L satis�es S
DPLLmethod
Soundness of One-Literal II
Soundness of One-Literal II
Recall that:
S ′ obtained by removing all clauses containing L from S .
S ′′ obtained by removing ¬L from S ′.
Need to show that:
S ′′ is unstais�able i� S is unsatis�able.
⇒ Suppose S ′′ is unsatis�able and S is satis�able, then
there is I such that L ∈ I and I |= S . I must satisfy all
clauses which are not in S ′′; since I falsi�es ¬L then I must
satisfy all clauses in S that contains ¬L. Then I |= S ′′.
⇐ Suppose S is unsatis�able and S ′′ is satis�able, Thenthere is I |= S ′′. Since S ′′ does not contain L and ¬L, wecan build I ′ by adding L to I , I ′ |= S .
DPLLmethod
Soundness of Pure-Literal
Soundness of Pure Literal
Recall that:
S ′ obtained by removing all clauses containing L from S .
Need to show that:
S ′ unsatis�able i� S is unsatis�able.
⇒ suppose S ′ unsat. and S sat. Then there is I |= S ,
since S ′ ⊆ S then I |= S ′
⇐ suppose S unsat and S ′ sat. Then there is I |= S ′, sinceL 6∈ S ′ and ¬L 6∈ S ′ we can build I ′ adding L to I , and
I ′ |= S .
DPLLmethod
Soundness of Splitting
Soundness of Splitting
Recall that:
S = (C1 ∨ L) ∧ · · · ∧ (Cm ∨ L) ∧(D1 ∨ ¬L) ∧ · · · ∧ (Dm ∨ ¬L) ∧ SrS ′ = C1 ∧ · · · ∧ Cm ∧ SrS ′′ = D1 ∧ · · · ∧ Dm ∧ Sr
Need to show that:
S is unsatis�able i� S ′ and S ′′ are unsatis�able.
⇒ suppose S unsat and S ′ or S ′′ are sat. If S ′(S ′′) has amodel I then for any interpretation I ′ = ¬L(L) ∪ I we haveI ′ |= S .
⇐ suppose S ′ and S ′′ are unsat. and S is sat. Then there
is I |= S . If I contains ¬L(L) then I |= S ′ (I |= S ′′)therefore either S ′ or S ′′ is satis�able.
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬R
S′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example III
Example (Example III)
S = (P ∨ Q) ∧ (P ∨ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R)
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′ {¬P} Q ∧ ¬Q One-Literal on Q
S′ {¬P,Q} � S′ Unsat
Backtrack
{ } (P ∨ Q) ∧ (P ∧ ¬Q) ∧ (¬P ∨ Q) ∧ (¬P ∨ ¬R) Split on P
S′′ {P} Q ∧ ¬R One-Literal on Q
S′′ {P,Q} ¬R One-Literal on ¬RS′′ {P,Q,¬R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting �rst
Example (Example IV: using splitting �rst)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′ {¬P} ¬Q ∧ Q One-Literal on Q
S ′ {¬P,Q} � S ′ Unsat
Backtrack
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q Split on P
S ′′ {P} R ∧ Q One-Literal on Q
S ′′ {P,Q} R One-Literal on R
S ′′ {P,Q,R} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting last
Example (Example IV: usin splitting last)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q One-Literal on Q
{Q} P ∧ (¬P ∨ R) Pure-Literal on R
{Q,R, } P One-Literal on P
{Q,R,P} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting last
Example (Example IV: usin splitting last)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q One-Literal on Q
{Q} P ∧ (¬P ∨ R) Pure-Literal on R
{Q,R, } P One-Literal on P
{Q,R,P} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting last
Example (Example IV: usin splitting last)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q One-Literal on Q
{Q} P ∧ (¬P ∨ R) Pure-Literal on R
{Q,R, } P One-Literal on P
{Q,R,P} { } Satis�able!
DPLLmethod
DPLL Example IV: using splitting last
Example (Example IV: usin splitting last)
S = (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q
{ } (P ∨ ¬Q) ∧ (¬P ∨ R) ∧ Q One-Literal on Q
{Q} P ∧ (¬P ∨ R) Pure-Literal on R
{Q,R, } P One-Literal on P
{Q,R,P} { } Satis�able!
DPLLmethod
Exercise on DPLL I
Exercise
Decide whether the following set of clauses are satis�ableusing DPLL
1 p ∨ q,¬p ∨ q,¬r ∨ ¬q, r ∨ ¬q2 p ∨ q ∨ r , ¬p ∨ ¬q ∨ ¬r , ¬p ∨ q ∨ r , ¬q ∨ r , q ∨ ¬r3 ¬q ∨ p, ¬p ∨ ¬q, q ∨ r , ¬q ∨ ¬r , ¬p ∨ ¬r , p ∨ ¬r
DPLLmethod
Exercise on DPLL II
Exercise
Solve the Quack and Doctors problem using Gilmore +DPLL
1 F1 , Some patients like all doctors
(∃x)(P(x) ∧ (∀y)(D(y) → L(x , y)))
2 F2 , No patient likes any quack:
(∀x)(P(x) → (∀y)(Q(y) → ¬L(x , y)))3 F3 , No doctor is a quack:
(∀x)(D(x) → ¬Q(x))
4 F1 ∧ F2 |= F3 ?