1 / 60

Local Search Methods for SAT

Local Search Methods for SAT. Geoffrey Levine March 11, 2004. Outline. Motivation GSAT Variations Planning Encoding as SAT problems. Motivation. SAT or MAX-SAT Find a satisfying (or near satisfying) set of Boolean assignments for a CNF equation

xanto
Download Presentation

Local Search Methods for SAT

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. Local Search Methods for SAT Geoffrey Levine March 11, 2004

  2. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problems

  3. Motivation • SAT or MAX-SAT • Find a satisfying (or near satisfying) set of Boolean assignments for a CNF equation (a \/ b) /\ (Øa \/ c) /\ (Øb \/ c) /\ (Øc \/ Øb)

  4. Motivation • SAT or MAX-SAT • Find a satisfying (or near satisfying) set of Boolean assignments for a CNF equation (a \/ b) /\ (Øa \/ c) /\ (Øb \/ c) /\ (Øc \/ Øb) (T \/ F) /\ (F \/ T) /\ (T \/ T) /\ (F \/ T) = T a = T, b = F, c = T

  5. Motivation • SAT or MAX-SAT • Find a satisfying (or near satisfying) set of Boolean assignments for a CNF equation • NP-Complete, systematic search algorithms scale poorly

  6. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problems

  7. GSAT – Selman Kautz ‘93 At each step, in your Truth assignment, T Flip variable in T that results in greatest increase of satisfied clauses

  8. GSAT – Selman Kautz ‘93 T := a randomly generated truth assignment for j := 1 to MAX-FLIPS if T satisfies equation, return T Flip variable in T that results in greatest increase of satisfied clauses

  9. GSAT – Selman Kautz ‘93 For i := 1 to MAX-TRIES T := a randomly generated truth assignment for j := 1 to MAX-FLIPS if T satisfies equation, return T Flip variable in T that results in greatest increase of satisfied clauses

  10. GSAT – Advantages • Scales better than previous systematic solutions • Setting MAX-FLIPS to 10x number of variables is sufficient [1] • Can handle hard randomly-generated 3CNF formulas with 2000 variables compared to 400 [3]

  11. GSAT - Performance

  12. GSAT - Disadvantage • Tends to get stuck at plateaus/local minima

  13. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problem

  14. GSAT w/Clause weights • Weight each clause, initially at 1 • At the end of each failed attempt, increase weights of unsatisfied clauses

  15. GSAT w/Clause weights • Works to fill in difficult local minima

  16. GSAT w/Clause weights • Works to fill in difficult local minima

  17. GSAT w/Clause weights • Works to fill in difficult local minima

  18. GSAT w/Clause weights • Works to fill in difficult local minima

  19. GSAT w/Clause weights • Works to fill in difficult local minima

  20. GSAT w/Clause weights • Works to fill in difficult local minima

  21. GSAT w/Clause weights • Works to fill in difficult local minima

  22. GSAT w/Clause weights • Works to fill in difficult local minima

  23. GSAT w/Clause weights • Works to fill in difficult local minima

  24. WalkSAT • Combination of GSAT and Random Walk • At each step, choose an unsatisfied clause at random, and flip a variable in that clause either greedily or randomly.

  25. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problems

  26. Planning • Previously considered not amenable to general theorem provers (1969) • Relative success of STRIPS (1971) set the tone for future work in planning • Speed of GSAT algorithms make them a viable option (1996)

  27. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problems • Linear Encodings • Parallelized Encodings • Lifted Causal Encodings

  28. Linear Encodings • Introduce time-index to each fluent/action • On(a,b,1), Move(a,b,c,1), On(a,c,2)

  29. Linear Encodings • Introduce time-index to each fluent/action • On(a,b,1), Move(a,b,c,1), On(a,c,2) • Encoded clauses: • Specification of initial/goal states • Initial state must be completely specified • Goal state can be partially specified

  30. Linear Encodings • Introduce time-index to each fluent/action • On(a,b,1), Move(a,b,c,1), On(a,c,2) • Encoded clauses: • Specification of initial/goal states • Actions imply their preconditions and effects • Move(a,b,c,1) => On(a,b,1) /\ Clear(a,1) /\ Clear(c,1) • Move(a,b,c,1) => Clear(b,2) /\ On(a,c,2) /\ ØClear(c,1)

  31. Linear Encodings • Introduce time-index to each fluent/action • On(a,b,1), Move(a,b,c,1), On(a,c,2) • Encoded clauses: • Specification of initial/goal states • Actions imply their preconditions and effects • Actions imply their frame conditions • On(d,e,1) /\ Move(a,b,c,1) => On(d,e,2)

  32. Linear Encodings • Introduce time-index to each fluent/action • On(a,b,1), Move(a,b,c,1), On(a,c,2) • Encoded clauses: • Specification of initial/goal states • Actions imply their preconditions and effects • Actions imply their frame conditions • Only one action occurs at each time • ØMove(a,b,c,1) \/ ØMove(a,b,d,1)

  33. Linear Encodings • Total Number of variables is O(n |A| + n |F|) • |A| = number of actions = |Ops| |Objs|Aops • |Ops| = number of operations • |Objs| = number of domain objects • Aops = Arity of the operators = max # of arguments • |F| = number of fluents = |Pred| |Objs|Apreds • |Pred| = number of predicates • Apreds = Arity of predicates = max # of arguments

  34. Linear Encodings • Number of literals in the CNF formula • O(n |A|^2 + n |A| |F|) ^ ^ | | | Due to Frame Axioms | Due to Exclusiveness (one action at a time)

  35. Linear Encodings • Number of actions exponential in Aops • |A| = |Ops| |Objs|Aops • Reducing Arity can dramatically reduce length of formula • Operator Splitting • Move(a,b,c,i) becomes Object(a,i) /\ Source(b,i) /\ Destination(c,i) • Reduces size of exclusiveness axioms to O(n Aops2 |Ops|2 |Dom|2)

  36. Linear Encodings • Explanatory Frame Axioms • Enforce that if a fluent changes, there is an action accounting for it • fi /\ Øfi+1 => \/ {ai | f ε Del(ai)} • Øfi /\ fi+1 => \/ {ai | f ε Add(ai)} • Reduces size of frame axioms to O(n k |F|) where at most k actions can account for the change in value of a fluent

  37. Outline • Motivation • GSAT • Variations • Planning • Encoding as SAT problems • Linear Encodings • Parallelized Encodings • Lifted Causal Encodings

  38. Parallelized Encodings • Lots of the CNF formula is devoted to frame axioms • Dependant on number of time slices in the encoding • Allow more than one action per time slice • Solutions to the SAT problem correspond to partial order plans

  39. Graphplan-based Encodings

  40. Graphplan-based Encodings

  41. Graphplan-based Encodings

  42. Graphplan-based Encodings • Allow for multiple operations per layer

  43. Graphplan-based Encodings • Allow for multiple operations per layer

  44. Graphplan-based Encodings • Can be translated into CNF formulas • Resulting Clauses: • Initial state holds at layer 1, goal state at layer n • a1, Ø b1, Ø c1, bn, cn

  45. Graphplan-based Encodings • Can be translated into CNF formulas • Resulting Clauses: • Initial state holds at layer 1, goal state at layer n • Operators imply their preconditions • add b1 => a1 /\ Ø b1

  46. Graphplan-based Encodings • Can be translated into CNF formulas • Resulting Clauses: • Initial state holds at layer 1, goal state at layer n • Operators imply their preconditions • Each fact at level i implies the disjunction of all operators at level i-1 with it as ad add-effect • b2 => (add b1 \/ maintain b1)

  47. Graphplan-based Encodings • Can be translated into CNF formulas • Resulting Clauses: • Initial state holds at layer 1, goal state at highest • Operators imply their preconditions • Each fact at level i implies the disjunction of all operators at level i-1 with it as ad add-effect • Conflicting actions are mutually exclusive • Ø maintain (Ø b1) \/ Ø add b1

  48. Graphplan-based Encodings • Resulting formula has size O(nm|A| + n|A|2 + nk|F|) ^ ^ ^ | | Explanation frames | Conflicting Actions Actions => Preconditions (m = max # of preconditions for an action)

  49. Graphplan-Based Encodings • If we only know the state layers or action layers, we can perceive the other. • Perform resolution to compile away action or state layers • Compiling away actions can result in exp blowup a1 => f, a2 => f, a3 => f a1 => (p1 /\ p2), a2 => (p3 /\ p4), a3 => (p5 /\ p6) f => (p1 \/ p3 \/ p5) /\ (p2 \/ p3 \/ p5) /\ ….

  50. Graphplan-Based Encodings • If we only know the state layers or action layers, we can perceive the other. • Perform resolution to compile away action or state layers • Compiling away actions can result in exp blowup • Compiling away states does not result in the same problem, as the resulting formula is still in CNF

More Related