Professional Documents
Culture Documents
Learning
Planning
Definition:
Planning is the process of computing
several steps of a problem-solving
procedure before executing any of them.
Basic Plan Generation Systems
• Planning problems are hard problems:
• They are certainly non-trivial.
• Solutions involve many aspects that we
have studied so far:
– Search and problem solving strategies.
– Knowledge Representation schemes.
– Problem decomposition -- breaking problem
into smaller pieces and trying to solve these
first.
Blocks World Planning Examples
• What is the Blocks World? -- The world consists of:
• A flat surface such as a tabletop
• An adequate set of identical blocks which are
identified by letters.
• The blocks can be stacked one on one to form
towers of apparently unlimited height.
• The stacking is achieved using a robot arm which
has fundamental operations and states which can
be assessed using logic and combined using logical
operations.
• The robot can hold one block at a time and only one
block can be moved at a time.
Four actions
• UNSTACK(A,B)
-- pick up block A from its current position on block B;
-- the arm must be empty & block A have no blocks on top
of it.
• STACK(A,B)
-- place block A on block B;
-- The arm must already be holding A and surface of B must
be clear
• PICKUP(A)
-- lift block A from the table and hold it.
-- The arm must be empty and there must be nothing on top
of block A
• PUTDOWN(A)
-- place the held block A onto a free space on the table.
Five predicates:
• ON(A,B)
-- block A is on block B.
• ONTABLE(A)
-- block A is on the table.
• CLEAR(A)
-- block A has nothing on top of it.
• HOLDING(A)
-- the arm holds block A.
• ARMEMPTY
-- the arm holds nothing.
• Using logic but not logical notation we can say that
–If the arm is holding a block it is not empty
£x:HOLDING(x) -> ~ARMEMPTY
- If block A is on the table it is not on any other block
Vx:ONTABLE(x) -> ~£y :ON(x,y)
– If block A is on block B, block B is not clear.
Vx: [£y : ON(y,x)] -> ~CLEAR(x)
Why Use the Blocks world as an example?
The blocks world is chosen because:
• it is sufficiently simple and well behaved.
• easily understood
• yet still provides a good sample environment to study planning:
–problems can be broken into nearly distinct subproblems
–we can show how partial solutions need to be combined
to form a realistic complete solution.
.
Planning System Components
ON(A,B,S0) ^
A ONTABLE(B,S0)
B ^ CLEAR(A,S0)
Choice of best rule
ONTABLE(B)^CLEAR(A)^CLEAR(B)^HOLDI
NG(A)
GOAL STACK PLANNING
• Basic Idea to handle interactive compound goals
uses goal stacks, Here the stack contains :
• goals,
• operators -- ADD, DELETE and PREREQUISITE lists
• a database maintaining the current situation for
each operator used.
• Consider the following where wish to proceed from
the start to goal state.
Goal Stack Planning Example
We can describe the start state:
• ON(B, A) ONTABLE(A) ONTABLE(C)
ONTABLE(D) ARMEMPTY
and goal state:
• ON(C, A) ON(B,D) ONTABLE(A) ONTABLE(D)
Initially the goal stack is the goal state.
We then split the problem into four subproblems
Two are solved as they already are true in the
initial state -- ONTABLE(A), ONTABLE(D).
With the other two -- there are two ways to proceed:
ON(C,A)
ON(B,D)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
ON(B,D)
ON(C,A)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
STACK(C,A)
ON(B,D)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
• In order to apply STACK(C,A), its preconditions must hold
CLEAR(A)
HOLDING(C)
CLEAR(A) ^ HOLDING(c)
STACK(C,A)
ON(B,D)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
To see if clear(A) is true. Need operator UNSTACK(B,A)
ON(B,A)
CLEAR(B)
ARMEMPTY
ON(B,A)^CLEAR(B)^ARMEMPTY
UNSTACK(B,A)
HOLDING(C)
CLEAR(A) ^ HOLDING(c)
STACK(C,A)
ON(B,D)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
Top element of the stack is UNSTACK(B,A). Its preconditions
are satisfied
Database corresponds to the world model is
ONTABLE(A) ^
ONTABLE(C)^ONTABLE(D)^HOLDING(B)^CLEAR(A)
GOAL STACK IS
HOLDING(C)
CLEAR(A) ^ HOLDING(c)
STACK(C,A)
ON(B,D)
ON(C,A) ON(B,D) ONTABLE(A) ONTABLE(D)
• Like the above, goal stack will remain
changed and the problem solver return its
answer plan and halt
• Answer plan
UNSTACK(B,A)
STACK(B,D)
PICKUP(C)
STACK(C,A)