planning and partial order planning
play

Planning and Partial-Order Planning Sections 11.1-11.3 Ch. 11a - PowerPoint PPT Presentation

Planning and Partial-Order Planning Sections 11.1-11.3 Ch. 11a p.1/49 Outline Search vs. planning STRIPS operators Partial-order planning Additional reference used for the slides: Weld , D.S. (1999). Recent advances in AI planning. AI


  1. Planning and Partial-Order Planning Sections 11.1-11.3 Ch. 11a – p.1/49–

  2. Outline Search vs. planning STRIPS operators Partial-order planning Additional reference used for the slides: Weld , D.S. (1999). Recent advances in AI planning. AI Magazine , 20(2), 93-122. Ch. 11a – p.2/49–

  3. Search vs. planning Consider the task get milk, bananas, and a cordless drill Standard search algorithms seem to fail miserably: Talk to Parrot Go to Pet Store Buy a Dog Go to School Go to Class Go to Supermarket Buy Tuna Fish START Buy Arugula Go to Sleep Read A Book Buy Milk ... FINISH Sit in Chair Sit Some More Read A Book etc. etc. After-the-fact heuristic/goal test inadequate Ch. 11a – p.3/49–

  4. Search vs. planning (cont’d) Search Planning Lisp data structures Logical sentences States Lisp code Preconditions/outcomes Actions Goal Lisp code Logical sentence (conjunction) Sequence from S 0 Constraints on actions Plan Ch. 11a – p.4/49–

  5. 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. 11a – p.5/49–

  6. STRIPS operators Tidily arranged actions descriptions, restricted language At(p) Sells(p,x) BUY (x) Have(x) A CTION : Buy ( x ) P RECONDITION : At ( p ) , Sells ( p, x ) E FFECT : Have ( x ) Ch. 11a – p.6/49–

  7. STRIPS operators A CTION : Buy ( x ) P RECONDITION : At ( p ) , Sells ( p, x ) E FFECT : Have ( x ) [Note: this abstracts away many important details!] ⇒ efficient algorithm Restricted language = Precondition: conjunction of positive literals Effect: conjunction of literals (A complete set of STRIPS operators can be translated into a set of successor-state axioms) Ch. 11a – p.7/49–

  8. 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. 11a – p.8/49–

  9. 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. 11a – p.9/49–

  10. 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. 11a – p.10/49–

  11. 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. 11a – p.11/49–

  12. Example START CleanLeftSock CleanRightSock OC= LeftShoeOn for FINISH RightShoeOn for FINISH LeftShoeOn RightShoeOn FINISH Ch. 11a – p.12/49–

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

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

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

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

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

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

  19. 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. 11a – p.19/49–

  20. POP is a search in the plan space function T REE -S EARCH ( problem, fringe ) returns a solution, or failure fringe ← I NSERT (M AKE -N ODE (I NITIAL -S TATE [ problem ]), fringe ) loop do if E MPTY ? ( fringe ) then return failure node ← R EMOVE -F IRST ( fringe ) if G OAL -T EST [ problem ] applied to S TATE [ node ] succeeds then return S OLUTION ( node ) fringe ← I NSERT -A LL (E XPAND ( node, problem ), fringe ) Ch. 11a – p.20/49–

  21. 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. Ch. 11a – p.21/49–

  22. POP algorithm specifics (cont’d) The successors function could either close an open condition or resolve a threat. 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. 11a – p.22/49–

  23. 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. 11a – p.23/49–

  24. 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. 11a – p.24/49–

  25. Shopping example INIT 0 The operators are: Agenda: at(H) GO (?x, ?y) open subgoals: preconditions: at(?x) ~bought(A) bought(A) for g effects: ~at(?x), at(?y) ~bought(B) bought(B) for g at(H) for g BUY (?s, ?i) preconditions: at(?s), ~bought(~i) The subgoals that are bought(A) effects: bought(?i) currently open are bought(B) italicized. at(H) GOAL g add a go(J,H) action for at(H) for g add a causal link from INIT for at(H) for g 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) GOAL GOAL g g new Agenda: open subgoals: bought(A) for g bought(B) for g at(J) for 1 Ch. 11a – p.25/49–

  26. Shopping example (cont’d) add a go(H,J) action (2) INIT 0 New agenda: at(H) open subgoals: ~bought(A) bought(A) for g at(H) ~bought(B) bought(B) for g GO(H,J)2 at(H) for 2 ~at(H) at(J) GO(J,H) 1 bought(A) at(H) ~at(J) bought(B) GOAL g add a go(J, H) action supply at(H) for 2 from INIT−0 INIT 0 . . . at(H) ~bought(A) ~bought(B) GO(H,J)2 ~at(H) at(J) GO(J,H) 1 bought(A) at(H) ~at(J) bought(B) GOAL g Ch. 11a – p.26/49–

  27. Shopping example (cont’d) add BUY(J,A) (3) new agenda: open subgoals: INIT 0 bought(B) for g ~bought(A) ~bought(A) for 3 ~bought(B) at(H) at(J) for 3 GO(H,J)2 ~at(H) at(J) at(J) ~bought(A) BUY(J,A) GO(J,H) 1 3 at(H) ~at(J) bought(B) bought(A) GOAL g support ~bought(A) from INIT−0 new agenda: open subgoals: INIT 0 bought(B) for g at(J) for 3 at(H) ~bought(A) GO(H,J)2 ~at(H) at(J) at(J) BUY(J,A) GO(J,H) 1 3 at(H) ~at(J) bought(B) bought(A) GOAL g Support at(J) from GO(H,J)−2 Ch. 11a – p.27/49–

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