Presentation is loading. Please wait.

Presentation is loading. Please wait.

Planning as Satisfiability with Blackbox

Similar presentations


Presentation on theme: "Planning as Satisfiability with Blackbox"— Presentation transcript:

1 Planning as Satisfiability with Blackbox
Presented By: Catie Welsh Sources: Chapter 7 Henry Kautz and Bart Selman (1999) Unifying SAT-based and Graph-based Planning, Proc. IJCAI-99, Stockholm Henry Kautz and Bart Selman (1992) Planning as Satisfiability Proc. ECAI-92.

2 Planning as Satisfiability
Introduction Classical planning has often been observed as a form of logical deduction. Planning as satisfiability offers a new solution to planning problems. Formulates a planning problem as a propositional satisfiability problem. The problem of determining whether a propositional formula is satisfiable. 11/20/2018 Planning as Satisfiability

3 Planning as Satisfiability
Overview A planning problem is encoded as a propositional formula. A satisfiability decision procedure determines whether the formula is satisfiable by assigning truth values to the propositional variables. A plan is extracted from the assignments determined by the satisfiability decision procedure. 11/20/2018 Planning as Satisfiability

4 Planning as Satisfiability
Definitions Model – an assignment of truth values to its variables for which the formula evaluates to true. Satisfiable – a sentence or formula is satisfiable if it is true in some model Satisfiability problem – problem of determining whether a formula has a model. 11/20/2018 Planning as Satisfiability

5 States as Propositional Formulas
Use propositional formulas to represent facts that hold in states. Ex: at(r1,l1)  ¬loaded(r1) assuming there is a robot r1, and a location l1 A model for the above example is one that assigns true to the propositional variable at(r1,l1) and false to loaded(r1) Above example still allows for at(r1, l2) to be true however. 11/20/2018 Planning as Satisfiability

6 States as Propositional Formulas (cont’d)
A propositional formula can represent sets of states rather than a single state. Ex: (at(r1,l1)  ¬at(r1,l2)) V (¬at(r1,l1)  at(r1,l2))  ¬loaded(r1) The above example represents both the states where the robot is at l1 and one where it is at l2. As opposed to STRIPS planning where a state is a conjunction of propositions 11/20/2018 Planning as Satisfiability

7 State Transitions as Propositional Formulas
Behavior of deterministic actions is described by the transition formula: : S x A  S So, Figure 7.1 could be said: (s1, move(r1,l1,l2)) = s2 If s1 is represented as at(r1,l1)  ¬at(r1,l2) and s2 is represented as ¬at(r1,l1)  at(r1,l2), this does not assert that the propositional formulas correspond to their appropriate states. This again is opposed to STRIPS planning where states are maintained at every step. 11/20/2018 Planning as Satisfiability

8 State Transitions as Propositional Formulas (cont’d)
To assert the states for each propositional formula, we write it as such: at(r1,l1,s1)  ¬at(r1,l2,s1)  ¬at(r1,l1,s2)  at(r1,l2,s2) We can now represent that action move(r1,l1,l2) causes this transition: move(r1,l1,l2,s1)  at(r1,l1,s1)  ¬at(r1,l2,s1)  ¬at(r1,l1,s2)  at(r1,l2,s2) 11/20/2018 Planning as Satisfiability

9 Planning Problems as Propositional Formulas
Encoding a planning problem to a propositional formula is based on two main ideas: Restrict the planning problem to a problem of finding a plan of known length n for some fixed n. This is called a bounded planning problem. Transform the bounded planning problem into a satisfiability problem. Each state and action of the bounded planning problem is mapped to propositions that describe states and actions at each step, from step 0 (initial state) to step n (goal state). 11/20/2018 Planning as Satisfiability

10 Planning Problems as Propositional Formulas (cont’d)
Since “planning as satisfiability” can only deal with bounded planning problems, the algorithm is iteratively run for different tentative lengths until a plan is found. (plan length is fixed at 2,4,8, etc) Uses iterative deepening. Fluents – instantiation of a predicate States are sets of fluents. Fluents – propositional variables in this context Fluents -ground atomic formulas that describe states at a given step. 11/20/2018 Planning as Satisfiability

11 Planning Problems as Propositional Formulas (cont’d)
Constructing formulas to encode bounded planning problems into satisfiability problems If f is a fluent at(r1,l1), we write at(r1,l1,i) as fi. If a is this action move(r1,l1,l2), we write move(r1,l1,l2,i) as ai. 11/20/2018 Planning as Satisfiability

12 Planning Problems as Propositional Formulas (cont’d)
Formula is built with these five kinds of sets of formulas: (1) Initial state is encoded (2) The set of goal states is encoded (3) An action, when applicable, has some effects is encoded 1)as a proposition that is the conjunction of fluents that hold in the initial state and the negation of those that doe not hold, all of them instantiated at step 0. 2)as a proposition that is the conjunction of fluents that must hold at step n. 3) with a formula that states that if an action takes place at a given step, then its preconditions must hold at that step and its effects will hold at the next step. Action ai implies … logical formula 11/20/2018 Planning as Satisfiability

