classical planning partial order planning
play

Classical Planning Partial-Order Planning Sections 10.1,10.4.4 - PowerPoint PPT Presentation

Classical Planning Partial-Order Planning Sections 10.1,10.4.4 Nilufer Onder Department of Computer Science Michigan Technological University Ch. 10a p.1/47 Outline Search vs. planning PDDL operators Partial-order planning


  1. Classical Planning Partial-Order Planning Sections 10.1,10.4.4 —– Nilufer Onder Department of Computer Science Michigan Technological University Ch. 10a – p.1/47–

  2. Outline Search vs. planning PDDL operators Partial-order planning Ch. 10a – p.2/47–

  3. What is AI planning? Planning is the task of finding a set of actions that will achieve a goal. A planner is a program that searches for a plan. It inputs a description of the world and the goals. The output is a plan. The simplest plan is a sequence of actions: ‘‘do action1, do action2 ...’’ More complex plans may include branching actions: “if (condition) do action1 else do action2” Ch. 10a – p.3/47–

  4. Planning Domain Definition Language (PDDL) Tidily arranged actions descriptions, restricted language At(s) ~Bought(x) Sells(s,x) BUY (s,x) Bought(x) A CTION : Buy ( s, x ) P RECONDITION : At ( s ) , ¬ Bought ( x ) , Sells ( s, x ) E FFECT : Bought ( x ) Ch. 10a – p.4/47–

  5. PDDL operators (cont’d) A CTION : Buy ( s, x ) P RECONDITION : At ( s ) , ¬ Bought ( x ) , Sells ( s, x ) E FFECT : Bought ( x ) Restricted language = ⇒ efficient algorithm (but many important details will have to be abstracted away) Action schema: name, parameters, preconditions, effects Precondition: conjunction of positive literals Effect: conjunction of literals STRIPS is the earliest planning representation Ch. 10a – p.5/47–

  6. Search vs. planning (cont’d) Search Planning Data structure Logical sentences States Program Preconditions/outcomes Actions Program Logical sentence Goal (conjunction) Path from S 0 (Sequence of) actions Plan Ch. 10a – p.6/47–

  7. Search vs. planning (cont’d) Planning systems do the following: 1. open up action and goal representation to allow selection 2. divide-and-conquer by subgoaling 3. relax requirement for sequential construction of solutions Ch. 10a – p.7/47–

  8. States The state of the world is represented by a collection of variables ( factored representation ) Each state is represented as a conjunction of fluents that are ground, functionless atoms. A state is a set ( set semantics ) Use database semantics, closed world assumption : If a fluent is not mentioned, assume it is false. Fluents that are non-ground, negated, or using functions are not allowed. Ch. 10a – p.8/47–

  9. Partially ordered plans Partially ordered collection of steps with START step has the initial state description as its effect FINISH step has the goal description as its precondition causal links from outcome of one step to precondition of another temporal ordering between pairs of steps Ch. 10a – p.9/47–

  10. Partially ordered plans (cont’d) A partially ordered plan is a 5-tuple (A, O, C, OC, UL) A is the set of actions that make up the plan. They are partially ordered. O is a set of ordering constraints of the form A ≺ B . It means A comes before B . C is the set of causal links in the form ( A, p, B ) where A is the supplier action , where B is the consumer action , and p is the condition supplied. It is read as “ A achieves p for B .” Ch. 10a – p.10/47–

  11. Partially ordered plans (cont’d) A partially ordered plan is a 5-tuple (A, O, C, OC, UL) OC is a set of open conditions, i.e., conditions that are not yet supported by causal links. It is of the form p for A where p is a condition and A is an action. UL is a set of unsafe links, i.e., causal links whose conditions might be undone by other actions. Ch. 10a – p.11/47–

  12. Partially ordered plans (cont’d) A plan is complete iff every precondition is achieved, and there are no unsafe links. A precondition is achieved iff it is the effect of an earlier step and no possibly intervening step undoes it In other words, a plan is complete when OC ∪ UL = ∅ . OC ∪ UL is referred to as the flaws in a plan. When a causal link is established, the corresponding condition is said to be closed . Ch. 10a – p.12/47–

  13. Example START CleanLeftSock CleanRightSock OC= LeftShoeOn for FINISH RightShoeOn for FINISH LeftShoeOn RightShoeOn FINISH Ch. 10a – p.13/47–

  14. Example (cont’d) START CleanLeftSock CleanRightSock OC= RightShoeOn for FINISH LeftSockOn for LEFTSHOE LeftSockOn LEFT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.14/47–

  15. Example (cont’d) START CleanLeftSock CleanRightSock OC = LEFT SOCK CleanLeftSock for LEFTSOCK RightShoeOn for FINISH LeftSockOn LEFT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.15/47–

  16. Example (cont’d) START CleanLeftSock CleanRightSock OC = LEFT SOCK RightShoeOn for FINISH LeftSockOn LEFT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.16/47–

  17. Example (cont’d) START CleanLeftSock CleanRightSock OC = LEFT SOCK RightSockOn for RIGHTSHOE LeftSockOn RightSockOn LEFT SHOE RIGHT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.17/47–

  18. Example (cont’d) START CleanLeftSock CleanRightSock OC = LEFT SOCK RIGHT SOCK CleanRightSock for RIGHTSOCK LeftSockOn RightSockOn LEFT SHOE RIGHT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.18/47–

  19. Example (cont’d) START CleanLeftSock CleanRightSock OC= LEFT SOCK RIGHT SOCK { } LeftSockOn RightSockOn LEFT SHOE RIGHT SHOE LeftShoeOn RightShoeOn FINISH Ch. 10a – p.19/47–

  20. Planning process Operators on partial plans: **** close open conditions: **** **** add a link from an existing action to an **** **** **** open condition **** **** add a step to fulfill an open condition **** resolve threats: **** **** order one step wrt another to remove **** **** **** possible conflicts Gradually move from incomplete/vague plans to complete, correct plans Backtrack if an open condition is unachievable or if a conflict is unresolvable Ch. 10a – p.20/47–

  21. POP is a search in the plan space function T REE -S EARCH ( problem ) returns a solution, or failure initialize the frontier using the initial state of problem loop do if the frontier is empty then return failure choose a leaf node and remove it from the frontier if the node contains a goal state then return the corresponding solution else expand the chosen node and add the resulting nodes to the frontier end Ch. 10a – p.21/47–

  22. POP algorithm specifics The initial state, goal state and the operators are given. The planner converts them to required structures. Initial state: M AKE -M INIMAL -P LAN ( initial,goal ) Goal-Test: S OLUTION ? ( plan ) S OLUTION ? returns true iff OC and UL are both empty. Successor function: The successors function could either close an open condition or resolve a threat. Ch. 10a – p.22/47–

  23. POP algorithm specifics (cont’d) function S UCCESSORS ( plan ) returns a set of partially ordered plans flaw-type ← S ELECT -F LAW -T YPE ( plan ) if flaw-type is an open condition then S need , c ← S ELECT -S UBGOAL ( plan ) return C LOSE -C ONDITION ( plan, operators, S need , c ) if flaw-type is a threat then S threat , S i , c, S j ← S ELECT -T HREAT ( plan ) return R ESOLVE -T HREAT (plan, S threat , S i , c, S j ) Ch. 10a – p.23/47–

  24. POP algorithm specifics (cont’d) function C LOSE -C ONDITION ( plan, operators, S need , c ) returns a set of partially ordered plans plans ← ∅ for each S add from operators or S TEPS ( plan ) that has c has an effect do new-plan ← plan if S add is a newly added step from operators then add S add to S TEPS ( new-plan ) add START ≺ S add ≺ FINISH to O RDERINGS ( new-plan ) add the causal link ( S add , c, S need ) to L INKS ( new-plan ) add the ordering constraint ( S add ≺ S need ) to O RDERINGS ( new-plan ) add new-plan to plans end return new-plans Ch. 10a – p.24/47–

  25. POP algorithm specifics (cont’d) function R ESOLVE -T HREAT ( plan, S threat , S i , c, S j ) returns a set of partially ordered plans plans ← ∅ // Demotion: new-plan ← plan add the ordering constraint ( S threat ≺ S i ) to O RDERINGS ( new-plan ) if new-plan is consistent then add new-plan to plans // Promotion: new-plan ← plan add the ordering constraint ( S j ≺ S threat ) to O RDERINGS ( new-plan ) if new-plan is consistent then add new-plan to plans return new-plans Ch. 10a – p.25/47–

  26. Shopping example START 0 The operators are: Agenda: at(H) GO (?x, ?y) open subgoals: preconditions: at(?x) ~bought(A) bought(A) for f effects: ~at(?x), at(?y) ~bought(B) bought(B) for f at(H) for f BUY (?s, ?i) preconditions: at(?s), ~bought(~i) The subgoals that are bought(A) effects: bought(?i) bought(B) currently open are italicized. at(H) FINISH f add a go(J,H) action for at(H) for f add a causal link from START for at(H) for f INIT INIT 0 0 at(H) at(H) ~bought(A) ~bought(A) ~bought(B) ~bought(B) at(J) bought(A) GO(J,H) 1 bought(B) bought(A) at(H) ~at(J) bought(B) FINISH FINISH f f new Agenda: open subgoals: bought(A) for f bought(B) for f at(J) for 1 Ch. 10a – p.26/47–

  27. Shopping example (cont’d) add a go(H,J) action (2) START 0 New agenda: at(H) open subgoals: ~bought(A) bought(A) for f at(H) ~bought(B) bought(B) for f GO(H,J)2 at(H) for 2 ~at(H) at(J) GO(J,H) 1 bought(A) at(H) ~at(J) bought(B) FINISH f add a go(J, H) action supply at(H) for 2 from START START 0 . . . at(H) ~bought(A) ~bought(B) GO(H,J)2 ~at(H) at(J) GO(J,H) 1 bought(A) ~at(J) at(H) bought(B) FINISH f Ch. 10a – p.27/47–

Recommend


More recommend