











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












22c:145 Artificial Intelligence Russell & Norvig, Ch. 7.
z Validity:
ϕ = ( a V c ) & ( b V c ) & (¬ a V ¬ b V ¬ c )
Clause
Positive Literal
Negative Literal
z Every propositional constraint can be converted into a set of equivalent clauses.
a b d^
ϕd = [d ≡ ¬(a & b )] = [d → ¬(a & b)] & [¬(a & b) → d] = (¬d V ¬a V ¬b)[¬d → (a & b)]
ϕd = [ d ≡ ¬( a & b )] = ¬[ d ⊕ ¬( a & b )] = ¬[(¬( a & b ) & ¬ d ) V ( a & b & d )] = ¬[¬ a ¬ d V ¬ b ¬ d V a b d ] = ( a V d )( b V d )(¬ a V ¬ b V ¬ d )
( d a b)[ d → (a & b)] = (a V d)(b V d)(¬a V ¬b V ¬d)
z A variable is pure if its literals are either all positive or all negative z Satisfiability of a formula is unaffected by assigning pure variables the values that satisfy all the clauses containing themcontaining them
ϕ = ( a V c )( b V c )( b V ¬ d )(¬a V ¬b V d )
z Set c to 1; if ϕ becomes unsatisfiable, then it is also unsatisfiable when c is set to 0.
z General technique for deriving new clauses Example: ω 1 = (¬ a V b V c ), ω 2 = ( a V b V d ) Resolution:
res(ω 1 , ω 2 , a ) = ( b V c V d )
z Complete procedure for satisfiability [Davis, JACM’60] z Impractical for real-world problem instances z Application of restricted forms has been successful!
SAT Algorithms
Complete Incomplete
Backtrack search (DP) Resolution (original DP) Recursive learning (RL)
BDDs (Binary Decision Diagram)
...
Local search (hill climbing) Continuous formulations Genetic algorithms Simulated annealing
...
Tabu search
Can prove unsatisfiability Cannot prove unsatisfiability
X1 V X X1 V X -X1 V -X -X1 V -X -X2 V -X3 1 V X 1 V X 0 V -X 0 V -X -X2 V -X
0 V X 0 V X 1 V -X 1 V -X -X2 V -X
X1=
X X
X1=
1 (^1) X2=
1 1 -X2 V -X 1 X 1 1 0 V -X
1 1 1 1 0
X2=
1 -X -X -X2 V -X3 (^11) 1 -X 1 V -X3 (^1) 1 1 1 1
X2=
X3=
1 0 1 1 1
(^0) X3=0 X3= X 1 1 1 V –X
X2=
X1 V X X1 V X -X1 V -X -X1 V -X -X2 V -X3 1 1 -X -X -X2 V -X
X X 1 1 -X2 V -X
X1=0 X1=
-X2 V -X3^ X2 V^ X
1 1 1 1 0
X2=1, X3=
1 1 1 1 1
X2=0, X3=
Make all unit clauses true; No splitting on them.
z Iteratively apply resolution (consensus) to eliminate one variable each time
ϕ = ( a V c )( b V c )( d V c )(¬ a V ¬ b V ¬ c ) Eliminate variable c
ϕ 1 = ( a V ¬ a V ¬ b )( b V ¬ a V ¬ b )( d V ¬ a V ¬ b ) = ( d V ¬ a V ¬ b ) (^) Instance is SAT!
z Recursive evaluation of clause satisfiability requirements for identifying common assignments
ϕϕϕϕ = (= (= (= ( aaaa VVVV bbbb )(¬)(¬)(¬)(¬ aaaa VVVV dddd ) (¬) (¬) (¬) (¬ bbbb VVVV dddd ))))
Recursion can be of arbitrary depth
Try a = 1: ( a = 1) ⇒ ( d = 1)
Try b = 1: ( b = 1) ⇒ ( d = 1)
C( a = 1) = { a = 1, d = 1}
C( b = 1) = { b = 1, d = 1}
C( a = 1) ∩ C( b = 1) = { d = 1} Every way of satisfying^ ( a^ V^ b )^ implies^ d^ = 1. Hence, d = 1 is a necessary assignment!
ϕ = ( a V b )(¬ a V d ) (¬ b V d )
( b V d )
resolution ( )
( d )
resolution
Sequence of resolution operations for finding necessary assignments
Comment: RL provides yet another mechanism for identifying suitable resolution operations
z Local search is incomplete
z Resolution is in general impractical
z Recursive Learning (RL) are in general slow, though robust
z During backtrack search, in the presence of conflicts, backtrack to one of the causes of the conflict
ϕ = ( a V b )(¬ b V c V d ) (¬ b V e )(¬ d V ¬ e V f ) ( a V c V f )(¬ a V g )(¬ g V b )(¬ h V j )(¬ i V k )…
ϕ = ( a V b )(¬ b V c V d ) (¬ b V e )(¬ d V ¬ e V f ) ( a V c V f )(¬ a V g )(¬ g V b )(¬ h V j )(¬ i V k )…
ϕ = ( a V b )(¬ b V c V d ) (¬ b V e )(¬ d V ¬ e V f ) ( a V c V f )(¬ a V g )(¬ g V b )(¬ h V j )(¬ i V k )…
ϕ = ( a V b )(¬ b V c V d ) (¬ b V e )(¬ d V ¬ e V f ) ( a V c V f )(¬ a V g )(¬ g V b )(¬ h V j )(¬ i V k )…
( a = 1) ∧ ( c = 0) ∧ ( f = 0) ⇒ (ϕ = 0)
Assume (decisions) c = 0, f = 0, h = 0 and i = 0
Assignment a = 0 caused conflict ⇒ clause ( a V c V f ) created ( a V c V f ) implies a = 1
A conflict is again reached: (¬ d V ¬ e V f ) is unsat
(ϕ = 1) ⇒ ( a = 0) ∨ ( c = 1) ∨ ( f = 1) ∴create new clause: (¬ a V c V f )
Created clauses: ( a V c V f ) and (¬ a V c V f ) Apply resolution: new unsat clause ( c V f )
0
0
c
f
∴ backtrack to most recent decision: f = 0
∴created clauses/implicates: ( a V c V f ), (¬ a V c V f ), and ( c V f )
i
h
0
0
a 0 1 ( c V f )
z Resolution and recursive learning can be incorporated into backtrack search (DP)
( b V c V d )
resolution ( b^ V^ c^ V^ d ) Unit clause^!
( a V b V c ) (¬ a V b V d )
Resolution within DP:
Clause provides explanation for necessary assignment b = 1
Implications:
ϕ = ( a V b V c )(¬ a V d V e ) (¬ b V d V c )
( a = 1) ∧ ( e = 0) ⇒ ( d = 1)
ϕϕ = (= ( aa VV b V cb V c )(¬)(¬ aa VV d V ed V e ) (¬) (¬ bb VV d V cd V c ))
resolution
ϕ = ( a V b V c )(¬ a V d V e ) (¬ b V d V c )
( a 1) ∧ ( e 0) ⇒ ( d 1)
( b = 1) ∧ ( c = 0) ⇒ ( d = 1)
Clause provides explanation for necessary assignment d = 1
( c V e V d )
resolution
( b V c V e V d )
( c = 0) ∧ (( e = 0) ∧ ( c = 0)) ⇒ ( d = 1)
Clausal form:
( c V e V d ) Unit clause!
z Eliminate clauses and variables
Implication graph:
a
d
b c
a , b , c and d are pairwise equivalent
(¬ a V b )(¬ b V c )(¬ c V d )(¬ d V b )(¬ d V a )
≡ (a→b)(b→c)(c→d)(d→b)(d→a)
∴replace all variables by a
( a V ¬ x )( b V ¬ x )(¬ a V ¬ b V x ) ( a V ¬ y )( b V ¬ y )(¬ a V ¬ b V y
resolution
x ↔ y
(¬ x V ¬ b V y ) (¬ y V ¬ b V x )
(¬ x V y ) (¬ y V x )
resolution
z Can make the search strategy complete
a b
c
d
e
f
c h? e (^) g
ϕ = [ d ≡ ¬( ab )] [ e ≡ ¬( b V c )] [ f ≡ ¬ d ] [ g ≡ d V e ] [ h ≡ fg ] h
a b
c
d
e
f
h?
a b
c
d
e
f
h?
a b
c
d
e
f
h?
a b
c
d
e
f
h?
= h ( a V d )( b V d )(¬ a V ¬ b V ¬ d ) (¬ b V ¬ e )(¬ c V ¬ e )( b V c V e ) (¬ d V ¬ f )( d V f ) (¬ d V g )(¬ e V g )( d V e V ¬ g ) ( f V ¬ h )( g V ¬ h )(¬ f V ¬ g V h )
= h ( a V d )( b V d )(¬ a V ¬ b V ¬ d ) (¬ b V ¬ e )(¬ c V ¬ e )( b V c V e ) (¬ d V ¬ f )( d V f ) (¬ d V g )(¬ e V g )( d V e V ¬ g ) ( f V ¬ h )( g V ¬ h )(¬ f V ¬ g V h )
= h ( a V d )( b V d )(¬ a V ¬ b V ¬ d ) (¬ b V ¬ e )(¬ c V ¬ e )( b V c V e ) (¬ d V ¬ f )( d V f ) (¬ d V g )(¬ e V g )( d V e V ¬ g ) ( f V ¬ h )( g V ¬ h )(¬ f V ¬ g V h )
= h ( a V d )( b V d )(¬ a V ¬ b V ¬ d ) (¬ b V ¬ e )(¬ c V ¬ e )( b V c V e ) (¬ d V ¬ f )( d V f ) (¬ d V g )(¬ e V g )( d V e V ¬ g ) ( f V ¬ h )( g V ¬ h )(¬ f V ¬ g V h )
= h ( a V d )( b V d )(¬ a V ¬ b V ¬ d ) (¬ b V ¬ e )(¬ c V ¬ e )( b V c V e ) (¬ d V ¬ f )( d V f ) (¬ d V g )(¬ e V g )( d V e V ¬ g ) ( f V ¬ h )( g V ¬ h )(¬ f V ¬ g V h )
c (^) e (^) g
ϕ = h [ d ≡ ¬( ab )] [ e ≡ ¬( b V c )] [ f ≡ ¬ d ] [ g ≡ d V e ] [ h ≡ fg ]
c c c (^) eee (^) ggg
xx (^11)
xx (^22)
xx (^55)
xx 66 xx^77 xx (^99)
= 0= 0
xx 11 CG
xx (^22)
xx (^55)
xx (^66) xx (^77) xx (^99) s-a-
xx (^44)
xx (^11)
xx (^22)
xx (^33)
xx (^55)
xx 66 xx (^77)
xx (^88)
xx (^99)
xx (^44)
xx 33 xx^88
= 1= 1
CF
xx (^44)
xx (^11)
xx (^33)
xx (^55)
xx 66 xx (^77)
xx (^88)
xx (^99)
xx (^33) xx (^44)
xx (^88) zz = 1?
Trivially mapped into CNF
CA
z Combinational Circuits:
If z = 1 is unsatisfiable, the two circuits are equivalent!
CB
z = 1?
z Sequential Circuits:
z Problem formulation,
I 0 ∧ ρ(0,1) ∧ ρ(1,2) ∧ … ∧ ρ ( k -1, k ) ∧ (¬ P 0 ∨ ¬ P 1 … ∨ ¬ P k)
Can solve large problem instances
ddomain i iinstance t variables clauses CPU timei bl l CPU ti FPGA routing bigkeyv1w6 25896 91400 11.
Non-chronological backtracking (NCB) and clause recording (CR) can be observed often and can be crucial
domain instance B T B NCB LJ T B NCB LJ T testing ssa2670-130 > 11250000 > 10000 7142 3538 20 60.3 100 42 15 0.
w/o NCB and CR w/ NCB and w/o CR w/ NCB and CR
Formula simplification can be significant
domain instance variables clauses variables clauses BMC barrel7 3523 13765 805 3467
before after
Randomization & Restarts can be effective
domain instance B NCB LJ T B NCB LJ T R
w/o restarts w/ restarts
Restart search every 100 backtracks Keep recorded clauses of size ≤ 10
verification 2dlx_cc_bug54 42645 15156 35 2299.3 222 147 36 53.5 3
Portfolio of algorithm configurations can be essential
domain instance B NCB LJ T B NCB LJ T verification dlx2 cc 2273327 688891 39 > 100000 100498 32066 70 2032
w/o portfolio w/ portfolio
verification dlx2_cc 2273327 688891 39 > 100000 100498 32066 70 2032
Configurations: Clauses recorded: sizes 15 to 30 Clauses kept: sizes 10 to 20 Each configuration w/ equal probability 4 different configurations used Initial cutoff = 250; increments = 50
z Many recent SAT algorithms and (EDA) applications z Hard Applications
z Backtrack Search (Cont’d)