STRIPS examples Exercises 1 STRIPS describing goals and
• STRIPS examples • Exercises 1
STRIPS: describing goals and state STRIPS: STanford Research Institute Planning System Basic approach in GPS (general Problem Solver): • Find a “difference” (Something in G that is not provable in S 0) • Find a relevant operator f for reducing the difference • Achieve precondition of f; apply f; from resultant state, achieve G. 2
STRIPS planning • STRIPS uses logical formulas to represent the states S 0, G, P, etc: • Description of operator f: 3
Example: The move operator 4
Example 1: The move operator S 0 ->P x/B, y/A, z/Fl P: Clear(x) Clear(z) f(P)->G x/B, y/A, z/Fl On(x, y) G f: move(x, y, z) add: On(x, z), Clear(y) del: On(x, y), Clear(z) On(x, z) f(P) : Clear(x) Clear(y) 5
Example 2: robot operators (Add object’s location sentence) go(x, y) “go from x to y” pre: At. R(x) del: At. R(x) add: At. R(y) revise 修正する eff: At. R(x) At. R(y) pickup(x) “pick up x at y” pre: At(x, y), At. R(y, ) Empty-H At(x, y) Object, x, is at the room, y. del: At(x, y), Empty-H add: Holding(x) putdown(x) “put down x at y” eff: Holding(x) pre: Holding(x), At. R(y) del: Holding(x) add: At(x, y) eff: Holding(x) At(x, y) 6
Example 2: Get the slipper S 0: At. R(A) Empty-H G 0: At. R(A) Holding(slipper 1) At(slipper 1, B) Difference: Holding(slipper 1) in G 0 but nor in S 0. Schema 概要な式 An operator is usually written in the scheme form Relevant operator instance: pickup(slipper 1) (schema pickup(x), x/slipper 1) Pre: At(slipper 1, y), At. R(y), Empty-H Pre: (y/B) ->Pre’: At(slipper 1, B), At. R(B), Empty-H But At. R(B) is not in S 0! reduce 減少させる To reduce the difference between: At. R(A) and At. R(B) Relevant operator instance: go(x, B) by (x/A) go(A, B) Pre: At. R(A) Del: At. R(A) Add: At. R(B) 7
Example 3: Tree representation S 0 G 1 S 1 G 0 S 0: At. R(A) S 0 ->G 0 Empty-H S 1: At. R(B) Holding(slipper 1) At(slipper 1, B) S 0 ->G 1 At. R(y) S 1 ->G 0 G 1 ->S 1 y/B step 2: pickup(slipper 1) Empty-H Pick up slipper 1 at B At(slipper 1, y) S 3 ->G 4 G 4 ->S 4 At. R(B) Step 3: go(B, A) y/B x/A x/B S 4 ->G 0 G 0: At. R(A) Holding(slipper 1) S 0 ->G 2 G 2 ->S 2 At. R(A) step 1: go(A, B) S 2 ->G 1 G 1: At. R(B) Empty-H At(slipper 1, B) 8
Exercise: The move operator S 0 : G 0 : B A C A B C 9
Exercise: The move operator S 0: Clear(Fl) G: Clear(Fl) Clear(A) On(C, Fl) B Clear(B) A C On(A, C) On(B, Fl) Clear(A) A B C On(C, Fl) On(B, C) On(A, B) S 0 G 1 G 3 = G Add: On(B, C) Pre: ( y 1/Fl) f: Move (B, y 1, C) Clear(B), On(B, Fl) Clear(C) Add: Clear(C) Eff: ( y 1/Fl) G 1 G 3 Add: On(B, C) Add: On(A, B) Del: On(B, Fl), Clear(C) f: Move (A, y 2, B) G 2: G 1 Clear(Fl) f: Move (x 1, C, z 1) Clear(A) Pre: ( y 2/Fl) Eff: ( y 2/Fl) On(C, Fl) Clear(A), Clear(B) Add: On(A, B)) On(A, Fl) Del: Clear(B), On(A, Fl) Pre: ( x 1/A, z 1/Fl) Eff: ( x 1/A, z 1/Fl) On(B. C) Clear(A), Clear(Fl) Add: Clear(C), On(A, Fl) Clear(C) On(A, C) Del: On(A, C) On(A, Fl) S 0: G 2 Clear(Fl) Clear(A) G 1: G 3 Clear(Fl) Clear(B) Clear(A) On(B, Fl) On(C, Fl) On(B. C) On(C, Fl) Clear(C) On(A, Fl) Clear (B) On(A, C) On(B, Fl) Clear(B) 10 On(B, Fl) On(A. B)
Example 3: Block world A B C F 1 F 2 F 3 Start state S 0 Goal state G 0 11
Example 3: Block world A B C F 1 F 2 F 3 Start state S 0: On(C, Fl) On(B, C) delete list Goal state G 0: On(C, F 3) add list On(A, B) Clear(A) On(B, C) On(A, B) Operators: Move(x, y, z) “Move x from y to z” Clear(A) Clear(F 2) Clear(F 1) Clear(F 3) Clear(F 2) S 0 G 2 G 1 G’ 0 G’’ 0 G 0 12
S 0: On(C, Fl) On(B, C) On(A, B) Sub-goal: to achieve one of the conjuncts, G’ 0 S 0 ----->G’ 0 Clear(A) G’ 0: On(C, F 3) diff: On(C, F 3) Clear(F 2) Clear(F 3) y/F 1 S 0 ----->G 1 G 1 ---->S 1 pre: On(C, F 1), Clear(F 3), Clear(C) f: Move(C, y, F 3) G 0: On(B, A) On(B, C) On(A, F 2) On(A, B) Clear(A) Clear(C) Clear(F 2) Clear(F 1) S 1 --> G’ 0 f 3: Move(C, F 1, F 3) x 1/B, z 1/A S 0 ----->G 2 G 2 ---->S 2 pre: On(B, C), Clear(A), Clear(B) f: Move(x 1, C, z 1) S 2 -->G 1 f 2: Move(B, C, A) x 2/A, z 2/F 2 S 0 ----->G 3 G 3 ---->S 3 pre: On(A, B), Clear(A), Clear(F 2) f: Move(x 2, B, z 2) f 1: Move(A, B, F 2) On(C, F 3) S 3 -->G 2 13
Sub-goal: to achieve one of the conjuncts, G’’ 0 S 0=G’ 0: On(C, F 3) On(B, A) S 0 ----->G’’ 0 On(A, F 2) Clear(B) G’’ 0: On(B, C) diff: On(B, C) Clear(F 1) G’’ 0: On(C, F 3) G 0: On(C, F 3) On(B, C) On(A, F 2) On(A, B) Clear(A) Clear(F 2) Clear(F 1) y/A S 0 ----->G 1 G 1 ---->S 2 pre: On(B, A), Clear(C), Clear(B) f: Move(B, y, C) S 2 -->G 0 f 5: Move(B, A, C) S 0=G’’ 0: On(C, F 3) On(B, C) On(A, F 2) Sub-goal: to achieve one of the conjuncts, G’’’ 0 S 0 ----->G’’’ 0 Clear(B) G’’’ 0: On(A, B) diff: On(A, B) G’’’ 0: On(C, F 3) On(B, C) On(A, B) Clear(F 1) y/F 2 S 0 ----->G 1 G 1 ---->S 2 pre: On(A, F 2), Clear(A), Clear(B) f: Move(A, y, B) f 4: Move(A, F 2, B) On(C, F 3) On(B, C) Clear(A) G 0: = Clear(A) Clear(F 1) Clear(F 2) S 2 -->G 0 14
A sequence plan structure NIL finish On(A, B) 5 Clear(F 2) 1 4 Move(A, B, F 2) On(A, F 2) Clear(B) Clear(F 2) Clear(A) Move(B, A, C) On(B, A) 2 Move(A, B, F 2) On(A, B) On(B, C) Clear(C) Move(B, C, A) On(B, C) Clear(A) On(C, F 3) 3 On(C, F 1) Clear(F 1) Move(C, F 1, F 3) Clear(F 3) start T Plan sequence: Move(A, B, F 2), Move(B, C, A), Move(C, F 1, F 3), Move(B, A, C), Move(A, F 2, B) 15
Quiz What are three steps in STRIPS? 16
- Slides: 16