cdcl sat solvers sat based problem solving
play

CDCL SAT Solvers & SAT-Based Problem Solving Joao Marques-Silva 1 - PowerPoint PPT Presentation

CDCL SAT Solvers & SAT-Based Problem Solving Joao Marques-Silva 1 , 2 & Mikolas Janota 2 1 University College Dublin, Ireland 2 IST/INESC-ID, Lisbon, Portugal SAT/SMT Summer School 2013 Aalto University, Espoo, Finland The Success of SAT


  1. CDCL SAT Solvers & SAT-Based Problem Solving Joao Marques-Silva 1 , 2 & Mikolas Janota 2 1 University College Dublin, Ireland 2 IST/INESC-ID, Lisbon, Portugal SAT/SMT Summer School 2013 Aalto University, Espoo, Finland

  2. The Success of SAT • Well-known NP-complete decision problem [C71] • In practice, SAT is a success story of Computer Science – Hundreds (even more?) of practical applications

  3. Part I CDCL SAT Solvers

  4. Outline Basic Definitions DPLL Solvers CDCL Solvers What Next in CDCL Solvers?

  5. Outline Basic Definitions DPLL Solvers CDCL Solvers What Next in CDCL Solvers?

  6. Preliminaries • Variables: w , x , y , z , a , b , c , . . . • Literals: w , ¯ x , ¯ y , a , . . . , but also ¬ w , ¬ y , . . . • Clauses: disjunction of literals or set of literals • Formula: conjunction of clauses or set of clauses • Model (satisfying assignment): partial/total mapping from variables to { 0 , 1 } • Formula can be SAT/UNSAT

  7. Preliminaries • Variables: w , x , y , z , a , b , c , . . . • Literals: w , ¯ x , ¯ y , a , . . . , but also ¬ w , ¬ y , . . . • Clauses: disjunction of literals or set of literals • Formula: conjunction of clauses or set of clauses • Model (satisfying assignment): partial/total mapping from variables to { 0 , 1 } • Formula can be SAT/UNSAT • Example: z ∨ c ) ∧ (¯ F , ( r ) ∧ (¯ r ∨ s ) ∧ (¯ w ∨ a ) ∧ (¯ x ∨ b ) ∧ (¯ y ∨ ¯ b ∨ ¯ c ∨ d ) – Example models: I { r , s , a , b , c , d } I { r , s , ¯ x , y , ¯ w , z , ¯ a , b , c , d }

  8. Resolution • Resolution rule: [DP60,R65] ( α ∨ x ) ( β ∨ ¯ x ) ( α ∨ β ) – Complete proof system for propositional logic

  9. Resolution • Resolution rule: [DP60,R65] ( α ∨ x ) ( β ∨ ¯ x ) ( α ∨ β ) – Complete proof system for propositional logic ( x ∨ a ) (¯ x ∨ a ) (¯ y ∨ ¯ a ) ( y ∨ ¯ a ) ( a ) (¯ a ) ⊥ – Extensively used with (CDCL) SAT solvers

  10. Resolution • Resolution rule: [DP60,R65] ( α ∨ x ) ( β ∨ ¯ x ) ( α ∨ β ) – Complete proof system for propositional logic ( x ∨ a ) (¯ x ∨ a ) (¯ y ∨ ¯ a ) ( y ∨ ¯ a ) ( a ) (¯ a ) ⊥ – Extensively used with (CDCL) SAT solvers • Self-subsuming resolution (with α 0 ⊆ α ): [e.g. SP04,EB05] ( α 0 ∨ ¯ ( α ∨ x ) x ) ( α ) – ( α ) subsumes ( α ∨ x )

  11. Unit Propagation ( r ) ∧ (¯ r ∨ s ) ∧ F = w ∨ a ) ∧ (¯ x ∨ ¯ a ∨ b ) (¯ z ∨ c ) ∧ (¯ y ∨ ¯ b ∨ ¯ c ∨ d ) (¯

  12. Unit Propagation ( r ) ∧ (¯ r ∨ s ) ∧ F = w ∨ a ) ∧ (¯ x ∨ ¯ a ∨ b ) (¯ z ∨ c ) ∧ (¯ y ∨ ¯ b ∨ ¯ c ∨ d ) (¯ • Decisions / Variable Branchings: w = 1 , x = 1 , y = 1 , z = 1

  13. Unit Propagation Level Dec. Unit Prop. 0 ∅ r s ( r ) ∧ (¯ r ∨ s ) ∧ F = 1 w a w ∨ a ) ∧ (¯ x ∨ ¯ a ∨ b ) (¯ z ∨ c ) ∧ (¯ y ∨ ¯ b ∨ ¯ c ∨ d ) (¯ 2 x b 3 y • Decisions / Variable Branchings: w = 1 , x = 1 , y = 1 , z = 1 4 z c d

  14. Unit Propagation Level Dec. Unit Prop. 0 ∅ r s ( r ) ∧ (¯ r ∨ s ) ∧ F = 1 w a w ∨ a ) ∧ (¯ x ∨ ¯ a ∨ b ) (¯ z ∨ c ) ∧ (¯ y ∨ ¯ b ∨ ¯ c ∨ d ) (¯ 2 x b 3 y • Decisions / Variable Branchings: w = 1 , x = 1 , y = 1 , z = 1 4 z c d • Additional definitions: – Antecedent (or reason) of an implied assignment I (¯ b ∨ ¯ c ∨ d ) for d – Associate assignment with decision levels I w = 1 @ 1, x = 1 @ 2, y = 1 @ 3, z = 1 @ 4 I r = 1 @ 0, d = 1 @ 4, ...

  15. Outline Basic Definitions DPLL Solvers CDCL Solvers What Next in CDCL Solvers?

  16. The DPLL Algorithm N Unassigned variables ? Y Satisfiable Assign value to variable Unit propagation N Conflict ? Y Can undo N decision ? Y Unsatisfiable Backtrack & flip variable • Optional: pure literal rule

  17. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Y Satisfiable Assign value to variable Unit propagation N Conflict ? Y Can undo N decision ? Y Unsatisfiable Backtrack & flip variable • Optional: pure literal rule

  18. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 x 2 y Unit propagation 3 ⊥ a b N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  19. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 x 2 y Unit propagation ¯ 3 ¯ ⊥ a b N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  20. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 x 2 ¯ y Unit propagation 3 ⊥ a b N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  21. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 x 2 ¯ y Unit propagation ¯ 3 ¯ ⊥ a b N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  22. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 ¯ x y 2 ⊥ a b Unit propagation N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  23. The DPLL Algorithm a ∨ b ) ∧ ( a ∨ ¯ a ∨ ¯ F = ( x ∨ y ) ∧ ( a ∨ b ) ∧ (¯ b ) ∧ (¯ b ) N Unassigned variables ? Level Dec. Unit Prop. Y Satisfiable 0 ∅ Assign value to variable 1 ¯ x y ¯ 2 ¯ ⊥ a b Unit propagation N Conflict ? Y ¯ x x Can undo N decision ? ¯ y y ¯ a a Y Unsatisfiable Backtrack & flip variable ¯ ¯ a a a a • Optional: pure literal rule

  24. Outline Basic Definitions DPLL Solvers CDCL Solvers What Next in CDCL Solvers?

  25. What is a CDCL SAT Solver? • Extend DPLL SAT solver with: [DP60,DLL62] – Clause learning & non-chronological backtracking [MSS96,BS97,Z97] I Exploit UIPs [MSS96,SSS12] I Minimize learned clauses [SB09,VG09] I Opportunistically delete clauses [MSS96,MSS99,GN02] – Search restarts [GSK98,BMS00,H07,B08] – Lazy data structures I Watched literals [MMZZM01] – Conflict-guided branching I Lightweight branching heuristics [MMZZM01] I Phase saving [PD07] – ...

  26. How Significant are CDCL SAT Solvers? Results of the SAT competition/race winners on the SAT 2009 application benchmarks, 20mn timeout 1200 Limmat (2002) Zchaff (2002) Berkmin (2002) Forklift (2003) Siege (2003) 1000 Zchaff (2004) SatELite (2005) Minisat 2 (2006) Picosat (2007) Rsat (2007) Minisat 2.1 (2008) 800 Precosat (2009) Glucose (2009) CPU Time (in seconds) Clasp (2009) Cryptominisat (2010) Lingeling (2010) Minisat 2.2 (2010) 600 Glucose 2 (2011) Glueminisat (2011) Contrasat (2011) Lingeling 587f (2011) 400 GRASP 200 DPLL 0 0 20 40 60 80 100 120 140 160 180 200 ? ? Number of problems solved

  27. Outline Basic Definitions DPLL Solvers CDCL Solvers Clause Learning, UIPs & Minimization Search Restarts & Lazy Data Structures What Next in CDCL Solvers?

  28. Clause Learning Level Dec. Unit Prop. 0 ∅ 1 x x 2 y 3 ⊥ z z a b

  29. Clause Learning Level Dec. Unit Prop. 0 ∅ a ∨ ¯ z ∨ b ) x ∨ ¯ z ∨ a ) (¯ b ) (¯ (¯ 1 x (¯ a ∨ ¯ z ) 2 y ab -> false = !(ab) + false = !a + !b z -> b = !z + b 3 ⊥ z a x ∨ ¯ (¯ z ) xz -> a. =. !(xz) + a =. !x + !z + a b • Analyze conflict – Reasons: x and z I Decision variable & literals assigned at lower decision levels x ∨ ¯ – Create new clause: (¯ z ) • Can relate clause learning with resolution

  30. Clause Learning – After Bracktracking Level Dec. Unit Prop. ∅ 0 1 x z 2 y ⊥ 3 z z a b

  31. Clause Learning – After Bracktracking Level Dec. Unit Prop. ∅ 0 1 x z 2 y ⊥ 3 z a b • Clause (¯ x ∨ ¯ z ) is asserting at decision level 1

  32. Clause Learning – After Bracktracking Level Dec. Unit Prop. Level Dec. Unit Prop. ∅ ∅ 0 0 1 1 ¯ x z x z 2 y ⊥ 3 z a b • Clause (¯ x ∨ ¯ z ) is asserting at decision level 1

Recommend


More recommend