strips planning
play

STRIPS Planning Set of operators , where each operator has Set of - PDF document

STRIPS Planning Set of operators , where each operator has Set of parameters Set of preconditions Set of effects , consisting of add effects and delete effects. Set of objects to instantiate operators parameters fully


  1. “STRIPS” Planning • Set of operators , where each operator has – Set of parameters – Set of preconditions – Set of effects , consisting of add effects and delete effects. • Set of objects to instantiate operator’s parameters fully instantiated operator ≡ action • Set of propositions representing initial state • Set of propositions representing goals Planning problem : Find sequence of actions that, starting in initial state, achieve all the goals Graph-Plan 1

  2. Approaches to STRIPS planning • Search through space of world states – forward search, – regression search – bi-directional search – means-ends analysis – . . . • Search through space of plans – total order planning – partial order planning • Search through planning graph Graph-Plan 2

  3. GraphPlan Approach 1. Construct a “PlanGraph” that contains all valid plans + other stuff (invalid plans) up to a maximum depth 2. Search PlanGraph for valid plan . . . then return that plan Graph-Plan 3

  4. Simple Cake-Eating Domain • Initial: HaveCake ∧ ¬ EatenCake • Goal: HaveCake ∧ EatenCake • Actions:   Eat Op PreC: HaveCake   ¬ HaveCake ∧ EatenCake Eff:   Bake ¬ HaveCake Op PreC:   Eff: HaveCake • PlanGraph A S 0 S 1 A 1 S 2 0 Bake(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Eat(Cake) Eat(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Graph-Plan 4

  5. Parts of a PlanGraph A S 0 S 1 A 1 S 2 0 Bake(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Eat(Cake) Eat(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) “2-leveled” Graph �S 0 , A 0 , S 1 , A 1 , . . . � • S 0 : propositions in initial state • A i : each action whose preconditions all occur in level S i − 1 • S i : each prop’n that is ADDed/DELETEd by ⋆ an action in level A i ⋆ a “No-Op” (persistance) • Mutex links ⋆ between actions in level A i ⋆ between propositions in level S i “ mut ually ex clusive” “cannot occur in same plan” Graph-Plan 5

  6. Mutex Conditions#1: Actions A S 0 S 1 A 1 S 2 0 Bake(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Eat(Cake) Eat(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Between 2 actions O 1 and O 2 , same level A i : • Inconsistent effects O 1 : Eff negates O 2 : Eff EatenCake , NoOp(HaveCake) disagree wrt “ HaveCake ” = ¬ HaveCake EatenCake:Eff = HaveCake NoOp(HaveCake):Eff • Interference O 1 : Eff negates O 2 : PreC EatenCake interfers with NoOp(HaveCake) : = EatenCake:Eff ¬ HaveCake = NoOp(HaveCake):PreC HaveCake • Competing Needs O 1 : PreC negates O 2 : PreC = Bake:PreC ¬ HaveCake = Eat:PreC HaveCake Graph-Plan 6

  7. Mutex Conditions#2: Propositions A S 0 S 1 A 1 S 2 0 Bake(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Have(Cake) Eat(Cake) Eat(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Eaten(Cake) Between 2 propositions ρ 1 and ρ 2 , same level S i : • Negation ρ 1 = ¬ ρ 2 • Inconsistent Support Every action achieving ρ 1 (from S i − 1 ) is mutex with every action achieving ρ 2 In S 1 : HaveCake mutex EatenCake as only way to achieve HaveCake : NoOp(HaveCake) is mutex with only way to achieve EatenCake : Eat N.b. : Not mutex at S 2 ! Graph-Plan 7

  8. Planning Graphs • A valid plan is “2-leveled” graph – two kinds of nodes (propositions, actions) alternates: proposition level, action level – 5 kinds of edges ⋆ precondition ( S i → A i ) ⋆ add effect ( A i → S i +1 ) ⋆ delete effect ( A i → S i +1 ) ⋆ mutex-action ( A i ↔ A i ) ⋆ mutex-prop ( S i ↔ S i ) – Include action O at action-level A i if all preconditions at proposition-level S i – Include proposition ρ at proposition-level S i if it is add/delete effect of action O ∈ A i − 1 (including no-op actions) Restriction: Allow actions O 1 , O 2 at same time t ONLY if don’t interfere with each other • PlanningGraph ≈ valid plan but without no-interfere restriction Graph-Plan 8

  9. GraphPlan Algorithm function Graphplan( problem ) returns solution or failure graph ← Initial-Planning-Graph( problem ) goals ← Goals[ problem ] loop do if goals all non-mutex in last level of graph then do solution ← Extract-Solution( graph , goals , Length( graph )) if solution � = failure then return solution else if No-Solution-Possible( graph ) then return failure graph ← Expand-Graph( graph , problem ) end Graph-Plan 9

  10. Flat-Tire Domain Fl= Flat; Sp= Spare; Ax= Axel; Tr= Trunk; Gr= Ground • Initial: At(Fl, Ax) ∧ At(Sp, Tr) • Goal: At(Sp, Ax) • Actions:   TakeOutSpare PreC: At(Sp, Tr) Op   Eff: ¬ At(Sp, Tr) ∧ At(Sp, Gr)   RemoveFlat Op PreC: At(Fl, Ax)   Eff: ¬ At(Fl, Ax) ∧ At(Fl, Gr)   PutOnSpare Op PreC: At(Sp, Gr) ∧ ¬ At(Fl, Ax)   Eff: ¬ At(Sp, Gr) ∧ At(Sp, Ax)   LeaveOverNight {} PreC: Op   ¬ At(Sp, Gr) ∧ ¬ At(Sp, Ax) ∧ ¬ At(Sp, Tr) Eff:   ∧ ¬ At(Fl, Gr) ∧ ¬ At(Fl, Ax) Graph-Plan 10

  11. Flat-Tire in GraphPlan S 0 A S 1 A 1 S 2 0 At(Spare,Trunk) At(Spare,Trunk) At(Spare,Trunk) TakeOutSpare At(Spare,Trunk) At(Spare,Trunk) TakeOutSpare RemoveFlat RemoveFlat At(Flat,Axle) At(Flat,Axle) At(Flat,Axle) At(Flat,Axle) At(Flat,Axle) LeaveOvernight LeaveOvernight At(Spare,Axle) At(Spare,Axle) At(Spare,Axle) At(Spare,Axle) PutOnSpare At(Flat,Ground) At(Flat,Ground) At(Flat,Ground) At(Flat,Ground) At(Flat,Ground) At(Spare,Ground) At(Spare,Ground) At(Spare,Ground) At(Spare,Ground) At(Spare,Ground) Graph-Plan 11

  12. Trace of GraphPlan Algorithm #1 • S 0 : initial facts (include ¬ facts) • As At(Sp,Ax) �∈ S 0 do not call Extract-Solution • Expand-Graph forms A 0 with ⋆ 3 “real” actions ⋆ 5 no-op actions; S 1 is effects Expand-Graph then finds ⋆ 4 action-mutex within A 0 ⋆ 4 prop-mutex within S 1 • As At(Sp,Ax) �∈ S 1 do not call Extract-Solution • Expand-Graph forms A 1 with ⋆ 4 “real” actions ⋆ 7 no-op actions S 2 is effects Graph-Plan 12

  13. Mutex wrt FlatTire • Inconsistent Effects RemoveSpare + LeaveOvernight = RemoveSpare:Eff At(Sp,Gr) = LeaveOvernight:Eff ¬ At(Sp,Gr) • Inteference RemoveFlat + LeaveOvernight = RemoveFlat:PreC At(Sp,Ax) = ¬ At(Sp,Ax) LeaveOvernight:Eff • Competing Needs RemoveFlat + PutOnSpare = RemoveFlat:PreC At(Fl,Ax) = PutOnSpare:Eff ¬ At(Fl,Ax) • Inconsistent Support At(Sp,Ax) + At(Fl,Ax) in S 2 At(Sp,Ax) by PutOnSpare At(Fl,Ax) by NoOp[At(Fl,Ax)] and PutOnSpare mutex NoOp[At(Fl,Ax)] (Can’t put 2 objects in same place at same time) Graph-Plan 13

  14. Trace of GraphPlan Algorithm #2 • “All” goal literals, At(Sp, Ax) , in S 2 none are mutex . . . • So there MAY be solution . . . call Extract-Solution Extract-Solution(. . . ) Let G n be the GOAL at last level, S n For each i = n.. 1 ⋆ Let H i be a conflict-free subset of A i − 1 , that covers G i (in S i ) ⋆ Let G i − 1 be preconditions of H i . . . until reach state in S 0 satisfying all goals Action-set H is “conflict-free” ≡ no pair of H are mutex, and no pair of preconditions (in G ) are mutex Graph-Plan 14

  15. Trace of Extract-Solution = • G 2 { At(Sp,Ax) } = H 2 { PutOnSpare } • G 1 = { At(Sp,Gr) , ¬ At(Fl,Ax) } What is H 1 ? – Achieve At(Sp,Gr) by TakeOutSpare – Achieve ¬ At(Fl,Ax) by #1. LeaveOvernight #2. RemoveFlat But not #1, as LeaveOvernight is mutex with TakeOutSpare = { TakeOutSpare , RemoveFlat } ⇒ H 1 • G 0 = { At(Sp,Tr) , At(Fl,Ax) } As in G 0 ⊂ S 0 , DONE! Graph-Plan 15

  16. Extending PlanGraph Add action level A i : ForEach action ( ∗ ) O If O ’s preconditions all true in prop-level S i , and NOT mut-ex, Then add O to level A i include precondition-links create mutex ( O :actions-I-am-exclusive-of) Add prop-level S i +1 : ForEach effect ρ of each action in action-level A i Add ρ to prop-level S i +1 Add S ← ρ add- or delete- links Mark ρ 1 , ρ 2 as mutex if each way of generating ρ 1 is mutex to each way of generating ρ 2 ( ∗ ) each instantiation of each operator; including “no-op”s Graph-Plan 16

  17. Correctness Graphplan is sound and complete: ∗ any plan Graphplan finds is a legal plan ∗ if ∃ legal plan then Graphplan will find one. If ∃ valid plan using ≤ t time steps, Theorem: then plan is subgraph of (depth- t ) Planning Graph. + If Goals not satisfiable by any valid plan, then GraphPlan will halt, w/failure, in finite time. (extends most partial-order planners) Graph-Plan 17

  18. Leveling Off • GraphPlan ≈ Iterative deepening When to stop?? • Lemma: If no valid plan exists, then ∃ a prop-level S n s.t. all future proposition levels are identical to S n – Identical ≡ same propositions, mutual exclusions – graph has “ leveled off after S n ” • Corollary: No solution exists if – a goal does not appear in S n or – S n has mutually exclusive goals • Subtlety: { on(A,B) , on(B,C) , on(C,A) } Graph-Plan 18

  19. Termination Condition • Let S t i denote set of memoized goal sets at level i after an unsuccessful stage t • Theorem: If the graph has leveled off at level n and stage t has passed in which | S t − 1 | = | S t n | , then no valid plan exists n Graph-Plan 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend