Академический Документы
Профессиональный Документы
Культура Документы
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Topics
1 2 3 4 5 6
The Problem A Brief History of SAT Solvers The DPLL Algorithm DPLL and Resolution Watched Literals Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests SAT was the 1st NP-complete problem
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests SAT was the 1st NP-complete problem SAT received a lot of attention [1960-now]
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests SAT was the 1st NP-complete problem SAT received a lot of attention [1960-now] SAT has very ecient implementations
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests SAT was the 1st NP-complete problem SAT received a lot of attention [1960-now] SAT has very ecient implementations SAT has become the assembly language of hard-problems
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
The Centrality of SAT
SAT is a central problem in Computer Science, with both theoretical and practical interests SAT was the 1st NP-complete problem SAT received a lot of attention [1960-now] SAT has very ecient implementations SAT has become the assembly language of hard-problems SAT is logic
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Atoms: P = {p1 , . . . , pn } Literals: pi and pj p = p , p = p A clause is a set of literals. Ex: {p , q , r } or p q r A formula C is a set of clauses
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Valuation for atoms v : P {0, 1} An atom p is satised if v (p ) = 1 Valuations are extended to all formulas
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Valuation for atoms v : P {0, 1} An atom p is satised if v (p ) = 1 Valuations are extended to all formulas ) = 1 v () = 0 v (
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Valuation for atoms v : P {0, 1} An atom p is satised if v (p ) = 1 Valuations are extended to all formulas ) = 1 v () = 0 v ( A clause c is satised (v (c ) = 1) if some literal c is satised
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Valuation for atoms v : P {0, 1} An atom p is satised if v (p ) = 1 Valuations are extended to all formulas ) = 1 v () = 0 v ( A clause c is satised (v (c ) = 1) if some literal c is satised A formula C is satised (v (C ) = 1) if all clauses in C are satised
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
NP-SAT(C )
Input: C , a formula in clausal form Output: v , if v (C ) = 1; no, otherwise.
1: 2: 3: 4: 5: 6:
Guess a v Show, in polynomial time, that v (C ) = 1 return v if no such v is guessable then return no end if
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
A Na ve SAT Solver
NaiveSAT(C )
Input: C , a formula in clausal form Output: v , if v (C ) = 1; no, otherwise.
1: 2: 3: 4: 5: 6:
for every valuation v over p1 , . . . , pn do if v (C ) = 1 then return v end if end for return no
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
[Davis & Putnam, 1960; Davis, Longemann & Loveland, 1962] The DPLL Algorithm, a complete SAT Solver
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
[Davis & Putnam, 1960; Davis, Longemann & Loveland, 1962] The DPLL Algorithm, a complete SAT Solver [Tseitin, 1966] DPLL has exponential lower bound
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
[Davis & Putnam, 1960; Davis, Longemann & Loveland, 1962] The DPLL Algorithm, a complete SAT Solver [Tseitin, 1966] DPLL has exponential lower bound [Cook 1971] SAT is NP-complete
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
pq pq p t s p t s p s p s a
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Initial Simplifications
does not occur. Delete all clauses that contain , if pq pq p t s p t s p s p s a / /// // /// ///
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Unit Propagation
Enlarge the partial valuation with unit clauses. V = {s, p } Propagate unit clauses as before. p q / /// p q / /// p /
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Backtracking
Unit propagation may lead to contradictory valuation: } V = {s, p , q , q Backtrack to the previous choice, and propagate: V = { s}
pq pq / // p t s / // p t s p /// // s //
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
New Choice
When propagation nishes, a new choice is made: p . V = { s , p}. This leads to an inconsistent valuation: V = { s , p, t , t} Backtrack to last choice: V = { s, p } p q / /// p q / /// p t /// /// / p t /// /// /
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p ( p s) q (p q ) q (p q )
s p t ( p t s) p t s) t ( p q (p q ) q (p q )
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Usual Resolution
D C C D Note that, as clauses are sets
Clauses as Sets
} {} {
} {, } {, {}
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p ( p s) q (p q ) q (p q )
s p t ( p t s) p t s) t ( p q (p q ) q (p q )
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p ( p s) p pq pq
s p t ( p t s) p t s) t ( p q (p q ) q (p q )
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p pq pq p t ( p t s) t ( p t s) p q (p q ) q (p q ) p s s
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p pq pq p s p s p t s s p q (p q ) p t s q (p q )
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p pq pq p s p s p t s p t s pq s p pq
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
s p pq pq p s p s p t s p t s pq s p pq
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Conclusion
DPLL is isomorphic to (a restricted form of) resolution DPLL inherits all properties of this (restricted form of resolution
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Conclusion
DPLL is isomorphic to (a restricted form of) resolution DPLL inherits all properties of this (restricted form of resolution In particular, DPLL inherits the exponential lower bounds
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Enhancing DPLL
For the reasons discussed, DPLL needs to be improved to achieve better eciency. Several techniques have been applied: Learning Unlearning Backjumping Watched literals Heuristics for choosing literals
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Enhancing DPLL
For the reasons discussed, DPLL needs to be improved to achieve better eciency. Several techniques have been applied: Learning Unlearning Backjumping Watched literals Heuristics for choosing literals
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Watched Literals
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Empirical measures show that 80% of time DPLL is doing Unit Propagation Propagation is the main target for optimization Chaff introduced the technique of Watched Literals
Unit Propagation speed up No need to delete literals or clauses No need to watch all literals in a clause Constant time backtracking (very fast)
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
DPLL underlying logic is 3-valued Given a partial valuation V = {1 , . . . , k } Let be any literal. if V 1(true) 0(false) if V V () = (undened) otherwise
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Every clause c has two selected literals: c 1 , c 2 For each c , c 1 , c 2 are dynamically chosen and varies with time c 1 , c 2 are properly watched under partial valuation V if:
they are both undened; or at least one of them is true
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
if no proper pair of watched literals can be found, two things may occur to alter V
Unit propagation (V is expanded) Backtracking (V is reduced)
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Example
clause c 1 c 2 pqr p = q = pq s p = q = pr s p= r = Initially V = A pair of literals was elected for each clause All are undened, all pairs are proper
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
p is chosen
V = {p } All watched literals become (0, ), improper New literals are chosen to be watched clause c 1 c 2 pqr r = q = pq s s = q = p r s s= r =
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
r is chosen
V = {p , r} WL in clauses 1,3 become improper No other *- or 1-literal to be chosen Unit propagation: q , s become true
clause pqr
c 1 r =0
c 2 /1 q= q = r =0
pq s s = /1 p r s s=
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
V = {p , r, q , s} WL in clause 2 becomes improper No other *- or 1-literal to be chosen No unit propagation is possible: clause 2 is false clause c 1 c 2 pqr r =0 q =1 pq s s =0 q =0 pr s s=1 r =0
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
Fast Backtracking
V is contracted to last choice point V = // {p , r, q , s} , r } /// /// // /// / {p
clause c 1 c 2 pqr r =1 q = pq s s = q = pr s s= r =1 Only aected WLs had to be recomputed No need to reestablish previous context from a stack of contexts Very quick backtracking
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP
The Problem
History
DPLL
Resolution
WatchLit
Conclusion
IME-USP