Presentation is loading. Please wait.

Presentation is loading. Please wait.

For Wednesday Read chapter 12, sections 3-5 Program 2 progress due.

Similar presentations


Presentation on theme: "For Wednesday Read chapter 12, sections 3-5 Program 2 progress due."— Presentation transcript:

1 For Wednesday Read chapter 12, sections 3-5 Program 2 progress due

2 Program 2 Any questions?

3 Plan-Space Planners Plan­space planners search through the space of partial plans, which are sets of actions that may not be totally ordered. Partial­order planners are plan­based and only introduce ordering constraints as necessary (least commitment) in order to avoid unnecessarily searching through the space of possible orderings

4 Partial Order Plan Plan which does not specify unnecessary ordering. Consider the problem of putting on your socks and shoes.

5 Plans A plan is a three tuple –A: A set of actions in the plan, {A 1,A 2,...A n } –O: A set of ordering constraints on actions {A i <A j, A k <A l,...A m <A n }. These must be consistent, i.e. there must be at least one total ordering of actions in A that satisfy all the constraints. –L: a set of causal links showing how actions support each other

6 Causal Links and Threats A causal link, A p  Q A c, indicates that action A p has an effect Q that achieves precondition Q for action A c. A threat, is an action A t that can render a causal link A p  Q A c ineffective because: –O  {A P < A t < A c } is consistent –A t has ¬Q as an effect

7 Threat Removal Threats must be removed to prevent a plan from failing Demotion adds the constraint A t < A p to prevent clobbering, i.e. push the clobberer before the producer Promotion adds the constraint A c < A t to prevent clobbering, i.e. push the clobberer after the consumer

8 Initial (Null) Plan Initial plan has –A={ A 0, A  } –O={A 0 < A  } –L ={} A 0 (Start) has no preconditions but all facts in the initial state as effects. A  (Finish) has the goal conditions as preconditions and no effects.

9 Example Op( Action: Go(there); Precond: At(here); Effects: At(there), ¬At(here) ) Op( Action: Buy(x), Precond: At(store), Sells(store,x); Effects: Have(x) ) A 0 : –At(Home) Sells(SM,Banana) Sells(SM,Milk) Sells(HWS,Drill) A  –Have(Drill) Have(Milk) Have(Banana) At(Home)

10 POP Algorithm Stated as a nondeterministic algorithm where choices must be made. Various search methods can be used to explore the space of possible choices. Maintains an agenda of goals that need to be supported by links, where an agenda element is a pair where Q is a precondition of A i that needs supporting. Initialize plan to null plan and agenda to conjunction of goals (preconditions of Finish). Done when all preconditions of every action in plan are supported by causal links which are not threatened.

11 POP(, agenda) 1) Termination: If agenda is empty, return. Use topological sort to determine a totally ordered plan. 2) Goal Selection: Let be a pair on the agenda 3) Action Selection: Let A add be a nondeterministically chosen action that adds Q. It can be an existing action in A or a new action. If there is no such action return failure. L ’ = L  {A add  Q A need } O ’ = O  {A add < A need } if A add is new then A ’ = A  {A add } and O ’ =O ’ È {A 0 < A add <A  } else A ’ = A

12 4) Update goal set: Let agenda ’ = agenda - { } If A add is new then for each conjunct Q i of its precondition, add to agenda ’ 5) Causal link protection: For every action A t that threatens a causal link A p  Q A c add an ordering constraint by choosing nondeterministically either (a) Demotion: Add A t < A p to O ’ (b) Promotion: Add A c < A t to O ’ If neither constraint is consistent then return failure. 6) Recurse: POP(, agenda ’ )

13 Example Op( Action: Go(there); Precond: At(here); Effects: At(there), ¬At(here) ) Op( Action: Buy(x), Precond: At(store), Sells(store,x); Effects: Have(x) ) A 0 : –At(Home) Sells(SM,Banana) Sells(SM,Milk) Sells(HWS,Drill) A  –Have(Drill) Have(Milk) Have(Banana) At(Home)

14 Example Steps Add three buy actions to achieve the goals Use initial state to achieve the Sells preconditions Then add Go actions to achieve new pre- conditions

15 Handling Threat Cannot resolve threat to At(Home) preconditions of both Go(HWS) and Go(SM). Must backtrack to supporting At(x) precondition of Go(SM) from initial state At(Home) and support it instead from the At(HWS) effect of Go(HWS). Since Go(SM) still threatens At(HWS) of Buy(Drill) must promote Go(SM) to come after Buy(Drill). Demotion is not possible due to causal link supporting At(HWS) precondition of Go(SM)

16 Example Continued Add Go(Home) action to achieve At(Home) Use At(SM) to achieve its precondition Order it after Buy(Milk) and Buy(Banana) to resolve threats to At(SM)

17 GraphPlan Alternative approach to plan construction Uses STRIPS operators with some limitations –Conjunctive preconditions –No negated preconditions –No conditional effects –No universal effects