13 Planning Problems as Propositional Formulas (cont’d)
(4) An action changes only the fluents that are in its effects. Explanatory frame axioms – set of propositions that enumerate the set of actions that could have occurred in order to account for a state change. (5) Complete exclusion axiom – only one action occurs at each step. The propositional formula encoding the bounded planning problem into a satisfiability problem is the conjunction of all five. ((1)  (2)  (3)  (4)  (5)) 4) In the case where f holds at step i, but not at step i+1, an action that has f in its negative effects must have been executed. 11/20/2018 Planning as Satisfiability

14 Planning as Satisfiability
Once the bounded planning problem is encoded to a satisfiability problem, a model for the resulting formula can be constructed by a satisfiability decision procedure. Two most commonly used procedures: Davis-Putnam Stochastic procedures – based on the idea of randomized search 11/20/2018 Planning as Satisfiability

15 Conjunction Normal Form
What is CNF? A conjunctive normal form (CNF) is a Boolean expression consisting of one or more disjunctive formulas connected by an AND symbol (). A disjunctive formula is a collection of one or more (positive and negative) literals connected by an OR symbol (). Example: (a)  (¬ a  ¬b  c  d)  (¬c  ¬d)  (¬d) CNF-Satisfaction: Give an algorithm that receives as input a CNF form and returns Boolean assignments for each literal in form such that form is true Example (above): a  true, b  false, c  true, d  false Prof. Munoz-Avila 11/20/2018 Planning as Satisfiability

16 Davis-Putnam Procedure
Sound and complete Sound – every input formula on which it returns a model is satisfiable Complete – returns a model on every satisfiable input formula. Soundness and completeness only hold for bounded planning problems. These definitions differ from the sound and complete we learned so far in class as the standard definitions for STRIPS. However, based on the encodings, the STRIPS definitions will still hold for these bounded planning problems. 11/20/2018 Planning as Satisfiability

17 Davis-Putnam Procedure (cont’d)
Literal – propositional variable (positive literal) or its negation (negative literal) Unit Clause – clause with only one literal Performs a depth-first search through the space of all possible assignments until it finds a model or explores the entire search space without finding any. Unit-Propagate eliminates in one shot all that can be eliminated and returns a smaller formula. For any unit clause, if the literal is positive (negative), Unit-Propagate sets the literal to true (false), and simplifies – called unit propagation. 11/20/2018 Planning as Satisfiability

18 Davis-Putnam Algorithm
Where  is the CNF propositional formula, and  is a model. 11/20/2018 Planning as Satisfiability

19 Planning as Satisfiability
Davis-Putnam Example Given the following propositional formula in CNF:  = D  (¬D v A v ¬B)  (¬D v ¬A v ¬B)  (¬D v ¬A v B)  (D v A) 11/20/2018 Planning as Satisfiability

20 Planning as Satisfiability
Break 11/20/2018 Planning as Satisfiability

21 Stochastic Procedures
Unlike Davis-Putnam, stochastic procedures start with total assignments of all variables. Randomly selects an initial total assignment until a model is found or all possible assignments are exhausted. Sound and complete but of no practical use. 11/20/2018 Planning as Satisfiability

22 Stochastic Procedures (cont’d)
Basic idea underlying a set of incomplete satisfiability decision procedures. Blackbox includes the local-search SAT solver Walksat. Walksat is built off of the Iterative-Repair algorithm. 11/20/2018 Planning as Satisfiability

23 Planning as Satisfiability
Iterative-Repair Iterative repair approach – iteratively modifies the truth assignment such that it satisfies one of the unsatisfied clauses selected. Iterative-Repair is sound and incomplete 11/20/2018 Planning as Satisfiability

24 Iterative Repair (cont’d)
Example: Given  = D  (¬D v A v ¬B)  (¬D v ¬A v ¬B)  (¬D v ¬A v B)  (D v A) Initial guess:  = {D,A,B} Have to repair clause (¬D v ¬A v ¬B). Modify  to be {D, ¬A, ¬B}. Now  satisfies the propositional formula. 11/20/2018 Planning as Satisfiability

25 Planning as Satisfiability
Different Encodings Encodings determine the number of propositional variables and the number of clauses in the formula that is generated. Efficiency of satisfiability procedure depends on the number of variables and clauses. Two main choices for encodings: Encoding of actions Encoding of the frame problem 11/20/2018 Planning as Satisfiability

26 Planning as Satisfiability
Operator Splitting Simple Operator Splitting – replace each n-ary action ground proposition with n unary ground propositions. Based on the idea that since only a single action can occur at a given step, an m-place action can be represented at the conjunction of m 1-place actions. Example: Encoding the action move(a,b,c) occurs at time 3 as a single proposition move(a,b,c,3), could be written as: source(a,3)  object(b,3)  destination(c,3) 11/20/2018 Planning as Satisfiability

