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 x 8 ) ∧ ( x 8 ∨ x 3 ∨ ¯ x 9 ) ∧ ( x 9 ∨ ¯ x 3 ∨ x 8 ) ∧ ( x 6 ∨ ¯ x 9 ∨ x 5 ) ∧ ( x 2 ∨ ¯ x 3 ∨ ¯ x 8 ) ∧ ( x 8 ∨ ¯ x 6 ∨ ¯ x 3 ) ∧ ( x 8 ∨ ¯ x 3 ∨ ¯ x 1 ) ∧ (¯ x 8 ∨ x 6 ∨ ¯ x 2 ) ∧ ( x 7 ∨ x 9 ∨ ¯ x 2 ) ∧ ( x 8 ∨ ¯ x 9 ∨ x 2 ) ∧ (¯ x 1 ∨ ¯ x 9 ∨ x 4 ) ∧ ( x 8 ∨ x 1 ∨ ¯ x 2 ) ∧ ( x 3 ∨ ¯ x 4 ∨ ¯ x 6 ) ∧ (¯ x 1 ∨ ¯ x 7 ∨ x 5 ) ∧ (¯ x 7 ∨ x 1 ∨ x 6 ) ∧ (¯ x 5 ∨ x 4 ∨ ¯ x 6 ) ∧ (¯ x 4 ∨ x 9 ∨ ¯ x 8 ) ∧ ( x 2 ∨ x 9 ∨ x 1 ) ∧ ( x 5 ∨ ¯ x 7 ∨ x 1 ) ∧ (¯ x 7 ∨ ¯ x 9 ∨ ¯ x 6 ) ∧ ( x 2 ∨ x 5 ∨ x 4 ) ∧ ( x 8 ∨ ¯ x 4 ∨ x 5 ) ∧ ( x 5 ∨ x 9 ∨ x 3 ) ∧ (¯ x 5 ∨ ¯ x 7 ∨ x 9 ) ∧ ( x 2 ∨ ¯ x 8 ∨ x 1 ) ∧ (¯ x 7 ∨ x 1 ∨ x 5 ) ∧ ( x 1 ∨ x 4 ∨ x 3 ) ∧ ( x 1 ∨ ¯ x 9 ∨ ¯ x 4 ) ∧ ( x 3 ∨ x 5 ∨ x 6 ) ∧ (¯ x 6 ∨ x 3 ∨ ¯ x 9 ) ∧ (¯ x 7 ∨ x 5 ∨ x 9 ) ∧ ( x 7 ∨ ¯ x 5 ∨ ¯ x 2 ) ∧ ( x 4 ∨ x 7 ∨ x 3 ) ∧ ( x 4 ∨ ¯ x 9 ∨ ¯ x 7 ) ∧ ( x 5 ∨ ¯ x 1 ∨ x 7 ) ∧ ( x 5 ∨ ¯ x 1 ∨ x 7 ) ∧ ( x 6 ∨ x 7 ∨ ¯ x 3 ) ∧ (¯ x 8 ∨ ¯ x 6 ∨ ¯ x 7 ) ∧ ( x 6 ∨ x 2 ∨ x 3 ) ∧ (¯ x 8 ∨ x 2 ∨ x 5 ) Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 3 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ F extra Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 6 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 6 x 1 = 0 7 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 6 x 1 = 0 x 4 = 1 7 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 6 x 1 = 0 x 4 = 1 x 3 = 1 x 3 = 0 7 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 x 3 = 1 1 7 x 5 = 1 6 x 1 = 0 7 7 x 4 = 1 x 1 = 0 x 4 = 1 x 3 = 1 7 x 3 = 0 2 x 3 = 0 7 x 2 = 1 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 x 3 = 1 1 7 x 5 = 1 6 x 1 = 0 7 7 x 4 = 1 x 1 = 0 x 4 = 1 x 3 = 1 7 x 3 = 0 2 x 3 = 0 7 x 2 = 1 (¯ x 2 ∨ ¯ x 4 ∨ ¯ x 5 ) Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 x 3 = 1 1 7 x 5 = 1 6 x 1 = 0 7 7 x 4 = 1 x 1 = 0 x 4 = 1 x 3 = 1 7 x 3 = 0 2 x 3 = 0 7 x 2 = 1 (¯ x 2 ∨ ¯ x 4 ∨ ¯ x 5 ) Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 2 x 4 = 0 x 3 = 1 1 x 1 = 1 7 x 5 = 1 6 x 1 = 0 7 7 x 4 = 1 x 1 = 0 x 4 = 1 x 3 = 1 7 x 3 = 0 2 x 3 = 0 7 x 2 = 1 (¯ x 2 ∨ ¯ x 4 ∨ ¯ x 5 ) Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Search and Analysis ( x 1 ∨ x 4 ) ∧ 0 ( x 3 ∨ ¯ x 4 ∨ ¯ x 5 ) ∧ x 5 = 1 (¯ x 3 ∨ ¯ x 2 ∨ ¯ x 4 ) ∧ 1 F extra x 2 = 1 2 2 x 4 = 0 x 3 = 1 1 x 1 = 1 7 x 5 = 1 6 x 1 = 0 7 7 x 4 = 1 x 1 = 0 x 4 = 1 x 3 = 1 7 x 3 = 0 2 x 3 = 0 7 x 2 = 1 (¯ x 2 ∨ ¯ x 4 ∨ ¯ x 5 ) Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 4 / 24
Conflict-driven SAT solvers: Pseudo-code 1: while TRUE do l decision := GetDecisionLiteral ( ) 2: If no l decision then return satisfiable 3: F := Simplify ( F ( l decision ← 1) ) 4: while F contains C falsified do 5: C conflict := AnalyzeConflict ( C falsified ) 6: If C conflict = ∅ then return unsatisfiable 7: BackTrack ( C conflict ) 8: F := Simplify ( F ∪ { C conflict } ) 9: end while 10: 11: end while Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 5 / 24
Learning conflict clauses [Marques-SilvaSakallah’96] 1 5 x 4 =1 x 8 =1 x 17 =0 4 3 x 12 =0 7 x 6 =0 x 1 =1 7 7 x 18 =1 7 7 7 7 x 11 =1 x 2 =0 x 10 =0 x 3 =1 7 7 x 7 =1 7 x 18 =0 x 5 =0 6 x 13 =0 2 x 19 =1 Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 6 / 24
Learning conflict clauses [Marques-SilvaSakallah’96] 1 5 x 4 =1 x 8 =1 x 17 =0 4 3 x 12 =0 7 x 6 =0 x 1 =1 7 7 x 18 =1 7 7 7 7 x 11 =1 x 2 =0 x 10 =0 x 3 =1 7 7 x 7 =1 7 x 18 =0 x 5 =0 6 x 13 =0 2 ( ¬ x 1 ∨ ¬ x 3 ∨ x 5 ∨ x 17 ∨ ¬ x 19 ) x 19 =1 tri-asserting clause Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 6 / 24
Learning conflict clauses [Marques-SilvaSakallah’96] 1 5 x 4 =1 x 8 =1 x 17 =0 4 3 x 12 =0 7 x 6 =0 x 1 =1 7 7 x 18 =1 7 7 7 7 x 11 =1 x 2 =0 x 10 =0 x 3 =1 7 7 x 7 =1 7 x 18 =0 x 5 =0 6 x 13 =0 2 ( x 10 ∨ ¬ x 8 ∨ x 17 ∨ ¬ x 19 ) x 19 =1 first unique implication point Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 6 / 24
Learning conflict clauses [Marques-SilvaSakallah’96] 1 5 x 4 =1 x 8 =1 x 17 =0 4 3 x 12 =0 7 x 6 =0 x 1 =1 7 7 x 18 =1 7 7 7 7 x 11 =1 x 2 =0 x 10 =0 x 3 =1 7 7 x 7 =1 7 x 18 =0 x 5 =0 6 x 13 =0 2 ( x 2 ∨ ¬ x 4 ∨ ¬ x 8 ∨ x 17 ∨ ¬ x 19 ) x 19 =1 second unique implication point Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 6 / 24
Average Learned Clause Length Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 7 / 24
Data-structures Data-structures Watch pointers Marijn J. H. Heule (UT) Mini-tutorial on CDCL solvers BIRS, January 2014 8 / 24
Recommend
More recommend