Contents • Planning vs. problem solving Foundations of AI • Planning in the situation calculus 1 3 . Planning • STRIPS formalism • Non-linear planning • The POP algorithm Solving Logically Specified Problems • Graphplan Step by Step • Heuristic search planning W olfram Burgard, Andreas Karw ath, • Outlook: Extensions & non-classical planning Bernhard Nebel, and Martin Riedm iller 12/ 1 2 Planning vs. Problem -Solving Planning • Given an logical description of the initial Basic difference: Explicit, logic-based representation situation, • States/ Situations: Through descriptions of the world by logical formula vs. data structures • a logical description of the goal conditions, This way, the agent can explicitly think about and communicate and • Goal conditions as logical formulae vs. goal test (black box) • a logical description of a set of possible The agent can also reflect on its goals. actions, • Operators: Axioms or transformation on formulae vs. modification of data structures by programs → find a sequence of actions (a plan) that brings The agent can gain information about the effects of us from the initial situation to a situation in actions by inspecting the operators. which the goal conditions hold. 3 4
Planning as Logical I nference ( 1 ) Planning vs. Autom atic Program m ing Planning can be elegantly formalized with the help of the situation calculus . Difference between planning and automatic I nitial state : programming (generating programs): ) ⋀ ¬ Have(milk,s 0 ) ⋀ ¬ Have(banana,s 0 ) ⋀ ¬ Have(drill,s 0 At(Home,s 0 ) Operators (successor-state axioms): • In planning, one uses a logic-based ∀ a,s Have(milk, do(a,s)) ⇔ description of the environment. {a = buy(milk) ⋀ Poss(buy(milk), s) ⋁ Have(milk,s) ⋀ a ≠ ¬ drop(milk)} Goal conditions (query): • Plans are usually only linear programs (no ∃ s At(home, s) ⋀ Have(milk, s) ⋀ Have(banana,s) ⋀ Have(drill,s) control structures). When the initial state, all prerequisites and all successor-state axioms are given, the constructive proof of the existential query delivers a plan that does what is desired. 5 6 The STRI PS Form alism Planning as Logical I nference ( 2 ) STRIPS: STanford Research Institute Problem Solver The variable bindings for s could be as follows: (early 70s) do(go(home), do(buy(drill), do(go(hardware_store), do(buy(banana), do(buy(milk), The system is obsolete, but the formalism is still used. do(go(supermarket), s0)))))) Usually simplified version is used: I.e. the plan (term) would be W orld state (including initial state): Set of ground atoms (called fluents), no function symbols except for 〈 go(super_market), buy(milk), … 〉 constants, interpreted under closed world assumption However, the following plan is also correct: (CWA). Sometimes also standard interpretation, i.e. negative facts must be explicitly given 〈 go(super_market), buy(milk), drop(milk), buy(milk), … 〉 Goal conditions: Set of ground atoms In general, planning by theorem proving is very inefficient Note: No explicit state variables as in sitation calculus. Specialized inference system for limited representation. Only the current world state is accessible. → Planning algorithm 7 8
STRI PS Operators Actions and Executions Operators are triples, consisting of Action Description: Function name with parameters (as • An action is an operator, where all variables in situation calculus) have been instantiated : Preconditions: Conjunction of positive literals; must be • Op ( Action: Go(), true before the operator can be applied (after variables are instantiated) Precond: At(Home) , Path(Home, SuperMarket), , ¬ At(Home) ) Effect: At(Supermarket) Effects: Conjunction of positive and negative literals; positive literals are added (ADD list), negative literals • An action can be executed in a state, if its deleted (DEL list) (no fram e problem!). precondition is satisfied. It will then bring Op( Action : Go(here,there), about its effects. Precond : At(here) , Path(here, there), Effect : At(there) , ¬ At(here)) 9 10 Searching in the State Space Linear Plans We can now search through the state space (the set of • A sequence of actions is a plan all states formed • For a given initial state I and goal conditions by truth assignments to G , such a plan P can be successfully fluents) – and in executed in I iff there exists a sequence of this way reduce states s 0 , s 1 , … , s n such that planning to – the i th action in P can be executed in s i-1 and results searching. in s i We can search – s 0 = I and s n satisfies G forwards • P is called a solution to the planning ( progression planning ): problem specified by the operators , I and G Or alternatively, we can start at the goal and work backwards ( regression planning ). 11 12 Possible since the operators provide enough information
Searching in the Plan Space Plan = Sequence of Actions? Instead of searching in the state space, we can search in the Often, however, it is neither meaningful nor possible to commit to a space of all plans . specific order early-on (put on socks and shoes). The initial state is a partial plan containing only start and goal � Non-linear or partially-ordered plans ( least-com m itm ent states: planning ) The goal state is a com plete plan that solves the given problem: Operators in the plan space: Refinem ent operators make the plan more complete (more steps etc.) Modification operators modify the plan (in the following, we use 13 14 only refinement operators) Representation of Non-linear Plans Com pleteness and Consistency A plan step = STRIPS operator (or action in the final plan) Com plete Plan : A plan consists of Every precondition of a step is fulfilled: • A set of plan steps with partial ordering (< ), ∀ S j ∀ c ∈ Precond(S j ) : where S i < S j implies S i must be executed before ∃ S i and c ∈ with S i < S j Effects(S i ) and S j . for every linearization of the plan: ∀ S k , ¬ c ∉ with S i < S k < S j Effect(S k ). • A set of variable assignm ents x = t , where x is a variable and t is a constant or a variable. Consistent Plan : • A set of causal relationships S i → S j means “S i if S i < S j , then S j � S i and if x = A , then x ≠ B for distinct A and B for a variable x . ( unique produces the precondition c for S j ” (implies S i < name assumption = UNA) S j ). A com plete, consistent plan is called a solution to a Solutions to planning problems must be com plete planning problem (all linearizations are executable linear and consistent . plans ) 15 16
Plan Refinem ent ( 1 ) Exam ple Regression Planning: Fulfils the Have predicates: … after instantiation of the variables: Actions: Op( Action : Go(here, there), Op( Action : Buy(store, x), Precond : At(here) ⋀ Precond : At(store) ⋀ Path(here, there), Sells(store, x), Effect : At(there) ⋀ ¬ At(here)) Effect : Have(x)) Note: there, here, x, store are variables. Thin arrow = < , thick arrow = causal relationship + < Note: In figures, we may just write Buy(Banana) instead of Buy(SM, Banana) 17 18 Plan Refinem ent ( 3 ) Plan Refinem ent ( 2 ) First, you have to go there… Shop at the right store… Note: So far no searching, only simple backward chaining. Now : Conflict! If we have done go( HW S) , we are no longer At( hom e) . Likewise for go( SM) . 19 20
Protection of Causal Links A Different Plan Refinem ent… • We cannot resolve the conflict by “protection”. → It was a mistake to choose to refine the plan. Alternative: When instantiating At(x) in go(SM) , choose x = HWS (with • causal relationship) Note: This threatens the purchase of the drill � promotion of go(SM) . • (a) Conflict: S 3 threatens the causal relationship between S 1 and S 2 . Conflict solutions: (b) Dem otion : Place the threatening step before the causal relationship. (c) Prom otion : Place the threatening step after the causal relationship. 21 22 The Com plete Solution The POP Algorithm 23 24
Recommend
More recommend