27 Planning as Satisfiability
SATPLAN First “planning as satisfiability” planner Showed that a general propositional theorem prover could be competitive with some of the best specialized planning systems. First creates a CNF wff (Conjunctive Normal Form – Well Formed Formula), then performs a search that is constrained by that structure. Propositional structure corresponds to fixed plan length, and search reveals whether or not a plan of that length exists. 11/20/2018 Planning as Satisfiability

28 Planning as Satisfiability
Graphplan Review B A B C Mutex list for Move(B,C,table): -Move(A,table,B) -Move(B,C,A) C A Clear(C) On(B, table) On(B, C) On(A, B) On(A,table) Clear(B) On(B, A) Clear(A) On(C,table) Move(B,C,table) A Clear(B) On(B, C) Clear(A) On(A, table) On(C,table) Mutex list for Move(A,table,B): -Move(B,C,table) -Move(B,C,A) B C Move(A,table,B) Mutex list for Move(B,C,A): -Move(B,C,table) -Move(A,table,B) Move(B,C,A) B C A 11/20/2018 Planning as Satisfiability

29 Planning as Satisfiability
Blackbox Blackbox = Graphplan + SATPLAN Converts problems specified in STRIPS notation into Boolean satisfiability problems, then uses state-of-the-art satisfiability engines to solve the problems. Very versatile – you can specify which SAT engine to use for particular amounts of time Ex: you can tell it to use Graphplan for 30 seconds, Walksat for 2 minutes, and if still no solution is found, then Satz for 5 minutes. 11/20/2018 Planning as Satisfiability

30 Planning as Satisfiability
Blackbox (cont’d) A planning problem (specified in STRIPS) is converted to a plan graph of length k, and mutexes are computed as in Graphplan. The plan graph is converted to CNF wff. The wff is simplified by a general CNF simplification algorithm. The wff is solved by any variety of fast SAT engines. If a model of the wff is found, then the model is converted to a plan; otherwise k is incremented and the process repeats. 11/20/2018 Planning as Satisfiability

31 Planning as Satisfiability
Blackbox (cont’d) Mutex computation Plan Graph STRIPS Translator CNF Simplifier General Stochastic / Systematic SAT engines CNF Solution 11/20/2018 Planning as Satisfiability

32 Graphplan-based Encodings
Translation begins at goal-layer of the graph, and works backwards. Example: using the rocket domain Load(A,R,L,i) means load A into R at Location L at time i Move(R,L,P,i) means move R from L to P at time i. Translation process: Initial state holds at layer 1 and goals hold at the highest layer. Operators imply their preconditions, e.g. Load(A,R,L,2) ⊃ (At(A,L,1)  At(R,L,1) Each fact at level i implies the disjunction of all the operators at level i-1 that have it as an add-effect, e.g. In(A,R,3) ⊃ (Load(A,R,L,2) v Load(A,R,P,2) v Maintain(In(A,R),2)) Conflicting actions are mutually exclusive, e.g. ¬Load(A,R,L,2) v ¬Move(R,L,P,2) 11/20/2018 Planning as Satisfiability

33 Translation of Plan Graph
Pre1 Act1 Fact Pre2 Act2 Fact  Act1  Act2 Act1  Pre1  Pre2 ¬Act1  ¬Act2 11/20/2018 Planning as Satisfiability

34 Planning as Satisfiability
C Mutex list for Move(B,C,table): -Move(A,table,B) -Move(B,C,A) C A Clear(C) On(B, table) On(B, C) On(A, B) On(A,table) Clear(B) On(B, A) Clear(A) On(C,table) Move(B,C,table) A Clear(B) On(B, C) Clear(A) On(A, table) On(C,table) Mutex list for Move(A,table,B): -Move(B,C,table) -Move(B,C,A) B C Move(A,table,B) Mutex list for Move(B,C,A): -Move(B,C,table) -Move(A,table,B) Move(B,C,A) B C A 11/20/2018 Planning as Satisfiability

35 Planning as Satisfiability
Blackbox Conclusions The name blackbox refers to the fact that the plan generator knows nothing about the SAT solvers, and the SAT solvers know nothing about plans: each is a "black box" to the other. Blackbox is an evolving system. The general goal is to unify many different threads of research in planning and inference by using propositional satisfiability as a common foundation. 11/20/2018 Planning as Satisfiability

36 Blackbox Instructions
Blackbox is installed on a pc in PL 250. It’s the computer in the middle along the back wall. To run blackbox: Open a command prompt cd to C:\Blackbox Type >blackbox –o domain.pddl –f prob.pddl Use blackbox –help for more options 11/20/2018 Planning as Satisfiability

37 Blackbox Instructions (cont’d)
Blackbox takes domain and problem files in pddl format. (no changes should be required from the original STRIPS encoded files you get for your domains). Examples files are located at C:\Blackbox\Blackbox43\Examples More information on Blackbox located here: 11/20/2018 Planning as Satisfiability

38 Planning as Satisfiability
Contact Info Problems or Questions about Blackbox? me at 11/20/2018 Planning as Satisfiability


Download ppt "Planning as Satisfiability with Blackbox"

Similar presentations


Ads by Google