Download presentation
Presentation is loading. Please wait.
Published byChristiana Matthews Modified over 9 years ago
1
PLANNING Partial order regression planning Temporal representation 1 Deductive planning in Logic Temporal representation 2
2
2 The task of planning Given: a description of an initial state of the world a description of a desired state of the world a set of actions: with their preconditions that should hold in the world with their effects on the world Find: a sequence of actions that transform the initial state into the final one.
3
Partial order regression planning The STRIPS approach
4
4 State descriptions in STRIPS Only ground facts are used. Example: the blocks world: States of the world are represented individually in logic: Meaning: there is NO representation of how one state relates to the next Nor any representation of time!
5
5
6
6 Action description in STRIPS Effects: two sets of ground facts: Preconditions: a set of ground facts that need to be true in the state for the action to be applicable. the delete list: –need to be removed from the previous state the add list: –need to be added to the previous state
7
7 Example: Some operator patterns: Action1: “move block x from block y to block z” Preconditions If on(x,y) clear(x) clear(x) clear(z) clear(z) Add list Add on(x,z) clear(y) clear(y) Delete list Delete on(x,y) clear(z) clear(z)
8
8 Example: Operator patterns (2): Action2: “move block x from block y to Table” If on(x,y) clear(x) clear(x) Add on(x,Table) clear(y) clear(y) Delete on(x,y)
9
9 Example: Operator patterns (3): Action3: “move block x from Table to block z” Note: actual operators are ground instances of these! If on(x,Table) clear(x) clear(x) clear(z) clear(z) Add on(x,z) Delete on(x,Table) clear(z) clear(z)
10
10 What about using search in forward chaining on this? This is similar to Automated Reasoning: bottom-up inference is not goal directed, top-down reasoning is! See example: Such search is NOT goal directed! No information on what state to reach
11
11
12
12 Backward chaining: Forward chaining would be progression: move from initial state to goal state Example: limited to 1 goal fact! and only 1 possible path explored Planning as regression: start from the goal state and reason backwards to the initial state
13
13
14
14
15
15
16
16
17
17
18
18
19
19
20
20 Regression planning: goal reduction. Select an atomic goal that still needs to be established Find an operator that establishes it ( add list) Add the operator to the plan and add an ESTABLISH link between operator and goal. In general: complex goals are decomposed into atomic ones that themselves are reduced to new goals. Is somewhat similar to ‘top-down’ goal-directed reasoning in AR.
21
21 Principle of least commitment (1) Establish links only impose a partial order: they do NOT impose that first operator needs to occur EXACTLY before second operator BUT they are protected links: NO operator may be scheduled between them that UNDOES the established property ! Clue: do not decide on a choice before it is necessary!
22
22 High-level algorithm Initialize: operators: = empty; operators: = empty; establishes:= empty; establishes:= empty; before:= empty; before:= empty; complete:= false; blocked:= false; Case: before has loop: blocked:= true; Case: before has loop: blocked:= true; While not(complete) and not(blocked) do Case: O operators threatens Case: O operators threatens E(O1,O2) establishes: E(O1,O2) establishes: add B(O,O1) OR add B(O2,O) add B(O,O1) OR add B(O2,O) to before; to before; … … … … … …
23
23 … … … … … … End-While End-While Case: O operators has unsatisfied Case: O operators has unsatisfied condition: condition: find O’ operators find O’ operators OR add O’ to operators OR add O’ to operators AND install establishes and AND install establishes and before links before links Otherwise: complete:= true; Otherwise: complete:= true; High-level algorithm (continued)
24
24 Some comments: The algorithm is imprecise: The Case for threatens links can be activated infinitely often for the same link should test whether it has been dealt with
25
25 High-level algorithm Initialize: operators: = empty; operators: = empty; establishes:= empty; establishes:= empty; before:= empty; before:= empty; complete:= false; blocked:= false; Case: before has loop: blocked:= true; Case: before has loop: blocked:= true; While not(complete) and not(blocked) do Case: O operators threatens Case: O operators threatens E(O1,O2) establishes: E(O1,O2) establishes: add B(O,O1) OR add B(O2,O) add B(O,O1) OR add B(O2,O) to before; to before; … … … … … …
26
26 Some comments: The algorithm is imprecise: The Case for threatens links can be activated infinitely often for the same link should test whether it has been dealt with The initial situation and goal situation are not explicitly present and, the initial situation is not considered for unsatisfied conditions add the initial and goal situation to operators in the Initialization –initial operator has no conditions, just adds initial situation –final operator adds/deletes nothing, just has a condition part.
27
27 Blocks example: Initial operator: If Add on(A,C) on(C,Table) clear(A) on(D,B) on(B,Table) clear(D) on(D,B) on(B,Table) clear(D)Delete Final operator: If on(A,B) on(B,C) on(B,C)AddDelete
28
28 Further refinement: backtracking: When it exits the While loop because blocked = true (there is a before loop), then don’t terminate, but backtrack over operator choices.
29
29 High-level algorithm Initialize: operators: = empty; operators: = empty; establishes:= empty; establishes:= empty; before:= empty; before:= empty; complete:= false; blocked:= false; Case: before has loop: blocked:= true; Case: before has loop: blocked:= true; While not(complete) and not(blocked) do Case: O operators threatens Case: O operators threatens E(O1,O2) establishes: E(O1,O2) establishes: add B(O,O1) OR add B(O2,O) add B(O,O1) OR add B(O2,O) to before; to before; … … … … … …
30
30 … … … … … … End-While End-While Case: O operators has unsatisfied Case: O operators has unsatisfied condition: condition: find O’ operators find O’ operators OR add O’ to operators OR add O’ to operators AND install establishes and AND install establishes and before links before links Otherwise: complete:= true; Otherwise: complete:= true; High-level algorithm (continued)
31
31 Further refinement: backtracking: When it exits the While loop because blocked = true (there is a before loop), then don’t terminate, but backtrack over operator choices. Note: no point in backtracking over selection of unsatisfied pre-conditions: they ALL need to be satisfied anyway at the end
32
32 … … … … … … End-While End-While Case: O operators has unsatisfied Case: O operators has unsatisfied condition: condition: find O’ operators find O’ operators OR add O’ to operators OR add O’ to operators AND install establishes and AND install establishes and before links before links Otherwise: complete:= true; Otherwise: complete:= true; High-level algorithm (continued)
33
33 Further refinement: backtracking: When it exits the While loop because blocked = true (there is a before loop), then don’t terminate, but backtrack over operator choices. Note: no point in backtracking over selection of unsatisfied pre-conditions: they ALL need to be satisfied anyway at the end PS: note how this is similar to the ‘top-down’ automated reasoning techniques. (backtrack over previous clause selections, not over previous atom selections).
34
34 Least commitment(2): plan with operator patterns Key point: Use operator patterns: move x from y to Table move x from Table to y move x from y to z instead of explicit operators: move A from B to Table move A from Table to B move A from B to C Avoids to make choices when the information to decide upon various alternatives is not yet there!
35
35 Blocks example: on(A,Table) goal on(A,B)clear(A)on(B,Table) initial on(A,B)clear(A)on(B,Table)on(A,Table) if on(A,y) clear(A) clear(A) add clear(y) on(A,Table) on(A,Table) delete on(A,y) on(A,B)clear(A)on(B,Table) on(A,Table) establishes unification: {x/A) if on(x,y) clear(x) clear(x) add clear(y) on(x,Table) on(x,Table) delete on(x,y) move x from y to Table establishes unification: {y/B)
36
36 Change in the algorithm: Case: O operators has unsatisfied condition: condition: find O’ operators find O’ operators OR add O’ to operators OR add O’ to operators AND install establishes and AND install establishes and before links before links O and O’ are (partially instantiated) operator patterns now The unsatisfied needs to be unifiable with an element of the add list of O’ now (not be identical) The unifier needs to be applied on the entire set of operators constructed so far!
37
37 When is there a threat? Example: on(A,B)on(B,D)clear(A)clear(B) clear(C)on(B,Table) if on(A,C) clear(A) clear(A) add clear(C) on(A,y) on(A,y) delete on(A,C) clear(y) clear(y) move A from C to y establishes if on(B,z) clear(B) clear(B) add clear(z) on(B,Table) on(B,Table) delete on(B,z) move B from z to Table establishes establishes threat? establishes
38
38 Dealing with possible threats 1) Ignore them, until they become instantiated to real threats. Example: only if ‘delete clear(y)’ becomes ‘delete clear(B)’ we consider it a threat Optimization: at least check whether there is still a consistent value for the variables (Ex.: y can still be assigned value D) 2) Introduce inequality constraints and replace unification by constraint solving Example: constraint y B + unification must now also respect the inequalities 3) Choose a value for y Ex.: assign y = D.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.