1 / 118

Lecture 4

Lecture 4. Planning. Lecture Plan. Planning: PDDL Partial Order Planning Planning Graphs and the Graph Plan Algorithm. PDDL: Planning Domain Definition Language. States Actions Goal. PDDL: Planning Domain Definition Language. States

jenski
Download Presentation

Lecture 4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 4 Planning

  2. Lecture Plan • Planning: • PDDL • Partial Order Planning • Planning Graphs and the Graph Plan Algorithm

  3. PDDL: Planning Domain Definition Language • States • Actions • Goal

  4. PDDL: Planning Domain Definition Language • States • States are specified by a set of 'atomic fluents.' • Fluents are propositions that can change their truth value • Atomic means these propositions are simple: They do not include conjunctions, disjunctions, conditionals or negation. • Database semantics is assumed, allowing negation by omission. • Unique names assumption • Closed-world assumption • Domain closure • Actions • Goal

  5. PDDL: Planning Domain Definition Language • States • Actions • Actions are specified by a set of preconditions and effects, both of which are conjunctions of literals. • Literals are simple atomic propositions or negations of atomic propositions. • All preconditions are current, all effects immediate. • Actions can be performed at a state is all positive literals are, and all negative literals are not, in the set of fluents at a state. • The effect of an action is to add all positive literals, and remove all negative literals, in the action's effects from the current state. • Where an action has non-trivial effects, this causes us to transition to a new state. • Goal

  6. How actions function as transitions: State 1 State 2 Action • Preconditions: Set, , of literals, where: • . • Effects: Set, , of literals. State 2: Set, ), of Atomic Fluents State 1: Set, F, of Atomic Fluents

  7. PDDL: Planning Domain Definition Language • States • Actions • Goal • The planning goal is specified by a conjunction of literals OR a schema which can be satisfied by such a conjunction of literals. • We have achieved a goal state when all positive literals are, and all negative literals are not, included in the current state specification.

  8. A PDDL Problem • An initial state • A set of actions, or action schema: Action schema use variables: • Action: Eat Cake (x,y) • Precondition: Cake(x), -Eaten(x), Person(y), Hungry(y) • Effect: Eaten(x), -Hungry(y) • A goal specification.

  9. PDDL Problems as Search • We must discover the transitions we can make: At each state, we must search through our actions to discover which actions may be performed there. • It is easy to search backwards and discover states that can transition to our current state given a possible action. To find predecessor state to current state given a particular action: Remove all effects (add negations) and add all preconditions (remove negations) from current state.

  10. PDDL Example: Initial State Initial state: Person (mike)

  11. PDDL Example: Actions Action: Go Shopping (x) Preconditions: Person(x) Effects: HasMix(x)

  12. PDDL Example: Actions Action: Make Cake(x) Preconditions: Person(x) HasMix (x) Effects: HasCake(x)

  13. PDDL Example: Actions Action: Wait(x) Preconditions: Person(x), -Hungry(x) Effects: Hungry(x)

  14. PDDL Example: Actions Action: Eat Cake A (x) Preconditions: Person(x), Hungry(x), HasCake(x) Effects: -HasCake(x), -Hungry(x), EatenCake(x)

  15. PDDL Example: Actions Action: Eat Cake B (x) Preconditions: Person(x), -Hungry(x), HasCake(x) Effects: -HasCake(x), -Person(x)

  16. PDDL Example: Goal Preconditions: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) We could have a goal specification that included variables. Eg Let anyone who is a person, not just mike, eat a cake while having a cake and not being hungry: Person(x), -Hungry(x), HasCake(x), EatenCake(x)

  17. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Person(mike)

  18. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Satisfied Person(mike)

  19. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Satisfied by omission Person(mike)

  20. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Unsatisfied Person(mike)

  21. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Unsatisfied Person(mike)

  22. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Unsatisfied Person(mike)

  23. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Unsatisfied Person(mike)

  24. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Satisfied Person(mike)

  25. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Initial State Satisfied (the second by omission). Person(mike)

  26. Action: Eat Cake A (x) Pre.: Person(x) Hungry(x), HasCake(x) Effects: -HasCake(x), EatenCake(x), -Hungry(x) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x), HasCake(x) Effects: -HasCake(x) -Person(x) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Goal Pre.: Person(mike), -Hungry(mike), HasCake(mike), EatenCake(mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) S1 Go Shopping (mike) Person(mike), HasMix(mike) Initial State S2 Wait (mike) Person(mike) Person(mike), Hungry(mike)

  27. Go Shopping (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike) S1 Initial State Person(mike), HasMix(mike) At the next step, from S1 we could go shopping again. But it wouldn’t change anything. S2 Wait (mike) Person(mike), Hungry(mike)

  28. Go Shopping (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike) S1 Initial State Person(mike), HasMix(mike) At the next step, from S1 we could go shopping again. But it wouldn’t change anything. S2 Wait (mike) The preconditions of the action are met... Person(mike), Hungry(mike)

  29. Go Shopping (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike) S1 Initial State Person(mike), HasMix(mike) At the next step, from S1 we could go shopping again. But it wouldn’t change anything. S2 Wait (mike) The preconditions of the action are met... Person(mike), Hungry(mike) But the effects are already true at this state.

  30. Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Person(mike), HasMix(mike) Person(mike), HasCake(mike) S2 Wait (mike) Or from S1 we could make a cake which would change things. Person(mike), Hungry(mike)

  31. Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Person(mike), HasMix(mike) Person(mike), HasCake(mike) S2 Wait (mike) Or from S1 we could make a cake which would change things. Person(mike), Hungry(mike) The preconditions of the action are met...

  32. Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Person(mike), HasMix(mike) Person(mike), HasCake(mike) S2 Wait (mike) Or from S1 we could make a cake which would change things. Person(mike), Hungry(mike) The preconditions of the action are met... And the effects cause one fluent to be made true...

  33. Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) -HasMix(x) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Person(mike), HasMix(mike) Person(mike), HasCake(mike) S2 Wait (mike) Or from S1 we could make a cake which would change things. Person(mike), Hungry(mike) The preconditions of the action are met... And the effects cause one fluent to be made true... And one to be made false.

  34. Go Shopping (mike) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Person(mike), HasMix(mike) Person(mike), HasCake(mike) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Wait (mike) S2 S4 Wait (mike) Person(mike), Hungry(mike) Person(mike), HasMix(mike) Or we could wait.

  35. Go Shopping (mike) Make Cake (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike) S1 S3 Initial State Wait (mike) Person(mike), HasCake(mike) Go Shopping (mike) S2 S4 Wait (mike) Person(mike), Hungry(mike) Person(mike), HasMix(mike) From S2 we can only go shopping. And that will take us to S4 by another route.

  36. Go Shopping (mike) S5 Person(mike), HasMix(mike), HasCake(mike) Go Shopping (mike) Make Cake (mike) Go Shopping (mike) S1 S3 Initial State Wait (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Person(mike), HasCake(mike) S2 S4 Wait (mike) Go Shopping (mike) From S3 we can go shopping again.

  37. Go Shopping (mike) S5 Person(mike), HasMix(mike), HasCake(mike) Go Shopping (mike) Make Cake (mike) Eat Cake B (mike) Go Shopping (mike) S1 S3 S6 Initial State Wait (mike) Person(mike), HasCake(mike) Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x) HasCake(x) Effects: -Person(x), -HasCake(x) S2 S4 Wait (mike) Go Shopping (mike) Or we can eat the cake with action ’Eat Cake B’ (by omission Mike is not hungry). This leads to a state with no atomic fluents. Everything is negated. Including ’Person(mike)’: Mike is dead in this state!

  38. Go Shopping (mike) S5 Person(mike), HasMix(mike), HasCake(mike) Go Shopping (mike) Make Cake (mike) Eat Cake B (mike) Go Shopping (mike) S1 S3 S6 Initial State Wait (mike) Person(mike), HasCake(mike) S7 Person(mike), HasCake(mike), Hungry(mike) Wait (mike) S2 S4 Wait (mike) Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) Go Shopping (mike) Or we can wait (and Mike lives...)

  39. Go Shopping (mike) S5 Person(mike), HasMix(mike) Go Shopping (mike) Make Cake (mike) Eat Cake B (mike) Go Shopping (mike) S1 S3 S6 Initial State From S4 we can go shopping again, but that doesn’t change anything. Wait (mike) Wait (mike) S7 Person(mike), HasCake(mike), Hungry(mike) S2 S4 Wait (mike) Go Shopping (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike)

  40. Go Shopping (mike) S5 Person(mike), HasMix(mike), HasCake(mike) Go Shopping (mike) Make Cake (mike) Eat Cake B (mike) Go Shopping (mike) S1 S3 S6 Initial State Wait (mike) Wait (mike) S7 Person(mike), HasCake(mike), Hungry(mike) S2 S4 Make Cake (mike) Wait (mike) Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) Or we can make a cake, which takes us to S7 Go Shopping (mike)

  41. Go Shopping (mike) S5 Person(mike), HasMix(mike), HasCake(mike) Go Shopping (mike) Make Cake (mike) Eat Cake B (mike) Go Shopping (mike) S1 S3 S6 Initial State Wait (mike) Wait (mike) S7 Person(mike), HasCake(mike), Hungry(mike) S2 S4 Make Cake (mike) Wait (mike) Go Shopping (mike) Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) Lets compress the diagram... Go Shopping (mike)

  42. Person(mike), HasMix(mike), HasCake(mike) S5 S1 S3 S6 Initial State S2 S4 S7 Lets compress the diagram... Person(mike), HasCake(mike), Hungry(mike)

  43. Person(mike), HasMix(mike), HasCake(mike) S5 Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) Go Shopping (mike) S1 S3 S6 Initial State S2 S4 S7 From S5, we can go shopping, changing nothing... Person(mike), HasCake(mike), Hungry(mike)

  44. Person(mike), HasMix(mike), HasCake(mike) Make Cake (mike) S5 Action: Make Cake(x) Pre.: Person(x) HasMix(x) Effects: HasCake(x) Go Shopping (mike) S1 S3 S6 Initial State S2 S4 From S5, we can make a cake... Leading back to S3, since we cannot express that we have multiple cakes. S7 Person(mike), HasCake(mike), Hungry(mike)

  45. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Go Shopping (mike) Or we can eat the cake, leading to another way to kill Mike. S1 S3 S6 Initial State Action: Eat Cake B (x) Pre.: Person(x) -Hungry(x) HasCake(x) Effects: -Person(x), -HasCake(x) S2 S4 S7 Person(mike), HasCake(mike), Hungry(mike)

  46. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Person(mike), HasMix(mike), HasCake(mike), Hungry(mike) S9 Go Shopping (mike) Wait (mike) S1 S3 S6 Initial State Or we can wait. S2 S4 Action: Wait (x) Pre.: Person(x) -Hungry(x) Effects: Hungry(x) S7 Person(mike), HasCake(mike), Hungry(mike)

  47. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Person(mike), HasMix(mike), HasCake(mike), Hungry(mike) S9 Go Shopping (mike) Wait (mike) S1 S3 S6 Initial State S2 S4 We can’t do anything from S6, since all actions require Person(mike). S7 Person(mike), HasCake(mike), Hungry(mike)

  48. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Person(mike), HasMix(mike), HasCake(mike), Hungry(mike) S9 Go Shopping (mike) Wait (mike) From S7, we can go shopping, leading to S9. S1 S3 S6 Initial State S2 S4 Go Shopping (mike) Action: Go Shopping (x) Pre.: Person(x) Effects: HasMix(x) S7 Person(mike), HasCake(mike), Hungry(mike)

  49. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Person(mike), HasMix(mike), HasCake(mike), Hungry(mike) S9 Go Shopping (mike) Wait (mike) Or we can eat the cake. This time we use ’Eat Cake A’, since Mike is hungry. So this time he lives! (Yay) S1 S3 S6 Initial State S2 S4 Go Shopping (mike) Action: Eat Cake A (x) Pre.: Person(x) Hungry(x) HasCake(x) Effects: Hungry(x) -HasCake(x) Person(mike), EatenCake(mike) S7 S10 Eat Cake A (mike) Person(mike), HasCake(mike), Hungry(mike)

  50. Person(mike), HasMix(mike), HasCake(mike) Eat Cake B (mike) Make Cake (mike) S8 S5 HasMix(mike) Person(mike), HasMix(mike), HasCake(mike), Hungry(mike) S9 Go Shopping (mike) Wait (mike) S1 S3 S6 Initial State Lets clear out the diagram (and stop showing actions)... S2 S4 Go Shopping (mike) Action: Eat Cake A (x) Pre.: Person(x) Hungry(x) HasCake(x) Effects: Hungry(x) -HasCake(x) Person(mike), EatenCake(mike) S7 S10 Eat Cake A (mike) Person(mike), HasCake(mike), Hungry(mike)

More Related