The Art of Computer Programming volume 4 fascicle 6 7.7.7.2 p.47-76
-
Upload
kotaro-okazaki -
Category
Science
-
view
20 -
download
2
Transcript of The Art of Computer Programming volume 4 fascicle 6 7.7.7.2 p.47-76
The Art of Computer Programming
7.2.2.2 Satisfiability p.47-76
VOLUME 4 FASCICLE 6
Random satisfiability.
Deviations from randomness in combinatorial algorithms often have a dramatic effect, while methods of sorting and searching generally stay reasonably close to their expected behavior.
How many random clauses of 3SAT on ๐๐ variables before they can't all be satisfied?
p.47
1 2 3 4 5 6 7 8 9
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ4 โจ ยฌ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 random ๐๐-SAT
{{9, 4, 3}, {5, 9, 3}, {8, 4, 3}, {6, 8, 3}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 7}, {9, 2, 4}, {5, 9, 2}, {8, 2, 4}, {6, 8, 2}, {7, 2, 4}, {6, 7, 2}, {5, 7, 2}}
satisfiable cell allocations
{{1, 1, 0, 1, 1}, {1, 1, 0, 1, 0}, {1, 1, 0, 0, 1}, {1, 0, 1, 1, 1}, {1, 0, 1, 1, 0}, {1, 0, 1, 0, 1}, {1, 0, 1, 0, 0}, {1, 0, 0, 1, 1}, {1, 0, 0, 1, 0}, {1, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 1, 0, 1}, {0, 1, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 1, 0, 0, 1}, {0, 0, 1, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}
satisfiable boolean vectors
possible ๐๐clauses
2๐๐๐๐๐๐
๐๐ = 3,๐๐ = 3,๐๐ = 5
2353 = 80
15
20
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
p.47
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ4 โจ ยฌ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 1 2 3 4 5 6 7 8 9
{{9, 4, 3}, {5, 9, 3}, {8, 4, 3}, {6, 8, 3}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 7}, {9, 2, 4}, {5, 9, 2}, {8, 2, 4}, {6, 8, 2}, {7, 2, 4}, {6, 7, 2}, {5, 7, 2}}
{{1, 1, 0, 1, 1}, {1, 1, 0, 1, 0}, {1, 1, 0, 0, 1}, {1, 0, 1, 1, 1}, {1, 0, 1, 1, 0}, {1, 0, 1, 0, 1}, {1, 0, 1, 0, 0}, {1, 0, 0, 1, 1}, {1, 0, 0, 1, 0}, {1, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 1, 0, 1}, {0, 1, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 1, 0, 0, 1}, {0, 0, 1, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}
random ๐๐-SAT
satisfiable cell allocations
satisfiable boolean vectors
possible ๐๐clauses
2๐๐๐๐๐๐
๐๐ = 3,๐๐ = 3,๐๐ = 5
2353 = 80
15
20
<
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
p.47
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
{{6, 9, 3}, {6, 8, 3}, {6, 7, 3}, {5, 9, 3}, {5, 8, 3}, {5,7, 3}, {4, 9, 3}, {4, 8, 3}, {4, 7, 3}, {6, 9, 2}, {6, 8, 2}, {6, 7, 2}, {5, 9, 2}, {5, 8, 2}, {5, 7, 2}, {4, 9, 2}, {4, 8, 2}, {4, 7, 2}, {1, 6, 9}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 8}, {1, 5, 7}, {1, 4, 9}, {1, 4, 8}, {1, 4, 7}}
{{1, 0, 0, 1, 1}, {0, 1, 1, 1, 1}, {1, 0, 0, 0, 1}, {0, 0, 1, 1, 1}, {1, 0, 0, 1, 0}, {0, 1, 0, 1, 1}, {1, 0, 0, 0, 0}, {0, 0, 0, 1, 1}, {0, 1, 1, 0, 1}, {0, 0, 1, 0, 1}, {0, 1, 0, 0, 1}, {0, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 1, 0}, {0, 1, 0, 1, 0}, {0, 0, 0, 1, 0}, {0, 1, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 0, 0, 0}}
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ๐ฅ๐ฅ3 โง ยฌ๐ฅ๐ฅ1 โจ ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 1 2 3 4 5 6 7 8 9 random
๐๐-SAT
satisfiable cell allocations
satisfiable boolean vectors
possible ๐๐clauses
2๐๐๐๐๐๐
๐๐ = 3,๐๐ = 3,๐๐ = 5
2353 = 80
27
20
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
p.47
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ๐ฅ๐ฅ3 โง ยฌ๐ฅ๐ฅ1 โจ ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 1 2 3 4 5 6 7 8 9
{{6, 9, 3}, {6, 8, 3}, {6, 7, 3}, {5, 9, 3}, {5, 8, 3}, {5,7, 3}, {4, 9, 3}, {4, 8, 3}, {4, 7, 3}, {6, 9, 2}, {6, 8, 2}, {6, 7, 2}, {5, 9, 2}, {5, 8, 2}, {5, 7, 2}, {4, 9, 2}, {4, 8, 2}, {4, 7, 2}, {1, 6, 9}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 8}, {1, 5, 7}, {1, 4, 9}, {1, 4, 8}, {1, 4, 7}}
{{1, 0, 0, 1, 1}, {0, 1, 1, 1, 1}, {1, 0, 0, 0, 1}, {0, 0, 1, 1, 1}, {1, 0, 0, 1, 0}, {0, 1, 0, 1, 1}, {1, 0, 0, 0, 0}, {0, 0, 0, 1, 1}, {0, 1, 1, 0, 1}, {0, 0, 1, 0, 1}, {0, 1, 0, 0, 1}, {0, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 1, 0}, {0, 1, 0, 1, 0}, {0, 0, 0, 1, 0}, {0, 1, 1, 0, 0}, {0, 0, 1, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 0, 0, 0}}
random ๐๐-SAT
satisfiable cell allocations
satisfiable boolean vectors
possible ๐๐clauses
2๐๐๐๐๐๐
๐๐ = 3,๐๐ = 3,๐๐ = 5
2353 = 80
27
20
<
p.47
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ4 โจ ยฌ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 1 2 3 4 5 6 7 8 9
{{9, 4, 3}, {5, 9, 3}, {8, 4, 3}, {6, 8, 3}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 7}, {9, 2, 4}, {5, 9, 2}, {8, 2, 4}, {6, 8, 2}, {7, 2, 4}, {6, 7, 2}, {5, 7, 2}}
{{1, 1, 0, 1, 1}, {1, 1, 0, 1, 0}, {1, 1, 0, 0, 1}, {1, 0, 1, 1, 1}, {1, 0, 1, 1, 0}, {1, 0, 1, 0, 1}, {1, 0, 1, 0, 0}, {1, 0, 0, 1, 1}, {1, 0, 0, 1, 0}, {1, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 1, 0, 1}, {0, 1, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 1, 0, 0, 1}, {0, 0, 1, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}
ๅ จๅๅฐใงใชใ็นใซๆณจๆ
random ๐๐-SAT
satisfiable cell allocations
satisfiable boolean vectors
possible ๐๐clauses
2๐๐๐๐๐๐
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
p.47
๐ฅ๐ฅ1, ๐ฅ๐ฅ2, ๐ฅ๐ฅ3, ๐ฅ๐ฅ4, ๐ฅ๐ฅ5
ยฌ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ2 โจ ยฌ๐ฅ๐ฅ3 โง ๐ฅ๐ฅ1 โจ ยฌ๐ฅ๐ฅ4 โจ ยฌ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 1 2 3 4 5 6 7 8 9
{{9, 4, 3}, {5, 9, 3}, {8, 4, 3}, {6, 8, 3}, {1, 6, 8}, {1, 6, 7}, {1, 5, 9}, {1, 5, 7}, {9, 2, 4}, {5, 9, 2}, {8, 2, 4}, {6, 8, 2}, {7, 2, 4}, {6, 7, 2}, {5, 7, 2}}
{{1, 1, 0, 1, 1}, {1, 1, 0, 1, 0}, {1, 1, 0, 0, 1}, {1, 0, 1, 1, 1}, {1, 0, 1, 1, 0}, {1, 0, 1, 0, 1}, {1, 0, 1, 0, 0}, {1, 0, 0, 1, 1}, {1, 0, 0, 1, 0}, {1, 0, 0, 0, 1}, {0, 1, 1, 1, 0}, {0, 1, 1, 0, 1}, {0, 1, 1, 0, 0}, {0, 1, 0, 1, 0}, {0, 1, 0, 0, 1}, {0, 0, 1, 1, 0}, {0, 0, 1, 0, 1}, {0, 0, 1, 0, 0}, {0, 0, 0, 1, 0}, {0, 0, 0, 0, 1}}
๐๐๐๐ โถ the number of ways to choose ๐๐ of the ๐๐ clauses so that at least one Boolean vector ๐ฅ๐ฅ = ๐ฅ๐ฅ1,โฆ,๐ฅ๐ฅ๐๐ satisfies them all.
๐๐๐๐ =
803
๐๐๐๐ = ๐๐๐๐๐๐๐๐
โ1
๐๐๐๐ = Pr(๐๐ clauses, distinct but otherwise selected at random, are satisfiable)
๐๐3 = ๏ฟฝ
p.47
exercise 180 p.148/219
Explain how to use BDDs to compute the numbers ๐๐๐๐ that underlie Fig. 40. What is max0โค๐๐โค80๐๐๐๐?
very simple BDD (?)
No natural ordering of the clause variables is evident, but the method of sifting is able to reduce the BDD size.
๐๐ variables ๐ฆ๐ฆ๐๐ ,one of each possible clause ๐ถ๐ถ๐๐
๐๐ ๐ฆ๐ฆ1, โฆ๐ฆ๐ฆ๐๐ = โ ๐ถ๐ถ๐๐|๐ฆ๐ฆ๐๐ = 1 is satisfiable is โ๐ฅ๐ฅ๐๐๐ฅ๐ฅ ๐ฆ๐ฆ , where ๐๐๐ฅ๐ฅ ๐ฆ๐ฆ = ๐ฅ๐ฅ satisfies โ ๐ถ๐ถ๐๐|๐ฆ๐ฆ๐๐ = 1 is simply โ ๐ฆ๐ฆ๏ฟฝ๐๐| ๐ฅ๐ฅ makes ๐ถ๐ถ๐๐ false .
if ๐๐ = 2,๐๐ = 3 and if ๐ถ๐ถ1= ๐ฅ๐ฅ1 โจ ๐ฅ๐ฅ2 , ๐ถ๐ถ7= ๐ฅ๐ฅ1 โจ ๏ฟฝฬ ๏ฟฝ๐ฅ3 , ๐ถ๐ถ11 = ๐ฅ๐ฅ2 โจ ๏ฟฝฬ ๏ฟฝ๐ฅ3 ,
then ๐๐001 ๐ฆ๐ฆ1, โฆ ,๐ฆ๐ฆ12 = ๐ฆ๐ฆ๏ฟฝ1 โง ๐ฆ๐ฆ๏ฟฝ7 โง ๐ฆ๐ฆ๏ฟฝ11.
๐๐20 โ 0.776
๐๐30 โ 0.179
๐๐40 โ 0.016
1
๐๐๐๐
๐๐๐๐
Fig. 40 + 41
๐๐ = 3,ใ๐๐ = 5
0
๐๐๐๐ = 1 for ๐๐ < 15 ๐๐๐๐ = 0 for ๐๐ > 55
๐๐๐๐: Deviation from randomness ๐๐ of SAT boolean vectors +๐๐
โ๐๐
๐๐2 โ 24.5 ยฑ 0.743
๐๐20 โ 1.47 ยฑ 1.17
1 5
๐๐30 โ 0.20 ยฑ 0.45
โ ๐๐ = 70 ใซใชใฃใฆใ๏ผ ๐๐70ใฏ ใใใ ใ 32 ใ่ถ ใใชใ๏ผ
โ๐๐ = 3,๐๐ = 5 ใง๏ผ๏ผณ๏ผก๏ผดๅฏ่ฝใช ๆๅคงใฎ ๐๐ = 2๐๐ โ 1 ๐๐
๐๐= 1 โ 2โ๐๐ ๐๐
ใฏ 70๏ผ ใฉใณใใ ใช70็ฏใฎCNFใ๐๐70ใง SATใชๅ ดๅใฏๅๅใใๅพใ๏ผ
๐๐ ใๅขใใใซใคใ ๐๐๐๐ ใ้ใใชใ 0 ใซ่ฟใฅใใชใใง๏ผ ๅๅทฎใ่ๆ ฎใใ ๐๐๐๐ ใ 1 ใๅใใใใช ๐๐ ใซๆณจ็ฎใใ๏ผ
p.48
1 < ๐๐ < 4,ใ๐๐ = 5
E๐๐: The expected โstopping timeโ
๐๐๐๐,๐๐ = E๐๐๐๐,๐๐ if ๐๐๐๐,๐๐ is the stopping time for ๐๐SAT on ๐๐ variables
๐ธ๐ธ๐๐ โ 25.22, V๐๐ โ 35.73
๐๐๐๐,5 4.06 ยฑ 1.19 11.60 ยฑ 3.04 25.22 ยฑ 5.98 43.39 ยฑ 7.62
๐๐ = ๐๐ : the number of clauses first unable to satisfy them all
๐๐๐๐ = ๐๐๐๐โ1 โ ๐๐๐๐ ๏ผthe probability that ๐๐ โ 1 random clauses are satisfiable but ๐๐ are not
๏ผณ๏ผก๏ผดใใปใผ 1 ใใใชใใชใ ๐๐ ใจ๏ผ ๅ จใฆ๏ผต๏ผฎ๏ผณ๏ผก๏ผดใซใชใๅงใใ ๐๐ ใฏ ใปใผไธ่ดใใ๏ผ
2โ๐๐๐๐๏ฟฝ๐๐๐๐ ๐๐๐๐ = 1๐๐ โ๐๐
โ 0.8853๐๐
ไธ็ชๆๆใฎ๏ผณ๏ผก๏ผด้ๅใฎ็ดฏ็ฉ๏ผ
E๐๐ = ๏ฟฝ ๐๐๐๐๐๐
E๐๐2 = ๏ฟฝ 2๐๐ + 1๐๐
๐๐๐๐
p.48
๐๐๐๐ordered sequences after ๐๐ steps, not ๐๐
๐๐ sets ๐๐๏ฟฝ๐๐ : the probability that ๐๐ random clauses ๐ถ๐ถ1 โง โฏโง ๐ถ๐ถ๐๐ are satisfiable, each ๐ถ๐ถ๐๐ is randomly chosen from the ๐๐ = 2๐๐ ๐๐
๐๐ possibilities
๐๐ = 2๐๐๐๐๐๐
๐๐๐๐
2๐๐
๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 โง ๐ฅ๐ฅ3 โจ ๐ฅ๐ฅ4 โจ ๐ฅ๐ฅ5 ใๅฏใชใฎใง๏ผณ๏ผก๏ผดใฏๅขใใ๏ผ
โbirthday paradoxโ 23ๅใฎใญใผใ365ใฎๅคงใใใฎ่กจใซๅฏพๅฟใฅใใ
ใฉใณใใ ใช้ขๆฐใ้ธใถใจใ๏ผ 2ใคใฎใญใผใๅใๅ ดๆใซๅฏพๅฟใใชใ็ขบ็ใฏ
0.4927๏ผ1/2ไปฅไธ๏ผใงใใ๏ผ
๐๐๏ฟฝ๐๐ โฅ ๐๐๐๐
Fig. 45 ๐๐ = 3,ใ๐๐ = 5
๐๐๐๐
๐๐๏ฟฝ๐๐
The expected behavior of ๐๐๏ฟฝ is very much like that of ๐๐, if ๐๐๐๐ is small whenever ๐๐/๐๐ isn't small.
= โ ๐๐๐ก๐ก ๐ก๐ก! ๐๐๐ก๐ก๐๐
๐ก๐ก=0๐๐๐ก๐ก /๐๐๐๐
E๐๐๏ฟฝ = ๏ฟฝ๐๐
๐๐ โ๐๐
๐๐โ1
๐๐=0
๐๐๐๐ D๐๐๏ฟฝ2 = ๏ฟฝ๐๐
๐๐ โ๐๐
๐๐โ1
๐๐=0
๐๐๐๐ 1 + 2๐๐
๐๐ โ 1+ โฏ+
๐๐๐๐ โ๐๐
p.50
๐ผ๐ผ๐๐: Satisfiability thresholds ๐๐๐๐ ๐๐,๐๐ : ๐๐๐๐ ๐๐,๐๐ = Pr ๐๐ random clauses of ๐๐SAT are satisfiable ,
where the ๐๐ clauses are "sampled with replacement"(they needn't be distinct).
Fig. 46 ๐๐ = 3
๐ผ๐ผ๐๐ = lim๐๐โโ
๐๐๐๐,๐๐/๐๐
Random 3SAT problems shows โphase transitionโ of satisfiability when the clauses exceeds about 4.27๐๐.
็ต้จ็ใซๆจๅฎใใใ ๐ผ๐ผ๐๐ ใไฝฟใใฐ๏ผ๐ผ๐ผ๐๐๐๐็ฏใฎ ๅฐ้ฃใชใใณใใใผใฏ๐๐SATๅ้กใๅพใใใ๏ผ
โป ๐ผ๐ผ3 = 4.26675 ยฑ 0.00015
2๐๐ ln 2 โ1 + ln 2
2 โ ๐๐ 2โ๐๐3 โค lim inf
๐๐โโ๐ผ๐ผ๐๐ ๐๐ โค lim sup
๐๐โโ๐ผ๐ผ๐๐ ๐๐ โค 2๐๐ ln 2 โ
1 + ln 22 + ๐๐ 2โ
๐๐3
2๐๐ ln 2 โ ๐๐ ๐๐ ๐๐ ใชใฉใณใใ ๐๐SAT ใฏ๏ผใใฏใใซ ๐ฅ๐ฅ ; ฮฝ๐ฅ๐ฅ โ ๐๐2
ใง๏ผใปใผๅธธใซๅ ่ถณใใ๏ผ exercise 195
lim๐๐โโ
๐๐๐๐ ๐ผ๐ผ๐๐ ๐๐ โ ๐๐ ๐๐ ,๐๐ = 1, lim๐๐โโ
๐๐๐๐ ๐ผ๐ผ๐๐ ๐๐ + ๐๐ ๐๐ ,๐๐ = 0, ๐๐ โฅ 2 ใซใใใฆ
ใจใชใ้ขๆฐ๐ผ๐ผ๐๐ ๐๐ ใๅญๅจใใ๏ผ ๐๐ โถ ไปปๆใฎๆญฃใฎๆฐ
๐ผ๐ผ๐๐ ๐๐ ใฏ๏ผฮ 2๐๐ ใงๆผใใใใ๏ผ๐๐ใๅๅใซๅคงใใๆ ๅฎๆฐใซใชใ๏ผ
p.50
Analysis of random 2SAT
2 SAT problem corresponds to an implication digraph, with arcs ๐๐ ฬ โ ๐๐โฒ and ๐๐๐๏ฟฝ โ ๐๐ for each clause ๐๐ โจ ๐๐โฒ .
๐๐: a fixed constant
lim๐๐โโ
๐๐2 ๐๐๐๐ ,๐๐ = ๏ฟฝ1, if ๐๐ < 1;0, if ๐๐ > 1.
The satisfiability threshold ๐ผ๐ผ2 = 1 ๐๐ใๅขใใใซใคใใฆ ่ปข็งปใฏๆฅๆฟใซๅใ็ซใฃใฆใใ๏ผ
Fig. 47 ๐๐ = 2
๐๐2,๐๐
๏ผญ๏ผฐ๏ผฒ ๏ผ๏ผ ๏ผ๏ผ ใใใใใ้่ฒ ใฎ็ขบ็ๅคๆฐ ๐๐ ใซใใใฆ Pr ๐๐ > 0 โค E๐๐; โthe first moment principleโ Pr (๐๐ > 0) โฅ E๐๐ 2/ E๐๐2 โthe second moment principleโ ๅ ่ถณ็ขบ็ใฎ้พๅคใๆ็ใจใฟใชใใฆ ่จผๆใๅฐใ๏ผ
p.51
๐ฅ๐ฅ7
๏ฟฝฬ ๏ฟฝ๐ฅ7
๐ฅ๐ฅ9
๏ฟฝฬ ๏ฟฝ๐ฅ9
a set of 2SAT clauses is satisfiable iff no strong component of its digraph contains both ๐ฅ๐ฅ and ๏ฟฝฬ ๏ฟฝ๐ฅ for variable ๐ฅ๐ฅ. If it were a random digraph,
only ๐๐(log๐๐) vertices are reachable from any given vertex when ๐๐ < 1,
Analysis of random 2SAT p.50
๏ฟฝฬ ๏ฟฝ๐ฅ8
๐ฅ๐ฅ8
a set of 2SAT clauses is satisfiable iff no strong component of its digraph contains both ๐ฅ๐ฅ and ๏ฟฝฬ ๏ฟฝ๐ฅ for variable ๐ฅ๐ฅ. If it were a random digraph,
only ๐๐(log๐๐) vertices are reachable from any given vertex when ๐๐ < 1,
but that there is a unique "giant strong component"
of size ฮฉ ๐๐ when ๐๐ > 1. ๐๐ ใๅขใใใซใคใ๏ผๅผท้ฃ็ตๆๅใฎใทใงใขใฏๆฅใซๅคงใใใชใ๏ผ
Analysis of random 2SAT
ไธๅฏพๆๅใฐใฉใใใ๏ผ ๅผท้ฃ็ตๆๅใธใฎ ่ปข็งปใจ๏ผณ๏ผก๏ผดใฎ้ข้ฃๆง๏ผ
p.50
โsnares and snakesโ ๐๐1ฬ โจ ๐๐2 , ๐๐2ฬ โจ ๐๐3 , ..., ๐๐๏ฟฝฬ ๏ฟฝ๐ โ1 โจ ๐๐๐ ๐
๐ ๐ -chain ๐ถ๐ถ ;
๐ ๐ = 9
๐๐๐ก๐ก โจ ๐๐1 and ๐๐๏ฟฝฬ ๏ฟฝ๐ โจ ๐๐โฬ ๐ข๐ข if ๐ข๐ข < 0
๐๐๏ฟฝฬ ๏ฟฝ๐ โจ ๐๐๐ข๐ข if ๐ข๐ข > 0, ๐๐๐ก๐ก โจ ๐๐1 and
๐ก๐ก-snake
๐ ๐ -snare (๐ถ๐ถ; ๐ก๐ก,๐ข๐ข) ๐ก๐ก = 5,ใ๐ข๐ข = โ๐ก๐ก
ๅฏพๆๅใฐใฉใใฎใพใพใชใ ๅไธๅผท้ฃ็ตๆๅๅ ใซๅๆใซ๏ผ
๐๐๐ ๐ ใจ ๐๐๐ ๐ ๏ฟฝ ใๅญๅจใใชใ๏ผ โๅฟ ใๅ ่ถณๅฏ่ฝ
ๅ ่ถณไธ่ฝใช2SATใฏ ๅฟ ใๆไฝไธใคใฏ snareใ
ๆใฃใฆใใ๏ผ
snare ใๆใค2SATใงใ ๐ ๐ ใจ ๐ก๐ก ใจ ๐ข๐ข ใฎ้ขไฟใซใใฃใฆใฏ
ๅ ่ถณๅฏ่ฝใจใชใ๏ผ
๐๐๐ก๐ก
๐๐๏ฟฝฬ ๏ฟฝ๐ก
๐๐๐ก๐ก ๐๐๏ฟฝฬ ๏ฟฝ๐ก
่ฆ ๐ก๐ก ใง ๅฏพใฎ ๐ ๐ โ ๐๐๐๐๐๐๐๐๐ ๅๅฃซใ ใคใชใ้๏ผ ๐ข๐ข ใฎๆญฃ่ฒ ใ
็ดๆต ไบคๆต ใในใคใใใใไปๆใ S A T U N S A T
p.52
โsnares and snakesโ ๐๐1ฬ โจ ๐๐2 , ๐๐2ฬ โจ ๐๐3 , ..., ๐๐๏ฟฝฬ ๏ฟฝ๐ โ1 โจ ๐๐๐ ๐
๐ ๐ -chain ๐ถ๐ถ ;
๐ ๐ = 9
๐๐๐ก๐ก โจ ๐๐1 and ๐๐๏ฟฝฬ ๏ฟฝ๐ โจ ๐๐โฬ ๐ข๐ข if ๐ข๐ข < 0
๐๐๏ฟฝฬ ๏ฟฝ๐ โจ ๐๐๐ข๐ข if ๐ข๐ข > 0, ๐๐๐ก๐ก โจ ๐๐1 and
๐ก๐ก-snake
๐ ๐ -snare (๐ถ๐ถ; ๐ก๐ก,๐ข๐ข) ๐ก๐ก = 5,ใ๐ข๐ข = โ๐ก๐ก
ๅฏพๆๅใฐใฉใใฎใพใพใชใ ๅไธๅผท้ฃ็ตๆๅๅ ใซๅๆใซ๏ผ
๐๐๐ ๐ ใจ ๐๐๐ ๐ ๏ฟฝ ใๅญๅจใใชใ๏ผ โๅฟ ใๅ ่ถณๅฏ่ฝ
ๅ ่ถณไธ่ฝใช2SATใฏ ๅฟ ใๆไฝไธใคใฏ snareใ
ๆใฃใฆใใ๏ผ
snare ใๆใค2SATใงใ ๐ ๐ ใจ ๐ก๐ก ใจ ๐ข๐ข ใฎ้ขไฟใซใใฃใฆใฏ
ๅ ่ถณๅฏ่ฝใจใชใ๏ผ
๐๐๐ก๐ก
๐๐๏ฟฝฬ ๏ฟฝ๐ก
๐๐๐ก๐ก ๐๐๏ฟฝฬ ๏ฟฝ๐ก
p.52
Proof of Theorem C p.53
E๐๐ is only ๐๐ ๐๐โ1 4โ when ๐๐ = ๐๐ โ ๐๐3 4โ > ๐๐๐๐ โป c > 1 โ๐๐ > 0
E๐๐ โฅ Pr ๐๐ > 0 ; โthe first moment principleโ โปPr ๐๐ = 0 = 1 โ Pr ๐๐ > 0 โฅ 1 โ E๐๐
2๐ ๐ +1 ๐ ๐ โ 1 2๐๐๐ ๐ โค 2๐ ๐ +1 ๐ ๐ โ 1 2๐๐๐ ๐
๐๐ ๐ ๐ + 1,๐๐,2๐๐(๐๐ โ 1) โค๐๐๐ ๐ +1
2๐๐(๐๐ โ 1) ๐ ๐ +1 โค๐๐๐ ๐ +1
2๐๐(๐๐ โ 1) ๐ ๐ +1
โป2๐๐(๐๐ โ 1)ๅใฎ2SAT็ตใใใฉใณใใ ใซ๏ผ๐๐็ฏใๆใๅบใใฆในใใขใไฝใใจใใฎๆๅคงๆฐใจ ใใฎไธญใซ็นๅฎใฎ๐ ๐ โ 1ๅใฎๅคๆฐใๅซใพใใฆใใ็ขบ็ ๐๐ ๐ ๐ + 1,๐๐,2๐๐(๐๐ โ 1) ใฎไธ้ใฏ
E ๐๐ ๐ถ๐ถ; ๐ก๐ก,๐ข๐ข โค ๐๐๐ ๐ +1/ 2๐๐ ๐๐ โ 1 ๐ ๐ +1
E ๐๐ = ๏ฟฝE ๐๐ ๐ถ๐ถ; ๐ก๐ก,๐ข๐ข โค๏ฟฝ 2๐ ๐ +1๐ ๐ โฅ0
๐ ๐ ๐ ๐ โ 1 ๐๐๐ ๐ ๐๐
2๐๐ ๐๐ โ 1
๐ ๐ +1=
2๐๐
๐๐๐๐ โ 1 โ๐๐
3
๐๐ > ๐๐๐๐, ๐๐ > 1 ใซใใใ 2๐๐๐๐๐๐ใฎๅ ่ถณ็ขบ็= 0 ใงใใ โ ๅฐใชใใจใ ๐ ๐ ๐๐๐๐๐๐๐ ๐ ใฎๆๅพ ๅคใๅธธใซ 1 ใซๆผธ่ฟใใ
๐๐2 ๐๐ โ ๐๐3/4 ,๐๐ โฅ Pr ๐๐ = 0 โฅ 1 โ ๐๐ ๐๐โ1/4
1 โ ๐๐ ๐๐โ1/4
๐๐
Proof of Theorem C p.53
๐ก๐ก = ๐๐1/5 ๐๐ = ๐๐ + ๐๐5/6 ใใซใจใใฐใ
๐ก๐ก โ ๐ ๐ ๐๐๐๐๐๐๐ ๐ ๅใ ใ ๐๐2 ๐๐,๐๐ ใใใ้ญๅฉใซๆผใไธใใใใ๏ผ
Pr (๐๐ > 0) โฅ E๐๐ 2/ E๐๐2 โthe second moment principleโ
1 โ E๐๐ 2/ E๐๐2 โฅ 1 โ Pr ๐๐ > 0 = Pr (๐๐ = 0)
๐๐ ๐๐โ130 โฅ 1 โ Pr ๐๐ > 0 = Pr (๐๐ = 0)
E ๐๐2
E ๐๐ 2 = ๏ฟฝ๐๐๐๐
2๐ก๐ก
๐๐=0
2๐๐(๐๐ โ 1)๐๐
๐๐
1 + ๐๐๐ก๐ก2
๐๐= ๐๐
๐ก๐ก4
๐๐= ๐๐ ๐๐โ1/30
given any chain ๐๐1, โฆ , ๐๐๐ก๐ก, โฆ ๐๐2๐ก๐กโ1 , with ๐ ๐ = 2๐ก๐ก โ 1 and ๐๐๐ก๐ก in the middle, generates ๐๐1ฬ โจ ๐๐2 , ๐๐2ฬ โจ ๐๐3 , ..., ๐๐๏ฟฝฬ ๏ฟฝ๐ โ1 โจ ๐๐๐ ๐ together with ๐๐๐ก๐ก โจ ๐๐1 and ๐๐๏ฟฝฬ ๏ฟฝ๐ โจ ๐๐๏ฟฝฬ ๏ฟฝ๐ก .
๐ก๐ก โsnake, which is the special case (๐ถ๐ถ; ๐ก๐ก,โ๐ก๐ก) of a (2๐ก๐ก โ 1) โsnare.
๐๐๐ถ๐ถ= [ each clause of (๐ถ๐ถ; ๐ก๐ก,โ๐ก๐ก) occurs exactly once ] ๐๐ = ๏ฟฝ๐๐๐ถ๐ถ
๐๐2 ๐๐ + ๐๐5/6 ,๐๐ = ๐๐ ๐๐โ1/30
๐๐๐๐ ๐๐ + ๐๐5/6 ๐๐ + ๐๐3/4
โฮ ๐๐1/4 ๐๐ ๐๐โ1/30
(97)
(95)
p.50
Stirling ๆฐ 1.2.6
๐ฅ๐ฅใฎ็ดฏไนใง่กจ็พใใใฆใใๅค้ ๅผใใ๏ผ ไบ้ ไฟๆฐใง่กจ็พใใใฆใใๅค้ ๅผใธใฎๅคๆใงไฝฟใใใไฟๆฐ
๐๐๐๐ : ๐๐ๆฌใฎ้่ทฏใใใค๐๐ๅใฎๆๅญใฎ้ ๅ ็ฌฌไธ็จฎ
๐๐๐๐
: ๐๐ๅใฎ่ฆ็ด ใๆใค้ๅใ ๐๐ๅใฎ่ฆ็ด ใๆใค ็ฐใชใ้จๅ้ๅใซๅๅฒใใๆนๆณใฎๆฐ
็ฌฌไบ็จฎ
้ไนๅชโ้ๅธธใฎๅช
้ๅธธใฎๅชโ้ไนๅช
๐ฅ๐ฅ๐๐ = ๐ฅ๐ฅ ๐ฅ๐ฅ โ 1 โฆ (๐ฅ๐ฅ โ ๐๐ + 1) = ๏ฟฝ โ1 ๐๐โ๐๐ ๐๐๐๐
๐๐
๐ฅ๐ฅ๐๐
๐ฅ๐ฅ๐๐ = ๏ฟฝ ๐๐๐๐
๐๐
๐ฅ๐ฅ๐๐
Resolution p.54
๐๐ = 123๏ฟฝ , 234๏ฟฝ , 341,41๏ฟฝ2, 1๏ฟฝ2๏ฟฝ3, 2๏ฟฝ3๏ฟฝ4, 3๏ฟฝ4๏ฟฝ1๏ฟฝ , 4๏ฟฝ12๏ฟฝ axiom
resolvent clause In-degree 2
directed acyclic graph (dag) โResolution proof of ๐๐โ
โresolution refutation. โ 123 12๏ฟฝ4
1๏ฟฝ24๏ฟฝ 1๏ฟฝ2๏ฟฝ3๏ฟฝ
12 12๏ฟฝ
1๏ฟฝ2๏ฟฝ 1๏ฟฝ2
1
1๏ฟฝ
๐๐
Algorithm D and refutation tree p.55
we can prove the empty clause by resolution from ๐น๐น|๏ฟฝฬ ๏ฟฝ๐ฅ iff we can prove ๐ฅ๐ฅ by resolution from ๐น๐น without resolving on ๐ฅ๐ฅ.
if ๐น๐น has no short refutation tree, Algorithm D cannot conclude those unsatisfiable unless it runs for a long time.
exercise 224 ๐น๐น|๐ฅ๐ฅ ๏ฟฝใ็ธฎๆธใใฆๅพใใใใฉใใซใฏ๏ผ
ๅ ใ ใฎ๐น๐นใใใฎใใฎใงใฏใชใใฆใ๏ผ ใใฎ็ฅๅ ใฎ่ใฎไธญใซ ๐ฅ๐ฅ ใๅซใพใใฆใใ้ใ๏ผ
ๆ นใฏ ๐ฅ๐ฅ ใ ๐๐ ใจใชใ๏ผ
Fig.39.
Fig.48.
๏ผณ๏ผก๏ผดใๅ้งในใใใใฎ ๆๅฐๅๅ้กใซ็ฝฎใๆฟใใ๏ผ
Prover-Delayer game p.55
Pudlรกk, Pavel, and Russell Impagliazzo. "A lower bound for DLL algorithms for k-SAT." (1999).
P 12๏ฟฝ,1๏ฟฝ3๏ฟฝ, 1๏ฟฝ2๏ฟฝ3
D ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
P ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
D ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 end ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 end ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
P ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
D end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น end end end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ end end ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น
P proved
Prover-Delayer game p.55
Pudlรกk, Pavel, and Russell Impagliazzo. "A lower bound for DLL algorithms for k-SAT." (1999).
P 12๏ฟฝ,1๏ฟฝ3๏ฟฝ, 1๏ฟฝ2๏ฟฝ3
D ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
P ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
D ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 end ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 end ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
P ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
D end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น end end end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ end end ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น
P proved
Proverใฏ๏ผๆ็ญใง็ขบๅฎใซSATใจใชใใใใซ โ ๅคๆฐใฎ้ธๆ้ ไฝใๅฎฃ่จใใ. โกDelayerใ * ใ้ธๆใใ้ใฎ ๅฒใๅฝใฆ็ๅฝใๅฎฃ่จใใ๏ผ
Delayerใฏ๏ผใใ้ซๅพ็นใๅพใใใใใใซ โ ใชใในใ*ใๅฎฃ่จใใ. โกใฒใผใ ใ็ถ็ถใใ=UNSATใซใSATใซใใชใใชใ ็ๅฝๅฒใๅฝใฆใๅฎ็พใใ๏ผ
Proverใใในใฆใฎๅคๆฐใๅฎฃ่จใ็ตใใๅใซ,ใใค่ชคใฃใฆใฒใผใ ใ็ตไบใใใฆใใพใๅใซ๏ผDelayerใไฝ็น็ฒๅพใงใใฆใใใใๅ่ฒ ๏ผ
Prover-Delayer game p.55
P 12๏ฟฝ,1๏ฟฝ3๏ฟฝ, 1๏ฟฝ2๏ฟฝ3
D ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
P ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
D ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น * 1P * 1P * 1P
P ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
D ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น
* 1P * 1P * 1P * 1P
P Proved
If the Delayer has a strategy that guarantees a score of at least ๐๐ points, every refutation tree has at least 2๐๐ leaves; hence at least 2๐๐ โ 1 resolutions must be done, and every backtrack-based solver needs ฮฉ 2๐๐ operations to declare the clauses unsatisfiable.
Proverใ่ฟทใใไธๆนใ้ธใฐใใใๅพใชใ็ถๆณใง๏ผ Delayerใ * ๅฎฃ่จใใๆฆ็ฅ
Theorem R p.56
P
D
* 1P
๐๐๐๐โ3 ๐๐ = ๐๐1, โฆ ,
๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ ,
(๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ โจ ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ โจ ๐ฅ๐ฅ๐๐๐๐),
(๐ฅ๐ฅ๐๐1 โจ ๐ฅ๐ฅ๐๐2 โจ โฏโจ ๐ฅ๐ฅ๐๐๐๐)
for 1 โค ๐๐ โค ๐๐; (99)
for 1 โค ๐๐, ๐๐, ๐๐ โค ๐๐; (100)
for 1 โค ๐๐ โค ๐๐. (101)
irreflexive
transitive โ๐๐ โบ ๐๐ โ is a partial ordering.
Prover ใฏ๐๐ๅบๅฎใง้ ใซๆตใใฆใใ๏ผ
for every ๐๐, there's a ๐๐ with ๐๐ โบ ๐๐
๐๐2variables ๐ฅ๐ฅ๐๐๐๐, for 1 โค ๐๐, ๐๐ โค ๐๐, the incidence matrix for a binary relation โ๐๐ โบ ๐๐ โ
๐ฅ๐ฅ11 โฏ ๐ฅ๐ฅ1๐๐โฎ โฑ โฎ
๐ฅ๐ฅ๐๐1 โฏ ๐ฅ๐ฅ๐๐๐๐
๐ฅ๐ฅโโ ๐๐
๐๐
(99)(100)(101)็ฏใฎ้ฉ็จโใใฎไธญใซๆฅตๅคงๅคใๆใใชใ{1, โฆ ,๐๐}ใฎๅ้ ๅบ้ๅใฎๅญๅจ โใในใฆใฎ็ฏใSATใซใฏ ใชใๅพใชใใ ๐๐ โ 1็นใพใงๅฟ ใๅใใๆฆ็ฅใใใ๏ผ
ใใฎๆ็นใง Delayer ใ๏ผ๐๐ ็น็ฒๅพใใฆใใใจใใๆ Proverใซ้ธใฐใใ ๅคๆฐใฎๅฑฅๆญด้ๅใ ๐๐
๐ฅ๐ฅ๐๐๐๐
if ๐๐ = ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐ if ๐๐ = ๐๐๐๐ โ ๐๐, ๐๐ = ๐๐๐๐ โ ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐
๐ฅ๐ฅ๐๐๐๐ โ 0 ๐ฅ๐ฅ๐๐๐๐ โ 0 ๐ฅ๐ฅ๐๐๐๐ โ 1 ๐ฅ๐ฅ๐๐๐๐ โ ๐๐ < ๐๐ ๐ฅ๐ฅ๐๐๐๐ โโ
Proverใฎๅฒใๅฝใฆใ็ๅฝใซๅฟใใฆ๏ผ๐๐๐๐โ2 ใซ ๐๐ ใ ๐๐ ใๅฎ็พฉ๏ผ ๅพ็นใ ๐ ๐ + 1 ใธๅคๆด. (101)็ฏใฏ๏ผใใฎๆ็นใพใง Falseใซใชใใใจใใชใ.
Every refutation tree for the clauses (99) ,(100), (101)
represents at least 2๐๐โ1 โ 1 resolution steps.
Lower bounds for general resolution. p.57
4.6.3 ๅ ็ฎ้ฃ้ 1 = ๐๐0, ๐๐1, โฆ , ๐๐๐๐= ๐๐ ใใ ใๅ่ฆ็ด ใฏ๏ผใในใฆใฎ i=1,2,โฆ,r ใซใคใใฆ ใใ ๐๐ โค ๐๐ < ๐๐ ใซๅฏพใใฆ๏ผ ๐๐๐๐ = ๐๐๐๐ + ๐๐๐๐
7.1.2 ๐ต๐ต๐ต๐ต๐ต๐ต๐๐๐ ๐ ้ฃ้ ๐๐ๅคๆฐ(๐ฅ๐ฅ1,โฆ,๐ฅ๐ฅ๐๐)ใฎ้ขๆฐใฎ๐ต๐ต๐ต๐ต๐ต๐ต๐๐๐ ๐ ้ฃ้ใจใฏ๏ผ ๅในใใใใงๅ ็ซใคในใใใใฎ๏ผใคใ ็ตใถใใใชๅ(๐ฅ๐ฅ๐๐+1, โฆ , ๐ฅ๐ฅ๐๐+๐๐)ใงใใ๏ผ ๐ฅ๐ฅ๐๐ = ๐ฅ๐ฅ๐๐(๐๐) โ๐๐ ๐ฅ๐ฅ๐๐ ๐๐ , ๐๐ + 1 โค ๐๐ โค ๐๐ + ๐๐ ใซใคใใฆ๏ผ
Itโs a refutation chain for ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐ if ๐ถ๐ถ๐๐+๐๐ = ๐๐.
The short clauses are crucial if we want short chains.
If ๐ฅ๐ฅ๐๐๐๐ means that pigeon ๐๐ occupies hole ๐๐, there is relevant unsatisfiable clauses for resolution in general.
p.58
Lemma B. ๐ผ๐ผ : any sequence of clauses ๐ค๐ค ๐ผ๐ผ โถ "๐ค๐ค๐๐๐ค๐ค๐ก๐ก๐" the length of its longest clause or clauses
๐ค๐ค ๐ผ๐ผ0 โข ๐๐ : the min. of ๐ค๐ค ๐ผ๐ผ over all refutation chains ฮฑ = ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐+๐๐ for ๐ผ๐ผ0 ๐ผ๐ผ0 โข ๐๐ : the minimum length ๐๐ of all such chains.
๐ผ๐ผ0 = ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐
๐ผ๐ผ0 โข ๐๐ โฅ ๐ ๐ ๐ค๐ค ๐ผ๐ผ0โข๐๐ โ1 2 8๐๐โ โ 2 , for clauses in ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 2 variables.
Thus thereโs exponential growth if ๐ค๐ค ๐ผ๐ผ0 = ๐๐ 1 , and ๐ค๐ค ๐ผ๐ผ0 โข ๐๐ = ฮฉ ๐๐ .
๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 ็นๅฎใฎใชใใฉใซใฏ ๐๐๐๐/(2๐๐) ๅใงใฆใใ๏ผ ๐๐ = 1 โ๐๐/(2๐๐) ใง ๅค๐๐ ใงๅ้งใใ๐ผ๐ผ0ใซใฏ ้ซใ ๐๐๐๐ ๅใฎfatใช็ฏ๏ผ ๐๐ < ๐๐โ๐๐ ใชๆดๆฐ ๐๐ ใซๅฏพใใฆ๏ผ๐ผ๐ผ0 ใฎๅ้ง ๐ฝ๐ฝ,๐ฝ๐ฝ0 ,๐ฝ๐ฝ1,๐ฝ๐ฝ2,๐ฝ๐ฝ3ใไปฅไธใฎใใใซๅฎ็พฉ๏ผ
๐๐ > 0,๐ผ๐ผ0|๐๐,ใ๐ค๐ค ๐ฝ๐ฝ0 โค ๐๐ + ๐๐ โ 1 ๐ฝ๐ฝ = ๐ฝ๐ฝ1,๐ฝ๐ฝ2,๐ฝ๐ฝ3 with ๐ผ๐ผ0|๐๐ ,ฬ
๐ค๐ค ๐ฝ๐ฝ = max ๐ค๐ค ๐ฝ๐ฝ0 + 1,๐ค๐ค ๐ฝ๐ฝ2 ,๐ค๐ค ๐ฝ๐ฝ3 โค max ๐๐ + ๐๐ ,๐ค๐ค ๐ผ๐ผ0 ,๐๐ + ๐๐ = ๐๐ + ๐๐
Exercise 238 : ๐๐ = 12๐๐
, ๐๐ = ๐๐ , ๐๐ = 2๐๐ ln ๐๐ , ใชใ ๐๐ โค ๐๐ < ๐๐โ๐๐. ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 2, ๐๐ โฅ 2 ใง ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 , ๐ค๐ค ๐ผ๐ผ0 โข ๐๐ โค ๐๐ + ๐๐ โค 8๐๐ ln ๐๐ + 1
๐๐ ๐๐
p.58 Restricted pigeonhole principle ๐๐ = ๐๐0,๐๐1, โฆ ,๐๐๐๐
๐ต๐ต = ๐๐1, ๐๐2, โฆ , ๐๐๐๐
ไบ้จใฐใฉใใฎ้จๅ้ๅ๐๐โฒใซใใใฆ ใใใใ
๐๐๐๐ใฎ้ๅใๅฟ ใๅฏพใจใชใ๐๐โฒใฎ้จๅ้ๅใไธ
ใคใฏๆใฃใฆใใใใใชๅข็้ ๅ
a bipartite graph ๐บ๐บ0 on those vertices for which each ๐๐๐๐ has degree โค 5 and such that the following strong "expansion" condition is satisfied as follows.
All refutation chains for ๐ผ๐ผ ๐บ๐บ0 have length expฮฉ ๐๐ if we can prove that they all have width ฮฉ ๐๐ .
the pigeonhole clauses are unsatisfiable if we also require ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ whenever ๐๐๐๐ ๐๐๐๐ in ๐บ๐บ0.
(106)(107)ใๆกไปถใซใใคๅ จใฆใฎ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ ใใๅธฐ็ตใใ็ฏใ๐ผ๐ผ ๐บ๐บ0 ใจใใใจ๏ผ
๐ค๐ค ๐ผ๐ผ ๐บ๐บ0 โค 5 ใจใชใ๏ผ็นๅฎใใใใซๆฎใๅคๆฐ๐ฅ๐ฅ๐๐๐๐ ใฏ้ซใ 5๐๐ + 5 ๅใงใใ๏ผ
Resolution p.54
๐๐ = 123๏ฟฝ , 234๏ฟฝ , 341,41๏ฟฝ2, 1๏ฟฝ2๏ฟฝ3, 2๏ฟฝ3๏ฟฝ4, 3๏ฟฝ4๏ฟฝ1๏ฟฝ , 4๏ฟฝ12๏ฟฝ axiom
resolvent clause In-degree 2
directed acyclic graph (dag) โResolution proof of ๐๐โ
โresolution refutation. โ 123 12๏ฟฝ4
1๏ฟฝ24๏ฟฝ 1๏ฟฝ2๏ฟฝ3๏ฟฝ
12 12๏ฟฝ
1๏ฟฝ2๏ฟฝ 1๏ฟฝ2
1
1๏ฟฝ
๐๐
Algorithm D and refutation tree p.55
we can prove the empty clause by resolution from ๐น๐น|๏ฟฝฬ ๏ฟฝ๐ฅ iff we can prove ๐ฅ๐ฅ by resolution from ๐น๐น without resolving on ๐ฅ๐ฅ.
if ๐น๐น has no short refutation tree, Algorithm D cannot conclude those unsatisfiable unless it runs for a long time.
exercise 224 ๐น๐น|๐ฅ๐ฅ ๏ฟฝใ็ธฎๆธใใฆๅพใใใใฉใใซใฏ๏ผ
ๅ ใ ใฎ๐น๐นใใใฎใใฎใงใฏใชใใฆใ๏ผ ใใฎ็ฅๅ ใฎ่ใฎไธญใซ ๐ฅ๐ฅ ใๅซใพใใฆใใ้ใ๏ผ
ๆ นใฏ ๐ฅ๐ฅ ใ ๐๐ ใจใชใ๏ผ
Fig.39.
Fig.48.
๏ผณ๏ผก๏ผดใๅ้งในใใใใฎ ๆๅฐๅๅ้กใซ็ฝฎใๆฟใใ๏ผ
Prover-Delayer game p.55
Pudlรกk, Pavel, and Russell Impagliazzo. "A lower bound for DLL algorithms for k-SAT." (1999).
P 12๏ฟฝ,1๏ฟฝ3๏ฟฝ, 1๏ฟฝ2๏ฟฝ3
D ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
P ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
D ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 end ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 end ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
P ๐๐F,๐น๐น3๏ฟฝ,๐น๐น๐น๐น3 ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
D end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น end end end ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ end end ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น
P proved
Prover-Delayer game p.55
P 12๏ฟฝ,1๏ฟฝ3๏ฟฝ, 1๏ฟฝ2๏ฟฝ3
D ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
P ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐๐2๏ฟฝ,๐น๐น3๏ฟฝ,๐น๐น2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3 ๐น๐น2๏ฟฝ,๐๐3๏ฟฝ,๐๐2๏ฟฝ3
D ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น * 1P * 1P * 1P
P ๐๐T,๐น๐น3๏ฟฝ ,๐น๐น๐๐3 ๐๐2๏ฟฝ,๐น๐น๐๐,๐น๐น2๏ฟฝ๐น๐น ๐น๐น๐๐,๐๐3๏ฟฝ,๐๐๐๐3 ๐น๐น2๏ฟฝ,๐๐๐น๐น,๐๐2๏ฟฝ๐๐ ๐น๐น2๏ฟฝ,๐๐๐๐,๐๐2๏ฟฝ๐น๐น
D ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐๐T,๐น๐น๐๐,๐น๐น๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น ๐น๐น๐๐,๐๐๐น๐น,๐๐๐๐๐๐ ๐น๐น๐๐,๐๐๐๐,๐๐๐๐๐น๐น
* 1P * 1P * 1P * 1P
P Proved
If the Delayer has a strategy that guarantees a score of at least ๐๐ points, every refutation tree has at least 2๐๐ leaves; hence at least 2๐๐ โ 1 resolutions must be done, and every backtrack-based solver needs ฮฉ 2๐๐ operations to declare the clauses unsatisfiable.
Proverใ่ฟทใใไธๆนใ้ธใฐใใใๅพใชใ็ถๆณใง๏ผ Delayerใ * ๅฎฃ่จใใๆฆ็ฅ
Theorem R p.56
P
D
* 1P
๐๐๐๐โ3 ๐๐ = ๐๐1, โฆ ,
๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ ,
(๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ โจ ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐๐๐ โจ ๐ฅ๐ฅ๐๐๐๐),
(๐ฅ๐ฅ๐๐1 โจ ๐ฅ๐ฅ๐๐2 โจ โฏโจ ๐ฅ๐ฅ๐๐๐๐)
for 1 โค ๐๐ โค ๐๐; (99)
for 1 โค ๐๐, ๐๐, ๐๐ โค ๐๐; (100)
for 1 โค ๐๐ โค ๐๐. (101)
irreflexive
transitive โ๐๐ โบ ๐๐ โ is a partial ordering.
Prover ใฏ๐๐ๅบๅฎใง้ ใซๆตใใฆใใ๏ผ
for every ๐๐, there's a ๐๐ with ๐๐ โบ ๐๐
๐๐2variables ๐ฅ๐ฅ๐๐๐๐, for 1 โค ๐๐, ๐๐ โค ๐๐, the incidence matrix for a binary relation โ๐๐ โบ ๐๐ โ
๐ฅ๐ฅ11 โฏ ๐ฅ๐ฅ1๐๐โฎ โฑ โฎ
๐ฅ๐ฅ๐๐1 โฏ ๐ฅ๐ฅ๐๐๐๐
๐ฅ๐ฅโโ ๐๐
๐๐
(99)(100)(101)็ฏใฎ้ฉ็จโใใฎไธญใซๆฅตๅคงๅคใๆใใชใ{1, โฆ ,๐๐}ใฎๅ้ ๅบ้ๅใฎๅญๅจ โใในใฆใฎ็ฏใSATใซใฏ ใชใๅพใชใใ ๐๐ โ 1็นใพใงๅฟ ใๅใใๆฆ็ฅใใใ๏ผ
ใใฎๆ็นใง Delayer ใ๏ผ๐๐ ็น็ฒๅพใใฆใใใจใใๆ Proverใซ้ธใฐใใ ๅคๆฐใฎๅฑฅๆญด้ๅใ ๐๐
๐ฅ๐ฅ๐๐๐๐
if ๐๐ = ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐ if ๐๐ = ๐๐๐๐ โ ๐๐, ๐๐ = ๐๐๐๐ โ ๐๐ if ๐๐ โ ๐๐, ๐๐ โ ๐๐
๐ฅ๐ฅ๐๐๐๐ โ 0 ๐ฅ๐ฅ๐๐๐๐ โ 0 ๐ฅ๐ฅ๐๐๐๐ โ 1 ๐ฅ๐ฅ๐๐๐๐ โ ๐๐ < ๐๐ ๐ฅ๐ฅ๐๐๐๐ โโ
Proverใฎๅฒใๅฝใฆใ็ๅฝใซๅฟใใฆ๏ผ๐๐๐๐โ2 ใซ ๐๐ ใ ๐๐ ใๅฎ็พฉ๏ผ ๅพ็นใ ๐ ๐ + 1 ใธๅคๆด. (101)็ฏใฏ๏ผใใฎๆ็นใพใง Falseใซใชใใใจใใชใ.
Every refutation tree for the clauses (99) ,(100), (101)
represents at least 2๐๐โ1 โ 1 resolution steps.
Lower bounds for general resolution. p.57
4.6.3 ๅ ็ฎ้ฃ้ 1 = ๐๐0, ๐๐1, โฆ , ๐๐๐๐= ๐๐ ใใ ใๅ่ฆ็ด ใฏ๏ผใในใฆใฎ i=1,2,โฆ,r ใซใคใใฆ ใใ ๐๐ โค ๐๐ < ๐๐ ใซๅฏพใใฆ๏ผ ๐๐๐๐ = ๐๐๐๐ + ๐๐๐๐
7.1.2 ๐ต๐ต๐ต๐ต๐ต๐ต๐๐๐ ๐ ้ฃ้ ๐๐ๅคๆฐ(๐ฅ๐ฅ1,โฆ,๐ฅ๐ฅ๐๐)ใฎ้ขๆฐใฎ๐ต๐ต๐ต๐ต๐ต๐ต๐๐๐ ๐ ้ฃ้ใจใฏ๏ผ ๅในใใใใงๅ ็ซใคในใใใใฎ๏ผใคใ ็ตใถใใใชๅ(๐ฅ๐ฅ๐๐+1, โฆ , ๐ฅ๐ฅ๐๐+๐๐)ใงใใ๏ผ ๐ฅ๐ฅ๐๐ = ๐ฅ๐ฅ๐๐(๐๐) โ๐๐ ๐ฅ๐ฅ๐๐ ๐๐ , ๐๐ + 1 โค ๐๐ โค ๐๐ + ๐๐ ใซใคใใฆ๏ผ
Itโs a refutation chain for ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐ if ๐ถ๐ถ๐๐+๐๐ = ๐๐.
The short clauses are crucial if we want short chains.
If ๐ฅ๐ฅ๐๐๐๐ means that pigeon ๐๐ occupies hole ๐๐, there is relevant unsatisfiable clauses for resolution in general.
p.58
Lemma B. ๐ผ๐ผ : any sequence of clauses ๐ค๐ค ๐ผ๐ผ โถ "๐ค๐ค๐๐๐ค๐ค๐ก๐ก๐" the length of its longest clause or clauses
๐ค๐ค ๐ผ๐ผ0 โข ๐๐ : the min. of ๐ค๐ค ๐ผ๐ผ over all refutation chains ฮฑ = ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐+๐๐ for ๐ผ๐ผ0 ๐ผ๐ผ0 โข ๐๐ : the minimum length ๐๐ of all such chains.
๐ผ๐ผ0 = ๐ถ๐ถ1, โฆ ,๐ถ๐ถ๐๐
๐ผ๐ผ0 โข ๐๐ โฅ ๐ ๐ ๐ค๐ค ๐ผ๐ผ0โข๐๐ โ1 2 8๐๐โ โ 2 , for clauses in ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 2 variables.
Thus thereโs exponential growth if ๐ค๐ค ๐ผ๐ผ0 = ๐๐ 1 , and ๐ค๐ค ๐ผ๐ผ0 โข ๐๐ = ฮฉ ๐๐ .
๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 ็นๅฎใฎใชใใฉใซใฏ ๐๐๐๐/(2๐๐) ๅใงใฆใใ๏ผ ๐๐ = 1 โ๐๐/(2๐๐) ใง ๅค๐๐ ใงๅ้งใใ๐ผ๐ผ0ใซใฏ ้ซใ ๐๐๐๐ ๅใฎfatใช็ฏ๏ผ ๐๐ < ๐๐โ๐๐ ใชๆดๆฐ ๐๐ ใซๅฏพใใฆ๏ผ๐ผ๐ผ0 ใฎๅ้ง ๐ฝ๐ฝ,๐ฝ๐ฝ0 ,๐ฝ๐ฝ1,๐ฝ๐ฝ2,๐ฝ๐ฝ3ใไปฅไธใฎใใใซๅฎ็พฉ๏ผ
๐๐ > 0,๐ผ๐ผ0|๐๐,ใ๐ค๐ค ๐ฝ๐ฝ0 โค ๐๐ + ๐๐ โ 1 ๐ฝ๐ฝ = ๐ฝ๐ฝ1,๐ฝ๐ฝ2,๐ฝ๐ฝ3 with ๐ผ๐ผ0|๐๐ ,ฬ
๐ค๐ค ๐ฝ๐ฝ = max ๐ค๐ค ๐ฝ๐ฝ0 + 1,๐ค๐ค ๐ฝ๐ฝ2 ,๐ค๐ค ๐ฝ๐ฝ3 โค max ๐๐ + ๐๐ ,๐ค๐ค ๐ผ๐ผ0 ,๐๐ + ๐๐ = ๐๐ + ๐๐
Exercise 238 : ๐๐ = 12๐๐
, ๐๐ = ๐๐ , ๐๐ = 2๐๐ ln ๐๐ , ใชใ ๐๐ โค ๐๐ < ๐๐โ๐๐. ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 2, ๐๐ โฅ 2 ใง ๐๐ โฅ ๐ค๐ค ๐ผ๐ผ0 , ๐ค๐ค ๐ผ๐ผ0 โข ๐๐ โค ๐๐ + ๐๐ โค 8๐๐ ln ๐๐ + 1
๐๐ ๐๐
p.60 SAT solving via resolution. by E. W.Samson and R. K. Mueller in 1955.
๐น๐น โ {1234,12๏ฟฝ , 1๏ฟฝ2๏ฟฝ3๏ฟฝ , 1๏ฟฝ3,23๏ฟฝ , 34๏ฟฝ}
123
โ 12
1๏ฟฝ2๏ฟฝ 1๏ฟฝ2
1๏ฟฝ 1
๐๐
โ ๐น๐นโ
โ ๐ฅ๐ฅ
๐๐๐ ๐๐๐๐ ๐๐๐๐ SAT is the problem of evaluating the quantified formula
โ๐ฅ๐ฅ1 โฆโ๐ฅ๐ฅ๐๐โ1โ๐ฅ๐ฅ๐๐๐น๐น ๐ฅ๐ฅ1, โฆ , ๐ฅ๐ฅ๐๐โ1, ๐ฅ๐ฅ๐๐
where ๐น๐น is a Boolean function given in CNF as a conjunction of clauses.
How to transform the CNF for ๐น๐น into the CNF for ๐น๐น๐ in the reduced problem ?
โ๐ฅ๐ฅ1 โฆโ๐ฅ๐ฅ๐๐โ1๐น๐น๐ ๐ฅ๐ฅ1, โฆ , ๐ฅ๐ฅ๐๐โ1 , ๐น๐น๐ ๐ฅ๐ฅ1, โฆ , ๐ฅ๐ฅ๐๐โ1 =
๐น๐น ๐ฅ๐ฅ1, โฆ , ๐ฅ๐ฅ๐๐โ1, 0 โจ ๐น๐น ๐ฅ๐ฅ1, โฆ , ๐ฅ๐ฅ๐๐โ1, 1 .
, .
.
Suppose clauses of contain and clauses contain . Then the elimination of will give us at most new clauses, in the worst case;
so will have no more clauses than did, whenever , namely when . * This condition clearly holds whenever or ; or , and even when .
Therefore repeated elimination of variables doesn't always cause the set of clauses to explode.In the worst case, however, it can be quite inefficient.
p.61 Algorithm I. ๐ถ๐ถ1 โง โฏโง ๐ถ๐ถ๐๐ : ๐๐ nonempty clauses on ๐๐ Boolean variables ๐ฅ๐ฅ1 โฆ ๐ฅ๐ฅ๐๐
1972, Stephen Cook (๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐๐๐๐๐๐๐ข๐ข๐ ๐ ๐ ๐ ๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐)
๐ถ๐ถ1 ๐ถ๐ถ2 ๐ถ๐ถ3 ๐ถ๐ถ4 ๐ถ๐ถ5 ๐ถ๐ถ6 ๐ถ๐ถ7 ๐ถ๐ถ8 ๐ถ๐ถ9 ๐ถ๐ถ10 ๐ถ๐ถ11๐ถ๐ถ๐๐ ๐ถ๐ถ๐๐
1234 12๏ฟฝ 1๏ฟฝ2๏ฟฝ3๏ฟฝ 1๏ฟฝ3 23๏ฟฝ 34๏ฟฝ
๐ค๐ค ๐๐1 ๐๐2 ๐๐3 ๐๐4
3 2 1
1๏ฟฝ 2๏ฟฝ3๏ฟฝ
2 2๏ฟฝ 23๏ฟฝ
1๏ฟฝ2๏ฟฝ3๏ฟฝ
12๏ฟฝ
3๏ฟฝ
1 3๏ฟฝ 4๏ฟฝ 1๏ฟฝ 2๏ฟฝ 1234
2
12๏ฟฝ
134
1 1๏ฟฝ3
34
๐ถ๐ถ12
4 34๏ฟฝ 3
3
๐๐
3๏ฟฝ
I3.I4.
I5.
๐น๐น
๐๐๐๐ :Choose a literal that occurs most frequently in the set of currently unsatisfied clauses that have the fewest unspecified literals.
Algorithm I is to minimize the number of resolution steps, but tends to fill memory with a great many new clauses when it is applied to large problems, and there's no obvious way to deal with those clauses efficiently.
p.63
123,234,345,456,567,678,789,135,246,357,468,579,147,258,369,159, 1๏ฟฝ2๏ฟฝ3๏ฟฝ, 2๏ฟฝ3๏ฟฝ4๏ฟฝ, 3๏ฟฝ4๏ฟฝ5๏ฟฝ, 4๏ฟฝ5๏ฟฝ6๏ฟฝ, 5๏ฟฝ6๏ฟฝ7๏ฟฝ, 6๏ฟฝ7๏ฟฝ8๏ฟฝ, 7๏ฟฝ8๏ฟฝ9๏ฟฝ, 1๏ฟฝ3๏ฟฝ5๏ฟฝ, 2๏ฟฝ4๏ฟฝ6๏ฟฝ, 3๏ฟฝ5๏ฟฝ7๏ฟฝ, 4๏ฟฝ6๏ฟฝ8๏ฟฝ, 5๏ฟฝ7๏ฟฝ9๏ฟฝ, 1๏ฟฝ4๏ฟฝ7๏ฟฝ, 2๏ฟฝ5๏ฟฝ8๏ฟฝ, 3๏ฟฝ6๏ฟฝ9๏ฟฝ, 1๏ฟฝ5๏ฟฝ9๏ฟฝ.
๐ค๐ค๐๐๐ ๐ ๐๐๐ค๐ค๐ ๐ ๐๐(3,3; 9)
0 โค ๐น๐น < ๐๐ = 18
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 ๐ฟ๐ฟ3 ๐ฟ๐ฟ4 ๐ฟ๐ฟ5 ๐ฟ๐ฟ6 ๐ฟ๐ฟ7 ๐ฟ๐ฟ8 ๐ฟ๐ฟ9 ๐ฟ๐ฟ10 ๐ฟ๐ฟ11 ๐ฟ๐ฟ12 ๐ฟ๐ฟ13 ๐ฟ๐ฟ14 ๐ฟ๐ฟ15 ๐ฟ๐ฟ16 ๐ฟ๐ฟ17 trail
6๏ฟฝ 9๏ฟฝ 2 ๐๐ 3
396 246
5
546
8
846
2๏ฟฝ
2๏ฟฝ5๏ฟฝ8๏ฟฝ
7๏ฟฝ
7๏ฟฝ5๏ฟฝ3๏ฟฝ reason
level
ฮ
1
ฮ
2
4๏ฟฝ
ฮ
3
depends directly on
depends on
Every conflict allows to construct a new clause ๐๐ that is true whenever the existing clauses are ๐ ๐ ๐๐๐ก๐ก,
with โlearning" ๐๐ by adding it to the existing clauses, we will find a solution or learn ๐๐.
Conflict clause ๐๐ on level 3
CDCL: toward algorithm C.
p.64
45๏ฟฝ68๏ฟฝ
New clause ๐๐โฒ
45๏ฟฝ6
46 ๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 ๐ฟ๐ฟ3 ๐ฟ๐ฟ4 ๐ฟ๐ฟ5 ๐ฟ๐ฟ6 ๐ฟ๐ฟ7 ๐ฟ๐ฟ8 ๐ฟ๐ฟ9 ๐ฟ๐ฟ10 ๐ฟ๐ฟ11 ๐ฟ๐ฟ12 ๐ฟ๐ฟ13 ๐ฟ๐ฟ14 ๐ฟ๐ฟ15 ๐ฟ๐ฟ16 ๐ฟ๐ฟ17
trail reason
level
6๏ฟฝ 4 5 9 8 2 2๏ฟฝ 1๏ฟฝ 7๏ฟฝ 3๏ฟฝ ฮ ฮ 46 369 678 123 3๏ฟฝ4๏ฟฝ5๏ฟฝ 5๏ฟฝ7๏ฟฝ9๏ฟฝ 1๏ฟฝ5๏ฟฝ9๏ฟฝ 2๏ฟฝ5๏ฟฝ8๏ฟฝ
1 2
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 ๐ฟ๐ฟ3 ๐ฟ๐ฟ4 ๐ฟ๐ฟ5 ๐ฟ๐ฟ6 ๐ฟ๐ฟ7 ๐ฟ๐ฟ8 ๐ฟ๐ฟ9 ๐ฟ๐ฟ10 ๐ฟ๐ฟ11 ๐ฟ๐ฟ12 ๐ฟ๐ฟ13 ๐ฟ๐ฟ14 ๐ฟ๐ฟ15 ๐ฟ๐ฟ16 ๐ฟ๐ฟ17 trail
6๏ฟฝ 9๏ฟฝ 2 ๐๐ 3 396 246
5 546
8 846
2๏ฟฝ 2๏ฟฝ5๏ฟฝ8๏ฟฝ
7๏ฟฝ 7๏ฟฝ5๏ฟฝ3๏ฟฝ reason
level
ฮ
1
ฮ
2
Conflict clause ๐๐ on level 3
4๏ฟฝ ฮ
3
135๏ฟฝ8๏ฟฝ โ 135๏ฟฝ67โ 35๏ฟฝ679๏ฟฝ โ 35๏ฟฝ69๏ฟฝ โ 35๏ฟฝ6โ 4๏ฟฝ5๏ฟฝ6โ 5๏ฟฝ6
Setting ๐ฟ๐ฟ2 โ 5๏ฟฝ ,now forces 7, 1๏ฟฝ,3,9,2๏ฟฝ,8๏ฟฝ,8, all at level 1; finally learn the ๐ข๐ข๐๐๐๐๐ก๐ก ๐๐๐๐๐๐๐ข๐ข๐ ๐ ๐ ๐ 6
CDCL: toward algorithm C.
p.64
๐๐ ฬ ๐๐ trail
reason
Initial conflict clause
๐๐๏ฟฝฬ ๏ฟฝ๐๏ฟฝ1..๐๐๏ฟฝ๐๐..๐๐๏ฟฝ๐๐
๐๐ array
. . . . .
๐๐1 โ ๐๐1
๐๐๏ฟฝ1 . . . ๐๐๏ฟฝ๐๐
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 ๐ฟ๐ฟ3 ๐ฟ๐ฟ4 ๐ฟ๐ฟ๐ก๐ก ๐ฟ๐ฟ9 โฆ . . . . . .
counter 1 . . .
level ๐ค๐ค ๐ค๐คโ
๐ฟ๐ฟ๐ก๐ก๐๐๐๏ฟฝ1..๐๐๐๏ฟฝ ๐๐ ..๐๐๐๏ฟฝ๐๐โฒ
๐๐๐๐๐
๐๐๏ฟฝ๐๐
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 ๐ฟ๐ฟ3 ๐ฟ๐ฟ4 ๐ฟ๐ฟ๐ก๐ก ๐ฟ๐ฟ9 โฆ trail
๐๐1 ๐๐ ฬ ๐๐ ๐๐๐ ๐ reason
stamp
๐๐๏ฟฝฬ ๏ฟฝ๐๏ฟฝ1..๐๐๏ฟฝ๐๐..๐๐๏ฟฝ๐๐
๐๐ array
level ๐ค๐ค ๐ค๐คโ
. . .
๐๐๐๐ . . . . . . . .
๐๐๏ฟฝ1 . . . ๐๐๏ฟฝ๐๐
๐ ๐ . .
. . .
counter 1 . . .
๐๐๐๐
๐ฟ๐ฟ๐ก๐ก๐๐๐๏ฟฝ1..๐๐๐๏ฟฝ ๐๐ ..๐๐๐๏ฟฝ๐๐โฒ
๐๐๐๐๐
๐๐๏ฟฝ๐๐
๐ฟ๐ฟ๐ก๐ก ๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 โฆ trail
๐๐1 ๐๐ reason
stamp
๐๐ array
level ๐ค๐ค ๐ค๐คโ
. . .
๐๐๐๐ . . . . .
๐ ๐ . .
. . .
counter 1
๐ฟ๐ฟ๏ฟฝ๐ก๐ก
๐ฟ๐ฟ๐ก๐ก
๐ฟ๐ฟ๏ฟฝ๐ก๐ก๐๐๏ฟฝ1..๐๐๏ฟฝ๐๐
. . . ๐๐๏ฟฝ1 ๐๐๏ฟฝ๐๐
Stamp.
Eventually the count of unresolved literals decrease to 1 ; the learned clause is then ๐ฟ๐ฟ๏ฟฝ๐ก๐ก โจ ๐๐๏ฟฝ1 โจ โฏโจ ๐๐๏ฟฝ๐๐ .
But the learned clauses by the efficient resolution steps might turn out to be quite large.
๐๐1 . . . ๐๐๐๐ ๐๐๐ ๐
stamp ๐ ๐ . . ๐๐
๐๐๐๐
Redundancy of CDCL p.65
a CDCL solver was applied to the 2779 clauses of ๐ค๐ค๐๐๐ ๐ ๐๐๐ค๐ค๐ ๐ ๐๐(3, 10; 97), after about 10,000 clauses had been learned.
the clauses learned unsat had an average length of 19.9 โ 11.2 ; simplification run about 33% faster.
that decision eventually lead to a conflict when trying to set ๐ณ๐ณ๐๐๐๐.
The complexity of a CDCL is devoted to unit propagation. Key is the value of a literal forced by previous assignments .
Exercise 257.
A literal ๐๐โฒ๏ฟฝ is said to be ๐๐๐ ๐ ๐ค๐ค๐ข๐ข๐๐๐ค๐ค๐๐๐๐๐ก๐ก, w.r.t. a given clause ๐๐ and the current trail, (i) ๐๐ is defined at level 0, or (ii) ๐๐ is not a decision literal and every false literal in ๐๐'s reason is either in ๐๐ or (recursively) redundant.
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 โฆ trail
๐๐ reason
stamp
๐๐ array
level
1
๐ค๐ค ๐ค๐คโ
. . . ๐ ๐
. . .
๐๐๐๏ฟฝ
๐ฟ๐ฟ๐ก๐ก
๐๐๐๏ฟฝ๐๐๏ฟฝ1..๐๐๏ฟฝ4
. . . ๐๐๏ฟฝ1 ๐๐๏ฟฝ4
conflict clause ๐๐
the reason for ๐๐4 = ๐๐4 โจ ๐๐๏ฟฝ1 โจ ๐๐๏ฟฝ1 ,
the reason for ๐๐1 = ๐๐1 โจ ๐๐๏ฟฝ2 โจ ๐๐๏ฟฝ2 the reason for ๐๐2 = ๐๐2 โจ ๐๐๏ฟฝ1 โจ ๐๐๏ฟฝ3 .
๐๐4 is redundant, because ๐๐๏ฟฝ2 and ๐๐๏ฟฝ1 are redundant.
a) Suppose ๐๐ = ๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจ โฏโจ ๐๐๏ฟฝ๐๐ is a newly learned clause. Prove that if ๐๐๏ฟฝ๐๐ โ ๐๐ is redundant, some other ๐๐๏ฟฝ๐๐ โ ๐๐ became false on the same level of the trail as ๐๐๐๐ did.
b) Devise an efficient algorithm that discovers all of the redundant literals ๐๐๏ฟฝ๐๐ in a given newly learned clause ๐๐ = ๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจ โฏโจ ๐๐๏ฟฝ๐๐ Hint: Use stamps.
p.155
Answer to Exercise 257 (b). p.233
b) Devise an efficient algorithm that discovers all of the redundant literals ๐๐๏ฟฝ๐๐ in a given newly learned clause ๐๐ = ๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจ โฏโจ ๐๐๏ฟฝ๐๐ Hint: Use stamps. We can assume that the stamp value ๐๐ used when resolving conflicts is a multiple of ๐๐, and that all stamps are โค ๐๐. Then we can stamp literal ๐๐ with S ๐๐ โ ๐ ๐ + 1 if ๐๐ ฬ is known to be redundant, or ๐ ๐ + 2 if ๐๐ ๏ฟฝ is known to be nonredundant and not in ๐๐. (These stamps serve as a 'โmemo cache" to avoid repeated work.) While building ๐๐ we can also stamp levels as well as literals, setting LS[๐ค๐ค๐] โ ๐ ๐ if level ๐ค๐ค๐ has exactly one of the ๐๐๐๐ , or ๐ ๐ + 1 if it has more than one. Then for 1 โค ๐๐ โค ๐๐, ๐๐๐๐ is redundant if and only if LS ๐๐๐ ๐ ๐๐ ๐๐๐๐ โ ๐ ๐ + 1 and ๐๐๐ ๐ ๐ค๐ค ๐๐๏ฟฝ๐๐ is true, where ๐๐๐ ๐ ๐๐(๐๐) = VAL ๐๐ โซ1 and where ๐๐๐ ๐ ๐ค๐ค(๐๐) is the following recursive procedure: โ If ๐๐ is a decision literal, return false. Otherwise let ๐๐ โจ ๐๐๏ฟฝ1 โจ โฏโจ ๐๐๏ฟฝ๐๐ be ๐๐๐s reason. For 1 โค ๐๐ โค ๐๐ with ๐๐๐ ๐ ๐๐ ๐๐๐๐ > 0, if S ๐๐๐๐ = s + 2 return false; if S ๐๐๐๐ < s and either LS ๐๐๐ ๐ ๐๐ ๐๐๐๐ < ๐ ๐ or ๐๐๐ ๐ ๐ค๐ค ๐๐๏ฟฝ๐๐ is false, set S ๐๐๐๐ โ ๐ ๐ + 2 and return false . But if none of these conditions hold, S ๐๐ โ ๐ ๐ + 1 and return true. โ
๐๐
๐ ๐ + 1 ๐ ๐ + 2
๐ฟ๐ฟ0 ๐ฟ๐ฟ1 ๐ฟ๐ฟ2 โฆ trail
reason
stamp : S( )
๐๐ array
level : ๐๐๐ ๐ ๐๐( )
1
๐ค๐ค ๐ค๐คโ
. . . ๐ ๐
. . .
๐๐๐๏ฟฝ
๐ฟ๐ฟ๐ก๐ก
๐๐๐๏ฟฝ๐๐๏ฟฝ1..๐๐๏ฟฝ๐๐
. . . ๐๐๏ฟฝ1 ๐๐๏ฟฝ๐๐
LS( ) ๐ ๐ ๐ ๐ + 1
conflict clause ๐๐
๐๐๐๐
Algorithm C p.68+69
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
-1
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
c8.[Backjump.]
c9.[Learn.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐ while ๐น๐น > ๐๐๐๐โฒ+1
๐น๐น โ ๐น๐น โ 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )๐๐ โ ๐ฟ๐ฟ๐น๐น๐๐ โ ๐๐ OVAL(๐๐) โ VAL ๐๐๐ ๐ ๐๐ โ ฮ if HLOC ๐๐ < 0 insert ๐๐ into HEAP.
๐บ๐บ โ ๐น๐น๐ค๐ค โ ๐ค๐ค๐
set ๐๐ โMAXLIf ๐ค๐ค > 0
store the new clause in MEM at position ๐๐advance MAXL to the next available position in MEM
๐๐ โ๐๐ + 1๐ฟ๐ฟ๐น๐น โ ๐๐๐ TLOC( ๐๐๐ )โ ๐น๐น๐ ๐ ๐๐โฒ โ ๐๐๐น๐น โ ๐น๐น + 1 DELโDEL/๐๐
Given a set of clauses on ๐๐ Boolean variables, this algorithm finds a solution ๐ฟ๐ฟ0๐ฟ๐ฟ1 โฆ ๐ฟ๐ฟ๐๐โ1 if and only if the clauses are satisfiable,
meanwhile discovering ๐๐ new ones that are consequences of the originals. After discovering ๐๐p new clauses, it will purge some of them from its memory and reset ๐๐p ;
after discovering ๐๐f of them, it will flush part of its trail, reset ๐๐f , and start over. (Details of purging and flushing will be discussed later.)
p.66+67
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
๐๐ โ 1 ๐๐ โ 2
๐๐ โ 3
๐๐ โ 4
๐๐ โ 5
c1.[Initialize]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
A monolithic array MEM hold all of the literals in all of the clauses Each clause ๐๐ = ๐๐0 โจ ๐๐1 โจ โฏโจ ๐๐๐๐โ1 with ๐๐ > 1 is represented by its starting position in MEM , with MEM ๐๐ + ๐๐ = ๐๐๐๐ for 0 โค ๐๐ < ๐๐.
Its two watched literals are ๐๐0 and ๐๐1, and its size ๐๐ is stored in MEM [๐๐ โ 1].
MAXL is set equal to MINL, the smallest cell in MEM that is available for learned clauses; then MAXL grows as new clauses are added to the repertoire.
๐ฅ๐ฅ๐๐ and ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐ , for 1 โค ๐๐ โค ๐๐, are represented by 2๐๐ and 2๐๐ + 1 each of these 2๐๐ literals ๐๐ has a list pointer ๐๐๐๐, which begins a linked list of the clauses in which ๐๐ is watched.
And We have ๐๐๐๐ = 0 if there is no such clause; but if ๐๐๐๐ = ๐๐ > 0, the next link in this "watch list" is in MEM [๐๐ โ 2] if ๐๐ = ๐๐0, in MEM [๐๐ โ 3]if ๐๐ = ๐๐1.
๐ฅ๐ฅ๐๐ for 1 โค ๐๐ โค ๐๐ has six current attributes
S(๐๐) is the "stamp"
If neither ๐ฅ๐ฅ๐๐ ๐๐๐ต๐ต๐๐ ๏ฟฝฬ ๏ฟฝ๐ฅ๐๐ appears in the current trail, then VAL ๐๐ = โ1, and we say that ๐๐๐๐ and its two literals are "free."
But if ๐ฟ๐ฟ๐ก๐ก = ๐๐ is a literal of the trail, belonging to level ๐ค๐ค, we have
VAL ๐๐ โค 2๐ค๐ค + ๐๐ &1 and TLOC ๐๐ = ๐ก๐ก where ๐๐ = ๐๐ โซ 1,
and we say that ๐๐ is "true" and ๐๐ ฬ is "false." Thus a given literal ๐๐ is false if and only if
VAL ๐๐ is nonnegative and VAL(|๐๐|) + ๐๐ is odd.
๐ฅ๐ฅ๐๐ has an activity score ACT(๐๐), which heuristically estimates its desirability for branching.
All of the free variables, and possibly others, are kept in an array called HEAP, which is arranged so that
ACT HEAP ๐๐ โค ACT HEAP ๐๐ โ 1 โซ 1 for 0 < ๐๐ < ๐
the variable DEL holds the current scaling factor ๐๐โ๐๐ , divided by 10100each time all of the activities have been rescaled. where ๐๐ is a damping factor (say ๐๐ = .95)
OVAL(๐๐), to control the polarity of each new decision Algorithm ๐ช๐ช starts by simply making each OVAL ๐๐ odd, Afterwards it sets OVAL ๐๐ โVAL ๐๐ whenever ๐ฅ๐ฅ๐๐ leaves the trail and becomes free
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
๐๐ โ 1 ๐๐ โ 2
๐๐ โ 3
๐๐ โ 4
๐๐ โ 5
c1.[Initialize]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
Exercise 260: Describe in detail step C1's setting-up of MEM, the watch lists, and the trail.
First, to get a random permutation in the heap we can use a variant of Algorithm 3.4.2P: For ๐๐ โ 1, 2, โฆ ,๐๐, let ๐๐ be a random integer in [0 . . ๐๐ โ 1] and set HEAP[๐๐ โ 1] โHEAP[๐๐], HEAP[ ๐๐ ] โ ๐๐. Then set HLOC HEAP [ ๐๐ ] โ ๐๐ for 0 โค ๐๐ < ๐๐. Next, set ๐น๐น โ 0 and ๐๐๐๐ โ 0 for 2 โค ๐๐ โค 2๐๐ + 1 and ๐๐ โ 3. Do the following for each input clause ๐๐0๐๐1 โฆ ๐๐๐๐โ1: Terminate unsuccessfully if ๐๐ = 0, or if ๐๐ = 1 and 0 โคVAL ๐๐0 โ ๐๐0 & 1. If ๐๐ = 1 and VAL ๐๐0 < 0 , set VAL ๐๐0 โ ๐๐0 & 1, TLOC ๐๐0 โ ๐น๐น , ๐น๐น โ ๐น๐น + 1. If ๐๐ > 1, set MEM ๐๐ + ๐๐ โ ๐๐0 for 0 โค ๐๐ < ๐๐ ; also MEM ๐๐ โ 1 โ ๐๐, MEM ๐๐ โ 2 โ ๐๐๐๐0, ๐๐๐๐0 โ ๐๐, MEM ๐๐ โ 3 โ ๐๐๐๐1, ๐๐๐๐1 โ ๐๐, ๐๐ โ ๐๐ + ๐๐ + 3, Finally, set MINL โ MAXL โ ๐๐ + 2 (allowing two cells for extra data in the preamble of the first learned clause). Of course we must also ensure that MEM is large enough.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c5.[New level? ]
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ โ ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c7.[Resolve a conflict.]
c5.[New level? ]
Exercise 261: The main loop of Algorithm C is the unit-propagation process of steps C3 and C4. Describe the low-level details of link adjustment, etc., to be done in those steps.
(Throughout this answer, ๐๐๐๐ is an abbreviation for MEM ๐๐ + ๐๐ .) Set ๐๐ โ 0 and ๐๐ โ ๐๐๐๐ฬ . While ๐๐ โ 0, do the following: Set ๐๐๐ โ ๐๐0. If ๐๐โฒ โ ๐๐ ฬ (hence ๐๐1 = ๐๐)ฬ , set ๐๐๐ โ ๐๐โ3 ; otherwise set ๐๐๐ โ ๐๐1, ๐๐0โ ๐๐๐, ๐๐1 โ ๐๐ ฬ , ๐๐๐ โ ๐๐โ2, ๐๐โ2 โ ๐๐โ3, and ๐๐โ3โ ๐๐๐. If VAL ๐๐0 โฅ 0 and VAL ๐๐0 + ๐๐0 is even (that is, if ๐๐0 is true), perform the steps if ๐๐ โ 0, set MEM ๐๐ โ 3 โ ๐๐, else set ๐๐๐๐ฬ โ ๐๐ ; then set ๐๐ โ ๐๐. * Otherwise set ๐๐ โ 2; while ๐๐ < ๐๐โ1 and VAL ๐๐๐๐ โฅ 0 and VAL ๐๐๐๐ + ๐๐๐๐ is odd, set ๐๐ = ๐ฝ๐ฝ + 1. If now ๐๐ < ๐๐โ1, set ๐๐1 โ ๐๐๐๐, ๐๐๐๐ โ ๐๐,ฬ ๐๐โ3 โ ๐๐๐๐1 , ๐๐๐๐1 โ ๐๐. But if ๐๐ = ๐๐โ1, do(*) above; jump to C7 if VAL ๐๐0 โฅ 0 ; otherwise set ๐ฟ๐ฟ๐น๐น โ ๐๐0, etc. (see step C4) and ๐๐ โ ๐๐๐. Finally, when ๐๐ = 0, do(*) above to terminate ๐๐โฬ s new watch list.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c7.[Resolve a conflict.]
c5.[New level? ]
Reason
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c7.[Resolve a conflict.]
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c7.[Resolve a conflict.]
Exercise 262 : What low-level operations underlie changes to the heap in steps C6-C8?
Otherwise set ๐๐ โ HEAP ๐ , ๐ผ๐ผ โACT ๐๐ , ๐๐ โ 0, ๐๐๐ โ 1, and do the following while ๐๐๐ < ๐: Set ๐ผ๐ผ๐ โ ACT HEAP ๐๐๐ ; if ๐๐๐ + 1 < ๐ and ACT HEAP ๐๐โฒ + 1 > ฮฑโฒ, set ๐๐โฒ โ ๐๐๐ + 1 and ๐ผ๐ผ๐ โ ACT HEAP ๐๐๐ ; if ๐ผ๐ผ > ๐ผ๐ผ๐, set ๐๐๐ โ ๐, otherwise set HEAP[ ๐๐ ] โ HEAP[๐๐๐], HLOC HEAP[ ๐๐๐ ] โ ๐๐ , ๐๐ โ ๐๐๐, and ๐๐๐ โ 2๐๐ + 1. Then set HEAP[ ๐๐] โ ๐๐ and HLOC(๐๐ ) โ ๐๐.
To delete ๐๐ = HEAP 0 in C6: Set ๐ โ ๐ โ 1 and HLOC ๐๐ โ โ1. Stop if ๐ = 0.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )In C7, set ๐๐ โ ๐๐ , ๐ผ๐ผ โ ACT(๐๐), ACT( ๐๐) โ ฮฑ +DEL, ๐๐ โ HLOC(๐๐), and if ๐๐ > 0 perform the "siftup" operation: "Looping repeatedly, set ๐๐๐ โ (๐๐ โ 1) โซ 1 and ๐๐ โHEAP[๐๐๐], exit if ACT(๐๐) โฅ ฮฑ, else set HEAP ๐๐ โ ๐๐, HLOC(๐๐) โ ๐๐ , ๐๐ โ ๐๐๐, and exit if ๐๐ = 0. Then set HEAP[ ๐๐] โ ๐๐ and HLOC(๐๐) โ ๐๐."
Exercise 262 : What low-level operations underlie changes to the heap in steps C6-C8?
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
-1
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
c8.[Backjump.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐ while ๐น๐น > ๐๐๐๐โฒ+1
๐น๐น โ ๐น๐น โ 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )๐๐ โ ๐ฟ๐ฟ๐น๐น๐๐ โ ๐๐ OVAL(๐๐) โ VAL ๐๐๐ ๐ ๐๐ โ ฮ if HLOC ๐๐ < 0 insert ๐๐ into HEAP.
๐บ๐บ โ ๐น๐น๐ค๐ค โ ๐ค๐ค๐
Exercise 262 : What low-level operations underlie changes to the heap in steps C6-C8?
To insert ๐๐ in C8, set ๐ผ๐ผ โ ACT(๐๐), ๐๐ โ ๐, ๐ โ ๐ + 1; if ๐๐ = 0 set HEAP 0 โ ๐๐ and HLOC(๐๐) โ 0; otherwise perform the siftup operation.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )
Exercise 263: Write out the gory details by which step C7 constructs a new clause and step C9 puts it into the data structures of Algorithm C.
(This answer also sets the level stamps LS [๐ค๐ค] needed in answer 257, assuming that the LS array is initially zero.) Let โ bump ๐๐ " mean โ increase ACT ๐๐ by DEL" as in answer 262. Also let ๐๐๐๐๐๐๐ก๐ก(๐๐) be the following subroutine: "If S ๐๐ = ๐ ๐ , do nothing. Otherwise set S ๐๐ โ ๐ ๐ , ๐๐ โ ๐๐๐ ๐ ๐๐ (๐๐). If ๐๐ > 0, bump ๐๐ ; then if ๐๐ = ๐ค๐ค, set ๐๐ โ ๐๐ + 1; else set ๐๐ โ ๐๐ + 1, ๐๐๐๐ โ ๐๐,ฬ ๐ค๐ค๐ โ max (๐ค๐ค๐,๐๐), and if LS[๐๐] โค ๐ ๐ set LS ๐๐ โ ๐ ๐ + LS[๐๐] = ๐ ๐ ."
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )
Exercise 263: Write out the gory details by which step C7 constructs a new clause and step C9 puts it into the data structures of Algorithm C.
When step C7 is entered from C4, assuming that ๐ค๐ค > 0, set ๐ค๐ค๐ โ ๐๐ โ ๐๐ โ 0, ๐ ๐ โ ๐ ๐ + 3, S( ๐๐0 ) โ ๐ ๐ , bump ๐๐0, and do ๐๐๐๐๐๐๐ก๐ก(๐๐๐๐) for 1 โค ๐๐ < ๐๐. Also set ๐ก๐ก โ max ( TLOC ๐๐1 ,โฆ,TLOC ๐๐๐๐โ1 ). Then, while ๐๐ > 0, set ๐๐ โ ๐๐๐ก๐ก, ๐ก๐ก โ ๐ก๐ก โ 1; if S ๐๐ = ๐ ๐ then set ๐๐ โ ๐๐ โ 1, and if ๐ ๐ ๐๐ โ ฮ let clause ๐ ๐ ๐๐ be ๐๐0๐๐1 โฆ ๐๐๐๐โ1 and do ๐๐๐๐๐๐๐ก๐ก(๐๐๐๐) for 1 โค ๐๐ < ๐๐. Finally set ๐๐โฒ โ ๐ฟ๐ฟ๐ก๐ก , and while S ๐๐๐ โ ๐ ๐ set ๐ก๐ก โ ๐ก๐ก โ 1 and ๐๐โฒ โ ๐ฟ๐ฟ๐ก๐ก.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
-1
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
c8.[Backjump.]
c9.[Learn.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐ while ๐น๐น > ๐๐๐๐โฒ+1
๐น๐น โ ๐น๐น โ 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )๐๐ โ ๐ฟ๐ฟ๐น๐น๐๐ โ ๐๐ OVAL(๐๐) โ VAL ๐๐๐ ๐ ๐๐ โ ฮ if HLOC ๐๐ < 0 insert ๐๐ into HEAP.
๐บ๐บ โ ๐น๐น๐ค๐ค โ ๐ค๐ค๐
set ๐๐ โMAXLIf ๐ค๐ค > 0
store the new clause in MEM at position ๐๐advance MAXL to the next available position in MEM
๐๐ โ๐๐ + 1๐ฟ๐ฟ๐น๐น โ ๐๐๐ TLOC( ๐๐๐ )โ ๐น๐น๐ ๐ ๐๐โฒ โ ๐๐๐น๐น โ ๐น๐น + 1 DELโDEL/๐๐
Exercise 263: Write out the gory details by which step C7 constructs a new clause and step C9 puts it into the data structures of Algorithm C.
The new clause can now be checked for redundancies as in answer 257. To install it during step C9, there's a subtle point: We must watch a literal that was defined on level ๐ค๐ค๐. Thus we set ๐๐ โ MAXL, MEM[๐๐] โ ๐๐ ฬ ๐ , ๐๐ โ 0, ๐๐ ๐ โ 1; and for 1 โค ๐๐ โค ๐๐ if S ๐๐๐๐ = ๐ ๐ set ๐๐ โ ๐๐ + 1 and do this: If ๐๐๐ = 0 or ๐๐๐ ๐ ๐๐( ๐๐๐๐ ) < ๐ค๐ค๐, Set MEM[๐๐ + ๐๐ + ๐๐๐] โ ๐๐๏ฟฝ๐๐๏ผ otherwise set MEM[๐๐ + 1] โ ๐๐๏ฟฝ๐๐, ๐๐๐ โ 0, MEM ๐๐ โ 2 โ ๐๐๐๐โฒ๏ฟฝ , ๐๐๐๐โฒ๏ฟฝ โ ๐๐, MEM[๐๐ โ 3] โ ๐๐๐๐๏ฟฝ๐๐, ๐๐๐๐๏ฟฝ๐๐ โ ๐๐. Finally set MEM[๐๐ โ 1] โ ๐๐ + 1, MAXLโ ๐๐ + ๐๐ + 6.
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
c7.[Resolve a conflict.]
Exercise 266 : CDCL solvers are often designed to make decisions at random, with a small probability ๐๐ (say ๐๐ = .02), instead of always choosing a variable of maximum activity. How would this policy change step C6?
If ๐๐ < ๐๐, where ๐๐ is a uniform deviate between 0 and 1, do this:
Set ๐๐ to a random integer with 0 โค ๐๐ < ๐, and ๐๐ โHEAP[๐๐]. If ๐๐ = 0, or if VAL(๐๐) โฅ 0, use the normal C6.
Otherwise branch on ๐๐ (and don't bother to remove ๐๐ from the heap).
Reality check
Random choices make the running time of this algorithm more variable than it was in Algorithms A, B, D, or L; sometimes we're lucky, sometimes we're not.
The running time of Algorithms A, B, D, and L on ๐๐๐ ๐ ๐๐๐๐๐๐๐๐(๐๐) is proportional to 2๐๐, so it's way off the chart well over a gigamem already when ๐๐ = 19. But Algorithm C polishes off the case ๐๐ = 99 in that same amount of time (thus winning by 24 orders of magnitude)! On the other hand, no satisfactory theoretical explanation for the apparently linear behavior in Fig. is presently known.
Computation times (in megamems) are shown for nine trials at each value of ๐๐.
Algorithm C often speeds things up much more dramatically, in fact. For example, how it whips through a sequence of three-coloring problems based on "flower snarks."
It is not possible to color the edges of the flower snark graph ๐ฝ๐ฝ๐๐ with three colors, when ๐๐ is odd.
p.69
Algorithm C p.68
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
-1
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
c8.[Backjump.]
c9.[Learn.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐ while ๐น๐น > ๐๐๐๐โฒ+1
๐น๐น โ ๐น๐น โ 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )๐๐ โ ๐ฟ๐ฟ๐น๐น๐๐ โ ๐๐ OVAL(๐๐) โ VAL ๐๐๐ ๐ ๐๐ โ ฮ if HLOC ๐๐ < 0 insert ๐๐ into HEAP.
๐บ๐บ โ ๐น๐น๐ค๐ค โ ๐ค๐ค๐
set ๐๐ โMAXLIf ๐ค๐ค > 0
store the new clause in MEM at position ๐๐advance MAXL to the next available position in MEM
๐๐ โ๐๐ + 1๐ฟ๐ฟ๐น๐น โ ๐๐๐ TLOC( ๐๐๐ )โ ๐น๐น๐ ๐ ๐๐โฒ โ ๐๐๐น๐น โ ๐น๐น + 1 DELโDEL/๐๐
Algorithm C p.68+69
(๐๐๐๐๐ก๐ก๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ก๐ก๐ฆ๐ฆ ๐๐๐ฆ๐ฆ ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ฟ๐ฟ).
0 0 0 0 1 0 -1 -1 -1 0
-1
MEM[ ] ๐๐ S(๐๐) VAL(๐๐) OVAL(๐๐) TLOC(๐๐) HLOC(๐๐) ACT(๐๐) HEAP[ ]
c1.[Initialize]
c2.[Level
complete?]
c3.[Advance ๐บ๐บ.]
c4.[Does ๐๐ force a unit? ]
c5.[New level? ]
c6.[Make a decision.]
c7.[Resolve a conflict.]
c8.[Backjump.]
c9.[Learn.]
๐น๐น๐บ๐บ๐ฟ๐ฟ ๐๐๐ ๐ ๐๐๐ค๐ค๐๐๐๐ ๐ ๐
๐ ๐ 2๐๐ โ ๐ ๐ 2๐๐+1 โ ฮ๐๐๐๐ โ 1 ๐๐๐๐ โ 1 โ ๐๐1 โค ๐๐ โค ๐๐
MINL andMAXLto 1st available position
๐๐0 โ 0
DEL ๐
๐๐
๐ฟ๐ฟ0 โฆ ๐ฟ๐ฟ๐น๐นโ1 contains allliterals
forced by ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐บโ1if ๐บ๐บ = ๐น๐น
๐๐ โ ๐ฟ๐ฟ๐บ ๐บ๐บ = ๐บ๐บ + 1
for all c in the watch list of ๐๐ ฬ
๐๐0๐๐1...๐๐๐๐โ1be the literals of clause ๐๐, where ๐๐1=๐๐.ฬ (Swap ๐๐0โ ๐๐1if necessary. )โ๐๐๐ญ๐๐๐ญ๐ฌ ๐ ๐๐จ๐ง๐๐ฅ๐ข๐๐ญ if no conflict โ
if ๐๐0 is true โ otherwise๐ฅ๐จ๐จ๐ค ๐๐จ๐ซ ๐ ๐ฅ๐ข๐ญ๐๐ซ๐๐ฅ ๐๐with 1 < ๐๐ < ๐๐ that is not falsefound โ ๐๐2...๐๐๐๐โ1all false
๐๐0 false โ ๐๐0 free๐ฆ๐จ๐ฏ๐ ๐ to the watch list of ๐๐๐๐
๐ฆ๐๐ค๐ ๐ข๐ญ ๐ญ๐ซ๐ฎ๐ ๐๐ฒ ๐๐๐๐๐๐๐๐ ๐ฟ๐ฟ๐น๐น โ ๐๐0 TLOC( ๐๐0 ) โ ๐น๐นVAL( ๐๐0 ) โ 2๐ค๐ค+ ๐๐0&1๐ ๐ ๐๐0 โ ๐๐๐น๐น โ ๐น๐น + 1
if ๐น๐น = ๐๐ โ if ๐๐ โฅ ๐๐p โ if ๐๐ โฅ ๐๐f
terminatesuccesfully
prepare topurge excess
clauses
flush literalsas expected
โ otherwise
๐ค๐ค โ ๐ค๐ค + 1๐๐๐๐ โ ๐น๐น.
๐๐ โHEAP 0delete k from the heap
if VAL ๐๐ โฅ 0 โ๐ต๐ต๐ก๐ก๐๐ ๐ ๐๐๐ค๐ค๐๐๐ ๐ ๐ ๐
๐๐ โ 2๐๐ + OVAL ๐๐ &1 VAL(๐๐) โ 2๐ค๐ค + OVAL ๐๐ &1 ๐ฟ๐ฟ๐น๐น โ ๐๐
TLOC( ๐๐ )โ ๐น๐น๐ ๐ ๐๐ โ ฮ๐น๐น โ ๐น๐น + 1if ๐ค๐ค = 0 โ otherwise
terminateunsuccesfully
use the conflict clause ๐๐to construct๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โจโฆโจ ๐๐๏ฟฝ๐๐
ACT( ๐๐ )โ ACT( ๐๐ ) +DELfor all literals ๐๐ stamped set d' to the max. level
occupied by ๐๐1, โฆ ,๐๐๐๐ while ๐น๐น > ๐๐๐๐โฒ+1
๐น๐น โ ๐น๐น โ 1
๐๐ฎ๐ญ ๐๐ข๐ฌ๐ญ๐ข๐ง๐๐ญ ๐ฎ๐ง๐ข๐ญ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into ๐ฟ๐ฟ0 โฆ๐ฟ๐ฟ๐น๐นโ1But ๐ญ๐๐ซ๐ง๐ข๐ฆ๐๐ญ๐ ๐ฎ๐ง๐ฌ๐ฎ๐๐๐๐ฌ๐๐ฎ๐ฅ๐ฅ๐ฒ
if clause ๐๐ and ๐๐๐contradiction
๐ข๐ง๐ฉ๐ฎ๐ญ ๐ญ๐ก๐ ๐๐ฅ๐๐ฎ๐ฌ๐๐ฌ into MEMand the watch list
๐๐1 โฆ๐๐๐๐ is a random permutation of 1,โฆ ,๐๐
(Increasing ACT ๐๐ may change HEAP. )๐๐ โ ๐ฟ๐ฟ๐น๐น๐๐ โ ๐๐ OVAL(๐๐) โ VAL ๐๐๐ ๐ ๐๐ โ ฮ if HLOC ๐๐ < 0 insert ๐๐ into HEAP.
๐บ๐บ โ ๐น๐น๐ค๐ค โ ๐ค๐ค๐
set ๐๐ โMAXLIf ๐ค๐ค > 0
store the new clause in MEM at position ๐๐advance MAXL to the next available position in MEM
๐๐ โ๐๐ + 1๐ฟ๐ฟ๐น๐น โ ๐๐๐ TLOC( ๐๐๐ )โ ๐น๐น๐ ๐ ๐๐โฒ โ ๐๐๐น๐น โ ๐น๐น + 1 DELโDEL/๐๐
Given a set of clauses on ๐๐ Boolean variables, this algorithm finds a solution ๐ฟ๐ฟ0๐ฟ๐ฟ1 โฆ ๐ฟ๐ฟ๐๐โ1 if and only if the clauses are satisfiable,
meanwhile discovering ๐๐ new ones that are consequences of the originals. After discovering ๐๐p new clauses, it will purge some of them from its memory and reset ๐๐p ;
after discovering ๐๐f of them, it will flush part of its trail, reset ๐๐f , and start over. (Details of purging and flushing will be discussed later.)
Certificates of unsatisfiability. p.70
if SAT solver report is ๐๐๐ ๐ ๐๐๐๐๐ก๐ก๐๐๐๐๐ ๐ - UNSAT how confident can we be that such a claim is true?
Fig.48.
let ๐ ๐ be Rivest's clauses (6), which were proved unsatisfiable in Fig. 48.
๐ ๐ โง 1๏ฟฝ โง 2๏ฟฝ โข1 3๏ฟฝ โข1 4๏ฟฝ โข1 ๐๐ (using 123๏ฟฝ, 234๏ฟฝ, and 341); ๐ ๐ โง 12 โง 1๏ฟฝ โข1 2 โข1 4๏ฟฝ โข1 3๏ฟฝ โข1 ๐๐ ( using 12, 4๏ฟฝ12๏ฟฝ, 2๏ฟฝ3๏ฟฝ4, and 341); ๐ ๐ โง 12 โง 1 โข1 2๏ฟฝ โข1 4 โข1 3 โข1 ๐๐ (using 41๏ฟฝ2, 234๏ฟฝ, and 3๏ฟฝ4๏ฟฝ1๏ฟฝ); ๐ ๐ โง 12 โง 1 โข1 2 โข1 3 โข1 4 โข1 ๐๐ (using 1๏ฟฝ2๏ฟฝ3, 2๏ฟฝ3๏ฟฝ4, and 3๏ฟฝ4๏ฟฝ1๏ฟฝ).
Then (12, 1, 2, ๐๐) is a certificate of unsatisfiability, because
Theorem G. p.70
๐น๐น โง ๐ถ๐ถ1 โง โฏโง ๐ถ๐ถ๐๐โ1 โง ๏ฟฝฬ ๏ฟฝ๐ถ๐๐ โข1 ๐๐ for 1 โค ๐๐ โค ๐ก๐ก.
โ๐บ๐บ โข1 ๐๐โ : the clauses ๐บ๐บ lead to a contradiction by unit propagation; and if ๐ถ๐ถ๐๐ : the clause ๐๐1,โจ โฏโจ ๐๐๐๐ ๐ถ๐ถ = ๐๐0 and ๐ ๐ ๐๐๐๐ = ๐๐๐๐ โจ ๐๐๐๐ , where all literals of ๐๐0 โช ๐๐1 โช โฏโช ๐๐๐ ๐ are false
If Algorithm C terminates unsuccessfully, the sequence ๐ถ๐ถ1,๐ถ๐ถ2, โฆ ,๐ถ๐ถ๐ก๐ก of clauses that it has learned is a certificate of unsatisfiability.
for a family of clauses ๐น๐น if ๐ถ๐ถ๐ก๐ก = ๐๐,and if we have
๐ถ๐ถโฒ = ๐๐๐๏ฟฝ โจ ๐๐๏ฟฝ1 โฆโจ ๐๐๏ฟฝ๐๐ ,
๐ถ๐ถโฒ = โฆ ๐ถ๐ถ โ ๐ ๐ ๐๐1 โ ๐ ๐ ๐๐2 โ โฏ โ ๐ ๐ ๐๐๐๐
๐ค๐ค๏ฟฝฬ ๏ฟฝ๐ โ ๐๐0 โช โฏโช ๐๐๐๐โ1,ใfor 1 โค ๐๐ โค ๐ ๐ ; ๐๐0 โช ๐๐1 โช โฏโช ๐๐๐ ๐ = ๐๐๐๏ฟฝ, ๐๐1ฬ , โฆ , ๐๐๏ฟฝฬ ๏ฟฝ๐ , ๐๐๏ฟฝ1, โฆ , ๐๐๏ฟฝ๐๐ .
Unit propagations can be done without the "reasonโ, however, ๐ ๐ ๐๐ as the certificate checker purge clauses
that will no longer be relevant to the proof.
p.71+P.157 Exercise 284.
Mark ๐๐, stamp S( ๐๐๐๐ ) โ ๐๐ for 0 โค ๐๐ < ๐๐, set ๐๐ โ max ( TLOC ๐๐1 ,โฆ , TLOC ( ๐๐๐๐โ1 )) . While ๐๐ โฅ ๐ธ๐ธ, we set ๐๐ โ ๐ฟ๐ฟ๐๐, ๐๐ โ ๐๐ โ 1, and if S ( ๐๐ ) = ๐๐ we also "resolve with the reason of ๐๐" as follows: Let clause ๐ ๐ ๐๐ be ๐๐0๐๐1 โฆ ๐๐๐๐โ1, mark ๐ ๐ ๐๐, and set S ๐๐๐๐ โ ๐๐ for 1 โค ๐๐ < ๐๐.
Explain how to use reasons so that clauses are marked by the verifier only if they actually participate in the proof of a marked clause ๐ถ๐ถ๐๐.
VAL(๐๐) โ 0 for 0 โค ๐๐ โค ๐๐, ๐๐0 โ 0: ๐ฟ๐ฟ1 โ ๐๐๏ฟฝ1, โฆ , ๐ฟ๐ฟ๐๐ โ ๐๐๏ฟฝ๐๐, ๐ธ๐ธ โ ๐น๐น โ ๐๐ + 1,๐บ๐บ โ 0, and VAL ๐ฟ๐ฟ๐๐ โ ๐ฟ๐ฟ๐๐ & 1 for 0 โค ๐๐ โค ๐๐;
Give preference to already-marked clauses when doing the unit propagations.
trail
reason
Initial conflict clause
.. ..
array
. . . . .
. . .
. . . . . .
counter . . .
level โ
.. .
. . .
stamp . .
trail
reason
stamp
.. ..
array
level โ
. . .
. . . . . . . .
. . .
. .
. . .
counter . . .
.. .
trail
reason
stamp
array
level โ
. . .
. . . . .
. .
. . .
counter
..
. . .
Algorithm C can inform
*Purging unhelpful clauses. p.71
Algorithm C periodically weed out the clauses that appear to be more harmful than helpful, as soon as it has learned ๐๐ โฅ ๐๐๐๐ clauses and arrived at a reasonably stable state (step C5).
a CDCL solver was applied to the clauses of after about clauses had been learned.
#learned clauses computation time GM
typical run 48,000 800
50,000 500๐๐P = 10000
learned 10002 clauses
6252 clauses actually present in MEM
at most 3126 clauses will be removed by the
purging process
Some clauses had length 2, while the maxi size was 24 and the median was 11;
12 of the 6252 fell into this category; for instance, 30 appeared on level 10 of the trail
because โ 30 33 39 41 42 45 46 48 54 57 โ had been learned, and we may need to know that clause in a future resolution step.
Short clauses tend to be more useful, because they reduce more quickly to units.
literal block distance p.72
Gilles Audemard and Laurent Simon [Proc. Int. Joint Conference on Artificial Intelligence 21 (2009), 399 โ 404].
If ๐ถ๐ถ has signature (๐๐, ๐๐) and ๐ถ๐ถ๐ has signature ๐๐โฒ, ๐๐โฒ , where ๐๐ โค ๐๐โฒand ๐๐ โค ๐๐๐ and (๐๐, ๐๐) โ (๐๐๐ ,๐๐๐),
then ๐ถ๐ถ is more likely than ๐ถ๐ถ๐ to be useful in future propagations.
We can't predict the future, but small (๐๐, ๐๐) tends to
increase the ratio of black to gray.
all the literals of a clause ๐ถ๐ถ = ๐๐1 โจ โฏโจ ๐๐๐๐, positively as ๐๐๐๐ or negatively as ๐๐๏ฟฝฬ ๏ฟฝ๐. where ๐๐ of the levels contain at least one positive ๐๐๐๐
and the other ๐๐ contain nothing but ๐๐๏ฟฝฬ ๏ฟฝ๐. (๐๐, ๐๐) is the ๐ ๐ ๐๐๐๐๐๐๐๐๐ก๐ก๐ข๐ข๐๐๐ ๐ of ๐ถ๐ถ w.r.t the trail, and ๐๐ + ๐๐ level is the literal block distance.
how many of eligible clauses had a given signature (๐๐, ๐๐), for 1 โค ๐๐ โค 7 and 0 โค ๐๐ โค 8;
how many would have been used to resolve future conflict
RANGE( ) and โtie breakersโ p.74
RANGE ๐๐ โ ๐๐๐๐๐๐ 16 ๐๐ + ๐ผ๐ผ๐๐ , 255
When ๐ผ๐ผ has the relatively high value 1516
= .9375, this rule essentially preserves as many clauses of small literal block distance as it can;
and for constant ๐๐ + ๐๐ it favors those with small ๐๐.
to each clause ๐๐; here ๐ผ๐ผ is a parameter, 0 โค ๐ผ๐ผ โค 1. RANGE(๐๐) โ 0 if ๐๐ is the reason for some literal in the trail; RANGE ๐๐ โ 256 if ๐๐ is satisfied at level 0. If there are ๐๐๐๐ clauses of range ๐๐, and if we want to keep at most ๐๐ clauses in memory, we find the largest ๐๐ โค 256 such that
๐๐๐๐ > 0 and ๐ ๐ ๐๐ = ๐๐0 + ๐๐1 + โฏ+ ๐๐๐๐โ1 โค ๐๐. Then we retain all clauses for which RANGE(๐๐) < ๐๐, together with ๐๐ โ ๐ ๐ ๐๐ "tie breakers" that have RANGE(๐๐) = ๐๐ (unless ๐๐ = 256).
safely resolve conflicts on several different levels later, learning new clauses at that time.
A full trail allows us to compute signatures based on VAL fields.
tie breakers with โactivityโ p.74
learned 10002 clauses
6252 clauses actually present in MEM
at most 3126 clauses will be removed by the
purging process
For example, with ๐ผ๐ผ = 1516
and the data from Fig. 50, we save clauses that have ๐๐ = (1, 2, 3, 4, 5) when ๐๐ โค (5, 4, 3, 2, 0), respectively.
This gives us ๐ ๐ 95 = 12 + 3069 clauses, just 45 shy of our target ๐๐ = 3126.
So 45 tie-breakers from among the 59 clauses that have RANGE ๐๐ = 95, ๐๐, ๐๐ = 5, 1 , that are arranged in order of increasing secondary heuristic ACT(๐๐),
the gray-and-black pattern is
So if we retain the 45 with highest activity, we pick up 8 of the 10 that turn out to be useful.
*Flushing literals and restarting. p.75
Peter van der Tak, Antonio Ramos, and Marijn Heule [J. Satisfiability, Bool. Modeling and Comp. 7 (2011), 133โ 138],
Algorithm C interrupts itself in step C5 not only to purge clauses but also to "flush literals" that is a useful way to rejuvenate the trail periodically by
following trends in the activity scores ACT(๐๐).
Set ๐ค๐คโฒ โ 0. While ACT ๐ฟ๐ฟ๐๐๐๐โฒ+1 โฅACT ๐๐ , set ๐ค๐คโฒ = ๐ค๐คโฒ + 1. Then if ๐ค๐คโฒ < ๐ค๐ค, jump back to level ๐ค๐คโฒ.
This is the technique called "literal flushing," because it removes the literals on levels ๐ค๐ค๐ + 1 through ๐ค๐ค
and leaves the others assigned. It effectively redirects the search into new territory,
without being as drastic as a full restart.
AGILITY p.76
Armin Biere [LNCS 4996 (2008), 28 โ 33]
High agility: lots of the recent propagations are flipping the values of variables and trying new possibilities; low agility : the algorithm is basically in a rut, spinning its wheels and getting nowhere.
which tends to be correlated with the desirability of flushing at any given moment.
a 32-bit integer variable called AGILITY, initially zero. Whenever a literal ๐๐ is placed on the trail in steps C4, C6, or C9,
we update the agility by setting
AGILITYโ AGILITY โ(AGILITYโซ13) + (((OVAL( ๐๐ ) โVAL( ๐๐ ) )&1) โช19)
the fraction AGILITY/232 is essentially multiplied by 1 โ ฮด, increased by ๐ฟ๐ฟ if the new polarity of ๐๐ differs from its previous polarity, ๐ฟ๐ฟ = 2โ13 โ .0001.
AGILITY p.76
Armin Biere [LNCS 4996 (2008), 28 โ 33]
the agility is compared to a threshold, depending on ฮf , according to the schedule in Table 4.
(The parameter ๐๐ in that table can be raised or lowered,
if you want to increase or decrease the amount of flushing.)
If the agility is sufficiently small, ๐ฅ๐ฅ๐๐ is found and (126) is performed. Nothing changes if the agility is large or if ๐ค๐ค๐ = ๐ค๐ค; otherwise (126) has flushed some literals,
using the operations of step C8.