1 / 33

SAT Solvers

SAT Solvers. The SAT Problem. Given a Boolean formula , look for assignment A for such that . A is a solution for . A partial assignment assigns a subset of . CNF representation of : is a conjunction of clauses:

tova
Download Presentation

SAT Solvers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SAT Solvers

  2. The SAT Problem • Given a Boolean formula , look for assignmentAfor such that . • A is a solution for . • A partial assignment assigns a subset of . • CNF representation of : • is a conjunction of clauses: • A clause is a disjunction of literals: • A satisfies ↔ A satisfies all its clauses.

  3. Boolean Constraint Propagation • Unit Clause: A clause with exactly one unassigned literal, while all the rest are false. • Asserts the value of the unassigned variable. • cl implies and is its antecedent. • a and c are the antecedent variables of • BCP(): Calculates all the possible implications. Returns conflict / no-conflict. a = 0 b = ? c = 1 b = 0

  4. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value.

  5. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp()

  6. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp()

  7. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp() • If a conflict occurs • Flip the highest decision variable not yet flipped.

  8. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp() • If a conflict occurs • Flip the highest decision variable not yet flipped. • Mark as flipped.

  9. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp() • If a conflict occurs • flip the highest decision variable not yet flipped. • Mark as flipped • Run bcp().

  10. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp() • If a conflict occurs • flip the highest decision variable not yet flipped. • Mark as flipped • Run bcp().

  11. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Choose a decision variable and value. • Run bcp() • If a conflict occurs • flip the highest decision variable not yet flipped. • Mark as flipped • Run bcp().

  12. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Termination • No unassigned variables – SAT

  13. DPLL: Davis Putnam Logemann Loveland Backtrack Search • Termination • No unassigned variables – SAT • No decision variable to flip – un-SAT

  14. The SAT Problem - Resolution • Given a Boolean formula in CNF, for clauses and . • For

  15. x3 ¬x5 ¬x1 x12 x7 ¬x8 x19 ¬x6 ¬x3 ¬x9 x4 Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8, ¬x7,¬x3)

  16. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  17. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  18. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  19. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  20. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  21. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  22. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  23. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  24. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  25. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  26. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 x19 ¬x3 x4 ¬x1 ¬x6

  27. Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 Conflict x19 ¬x3 x4 ¬x1 ¬x6

  28. x12 x7 ¬x6 x3 ¬x3 ¬x5 ¬x8 x19 ¬x1 Learning: Cuts ¬x9 Conflict x4

  29. ¬x3 ¬x6 x12 x19 ¬x8 ¬x1 Learning: Conflict Clauses Reason Side Conflict Side • x7,¬x5,x15 are the reason for the conflict. • Adding the clause will prevent it in the future. (x5,¬x7,x3) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 Conflict x4

  30. Learning: Conflict Clauses X1 0 1 X2 X2 The clause (x2,x3) is created after a conflict 0 1 0 1 X3 X3 X3 X3 0 0 The search tree is pruned accordingly

  31. 1 UIP 2 UIP Learning: Implication Graph (x9,¬x5) (x9,¬x8) (x9,x12) (x5,x7) (x5,¬x7,x3) (¬x4,¬x1) (x1,¬x12,x19) (x1,¬x6) (x6,¬x19,x8,¬x7,¬x3) x7 ¬x5 x3 ¬x9 ¬x8 x12 Conflict x19 ¬x3 x4 ¬x1 ¬x6

  32. Non –Chronological Backtracking • Backtrack multiple levels instead of one. • Use conflict clause to determine the level • Backtrack to the minimum level where the clause is still asserting. • Emphasis on recent learning. Conflict Clause (x10,¬x7,x2,x9)

  33. Learning: Conflict Clauses • Prevent the reason to the conflict. • Consists of the negation to the reason literals. • Prunes the search tree. • Different cuts yield different conflict clauses. • We choose cuts such that: • Conflict clause includes one variable from the top level.  It is a unit clause after backtracking one level. • The new problem is equivalent to the original.

More Related