18 Planning Graph Creates a graph of constraints on the plan Then searches for the subgraph that constitutes the plan itself

19 Graph Form Directed, leveled graph –2 types of nodes: Proposition: P Action: A –3 types of edges (between levels) Precondition: P -> A Add: A -> P Delete: A -> P Proposition and action levels alternate Action level includes actions whose preconditions are satisfied in previous level plus no-op actions (to solve frame problem).

20 Planning graph … … …

21 Constructing the planning graph Level P 1 : all literals from the initial state Add an action in level A i if all its preconditions are present in level P i Add a precondition in level P i if it is the effect of some action in level A i-1 (including no-ops) Maintain a set of exclusion relations to eliminate incompatible propositions and actions (thus reducing the graph size)

22 Mutual Exclusion relations Two actions (or literals) are mutually exclusive (mutex) at some stage if no valid plan could contain both. Two actions are mutex if: –Interference: one clobbers others’ effect or precondition –Competing needs: mutex preconditions Two propositions are mutex if: –All ways of achieving them are mutex

23 Mutual Exclusion relations Inconsistent Effects Inconsistent Support Competing Needs Interference (prec-effect)

24 Dinner Date example Initial Conditions: (and (garbage) (cleanHands) (quiet)) Goal: (and (dinner) (present) (not (garbage)) Actions: –Cook :precondition (cleanHands) :effect (dinner) –Wrap :precondition (quiet) :effect (present) –Carry :precondition :effect (and (not (garbage)) (not (cleanHands)) –Dolly :precondition :effect (and (not (garbage)) (not (quiet)))

25 Dinner Date example

26

27 Observation 1 Propositions monotonically increase (always carried forward by no-ops) p ¬q ¬r p q ¬q ¬r p q ¬q r ¬r p q ¬q r ¬r A A B A B

28 Observation 2 Actions monotonically increase p ¬q ¬r p q ¬q ¬r p q ¬q r ¬r p q ¬q r ¬r A A B A B

29 Observation 3 Proposition mutex relationships monotonically decrease pqr…pqr… A pqr…pqr… pqr…pqr…

30 Observation 4 Action mutex relationships monotonically decrease pq…pq… B pqrs…pqrs… pqrs…pqrs… A C B C A pqrs…pqrs… B C A

31 Observation 5 Planning Graph ‘levels off’. After some time k all levels are identical Because it’s a finite space, the set of literals never decreases and mutexes don’t reappear.

32 Valid plan A valid plan is a planning graph where: Actions at the same level don’t interfere Each action’s preconditions are made true by the plan Goals are satisfied

33 GraphPlan algorithm Grow the planning graph (PG) until all goals are reachable and not mutex. (If PG levels off first, fail) Search the PG for a valid plan If none is found, add a level to the PG and try again

34 Searching for a solution plan Backward chain on the planning graph Achieve goals level by level At level k, pick a subset of non-mutex actions to achieve current goals. Their preconditions become the goals for k-1 level. Build goal subset by picking each goal and choosing an action to add. Use one already selected if possible. Do forward checking on remaining goals (backtrack if can’t pick non- mutex action)

35 Plan Graph Search If goals are present & non-mutex: Choose action to achieve each goal Add preconditions to next goal set

36 Termination for unsolvable problems Graphplan records (memoizes) sets of unsolvable goals: –U(i,t) = unsolvable goals at level i after stage t. More efficient: early backtracking Also provides necessary and sufficient conditions for termination: –Assume plan graph levels off at level n, stage t > n –If U(n, t-1) = U(n, t) then we know we’re in a loop and can terminate safely.

37 Dinner Date example Initial Conditions: (and (garbage) (cleanHands) (quiet)) Goal: (and (dinner) (present) (not (garbage)) Actions: –Cook :precondition (cleanHands) :effect (dinner) –Wrap :precondition (quiet) :effect (present) –Carry :precondition :effect (and (not (garbage)) (not (cleanHands)) –Dolly :precondition :effect (and (not (garbage)) (not (quiet)))

38 Dinner Date example

39

40

41 Knowledge Representation Issue of what to put in to the knowledge base. What does an agent need to know? How should that content be stored?

42 Knowledge Representation NOT a solved problem We have partial answers

43 Question 1 How do I organize the knowledge I have?

44 Ontology Basically a hierarchical organization of concepts. Can be general or domain-specific.

45 Question 2 How do I handle categories?

46 Do I need to? What makes categories important?

47 Defining a category Necessary and sufficient conditions

48 Think-Pair-Share What is a chair?

49 Prototypes

50 In Logic Are categories predicates or objects?

51 Important Terms Inheritance Taxonomy

52 What does ISA mean?

53 Categories Membership Subset or subclass Disjoint categories Exhaustive Decomposition Partitions of categories

54 Other Issues Physical composition Measurement Individuation –Count nouns vs. mass nouns –Intrinsic properties vs. extrinsic properties


Download ppt "For Wednesday Read chapter 12, sections 3-5 Program 2 progress due."

Similar presentations


Ads by Google