Presentation is loading. Please wait.

Presentation is loading. Please wait.

Local Search Methods for SAT Geoffrey Levine March 11, 2004.

Similar presentations


Presentation on theme: "Local Search Methods for SAT Geoffrey Levine March 11, 2004."— 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 Aops 2 |Ops| 2 |Dom| 2 )

36 Linear Encodings Explanatory Frame Axioms –Enforce that if a fluent changes, there is an action accounting for it f i /\  f i+1 => \/ {a i | f ε Del(a i )}  f i /\ f i+1 => \/ {a i | f ε Add(a i )} –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

41

42 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 a 1,  b 1,  c 1, b n, c n

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 b 1 => a 1 /\  b 1

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 b 2 => (add b 1 \/ maintain b 1 )

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 (  b 1 ) \/  add b 1

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

51 Outline Motivation GSAT –Variations Planning –Encoding as SAT problems Linear Encodings Parallelized Encodings Lifted Causal Encodings

52 Causal Encodings Causal Link: Precondition for an operator must be added by a previous operator and not deleted since –o ----  -----> p o  O, p  O,  F  added at step o and used as a precondition in step p O = {steps of our plan} Define I, “initial action,” Adds Initial Conditions Define F, “final action,” Prerequisites are Goal Conditions

53 Lifted Causal Encodings Lifted Clause = First Order Clause In other encodings, |A| is exponential in Aops Define a single copy of each operator at each step o  O –Move(x 1, y 1, z 1 ) … Move(x n, y n, z n )

54 Lifted Causal Encodings Clause types –Action Specification Must perform an action at each step Can only perform one action at each step Must bind action parameters to domain objects

55 Lifted Causal Encodings –Causal Link conditions An action occuring at step o requires its prerequisites to be true at step o If a precondition is needed at step o, there must be a causal link for that precondition ending at o The step at the beginning to a causal link must add its corresponding fluent If a step adds a fluent, an add effect of the action at that step must equal that fluent

56 Lifted Causal Encodings –Deletion Clauses If an action a i occurs at step o, then step o must delete the fluents that a i deletes If there is a causal link p----  ---->o, and some step, r, deletes , then r < p or o < r –Step Ordering Clauses Steps must satisfy transitivity and asymmetry Causal Links must be ordered forward in time

57 Lifted Causal Conversion to SAT Ensure that variables (x i, y i,…) form equivalence classes with no conflicting assignments (Block a = Block b, On(a,b) = Clear(b))

58 Planning Performance

59 Bibliography [1] Selman, B. Kautz, H. and Cohen, B. Local Search Strategies for Satisfiability Testing. Second DIMACS Challenge on Cliques, Coloring, and Satisfiability. Oct, 1993. [2] Selman, B. Kautz, H. An Empirical Study of Greedy Local Search for Satisfiability Testing. Proceedings of AAAI-93. Washington, D.C. [3] Selman, B. Kautz, H. Domain Independent Extensions to GSAT: Solving Large Structured Satisfiability Problems. Proceedings of IJCAI-93.

60 Bibliography [4] Selman, B. Kautz, H. and Cohen, B. Noise Stategies for Improving Local Search. Proceedings of AAAI-94. Seattle, WA. [5] Kautz, H. and Selman, B. Pushing the Envelope: Planning, Propositional Logic, and Stochastic Search. Proceedings of AAAI-96. Portland, OR. [6] Kautz, H. McAllester, D. and Selman, B. Encoding Plans in Propositional Logic. Proceedings of KR-96. Boston, MA.


Download ppt "Local Search Methods for SAT Geoffrey Levine March 11, 2004."

Similar presentations


Ads by Google