Lecture 17
10/24/2001
Notes by: Niranjan B (niranjan@cc)
Planning
What is planning ?
Suppose we have one specified goal and are given a set of operators, then a plan is a partially ordered sequence of operator instantiations that will achieve the goal.
Assumptions.
Why is the planning problem hard ?
Blocks World Problem.
Initial State (I.S.) Goal State (G.S.)
Constraints :
Goals are represented using Initial and Final states.
I.S. : (ON A TABLE)
(ON B TABLE)
(ON C TABLE)
G.S. : (ON C TABLE)
(ON B C)
(ON A B)
What operators do we need ?
( Operator MOVE BLOCK ON TABLE TO TABLE, not needed because of constraint no 3.)
We need to sequence operators. => Intelligence lies in the use of domain knowledge, not in the domain knowledge itself.
Encoding of Operators
Operator 2. MOVE BLOCK X TO TABLE
For every operator we specify the preconditions and postconditions. Pre-conditions are the constraints before the operator is applied and postconditions are the results of applying the operator.
Pre-condition : (ON X Y) , (CLEAR X)
Post-condition : 2 Types
Add-List : Condition becomes true after operator is applied
Delete-List : Condition that existed before but is no longer true after operator is applied.
Add-List : (ON X TABLE)
Delete-List : (ON X Y)
Note : (CLEAR X) is not an operator, its just a predicate (assertion).
Operator 1 : MOVE BLOCK X ON TOP OF BLOCK Z TO BLOCK Y
Precondition : (CLEAR X), (ON X Z) , (CLEAR Y)
Postcondition: Add-List : (ON X Y), (CLEAR Z)
Delete-List : (ON X Z), (CLEAR Y)
Operator 3 : MOVE BLOCK X FROM TABLE TO ON TOP OF BLOCK Y
Precondition : (CLEAR X), (CLEAR Y), (ON X TABLE)
Postcondition: Add-List : (ON X Y)
Delete-List : (ON X TABLE), (CLEAR Y)
One difference between planning and search is that in search we can use any number of heuristics whereas planning deals with goal directed reasoning.
In the above example we have 3 initial states and 3 goals….
Initial State |
Goal State |
1. ON A TABLE |
1. ON A B |
2. ON B TABLE |
2. ON B C |
3. ON C TABLE |
3. ON C TABLE |
One way to begin is by seeing the differences between the initial and goal states.
Initial state 3 matches with Goal state 3.. so we have only 2 goals now, goal 1 and 2.
Agent has to pick up 1 of these 2 goals. … Lets say the agent by random picks up goal 2 à (ON B C)
Now match this against the postconditions of the operators, especially the ADD-LIST. Goal 2 matches the post-conditions of operators 1 and 3 (ON X Y). Operator 1 eliminated.
Now check the pre-conditions, matches with operator 3 . Thus we chose the operator
MOVE BLOCK X FROM TABLE TO ON TOP OF Y. Bind variables X to B and Y to C. Here we have introduced the new term "Variable Binding".
We have met goal 2. Now go to the next goal (ON A B). Apply operator 3 with variable bindings X = A, Y = B. Thus we have achieved all 3 goals.
Now what if the agent picks up goal 1 first, instead of goal 2. By similar reasoning if the agent applies operator 3 first then we get the following intermediate state
Here we see that goal 1 clobbers goal 2. => Failure.
Planning => interleaving of execution and monitoring (monitoring required to detect failures).
Detecting Failures :
Problems like the one above are called non-linear problems.
In non-linear problems we have
Goal interactions are of 2 types, +ve interaction and –ve Interaction.
+ve interaction : Plan for goal X also achieves goal Y. ex. Sending a message and an ack in the same packet.
-ve interaction : Plan for goal X kills goal Y.
Non-Linear Problems always have –ve interactions.
So far we have seen 3 major classes of AI problems : Non-seperable, non-monotonic, non-linear.
How control knowledge can be learnt ?
Explanation based learning - Do an exhaustive search of different goal ordering. Some of these branches are going to lead to failures, one of them will succeed. Learn the correct ordering from this search.