AI2 Module 4
Tutorial 4
Alan Bundy
and
Jürgen Zimmer1
School of Informatics
1 STRIPS Planning in the Blocks World
Imagine a Blocks World with 3 blocks: A,B,C and the STRIPS operators as introduced in
the planning notes2 :
• Pickup(x), which picks up block x from the table,
• Putdown(x), which puts block x on the table,
• Unstack(x, y) which picks up block x which is stacked on y, and
• Stack(x, y), which stacks block x on block y.
The operator Pickup(x), for instance, can be represented as:
act: Pickup(x)
pre: OnTable(x),Clear(x),Handempty
add: Holding(x)
del: OnTable(x),Clear(x),Handempty
We look at a planning problem where the initial state can be described with: On(C,A),
OnTable(A), OnTable(B), Clear(C), Clear(B):
A B
Table
The goal is: On(A,B)∧ On(B,C):
A
Table
(a) Represent the operator Unstack(x, y):
act: Unstack(x, y)
pre:
add:
del:
1
In case of any question, do not hesitate to contact [email protected].
2
Available at http://www.informatics.ed.ac.uk/teaching/classes/ai2/module4/notes/planning.pdf.
1
(b) Give the shortest possible plan, i.e. the shortest possible sequence of fully instantiated
operators, that achieves the goal On(A,B) from the initial state.
(c) Give the shortest possible plan that achieves the goal On(B,C) from the initial state.
(d) Try to combine your plans from (b) and (c) to a single plan that achieves On(A,B)∧
On(B,C).
2 Planning in the Wumpus World
Consider plan formation in the Wumpus World where the actions are: turning left (Left),
turning right (Right), going forward (Forward), grabbing the gold (Grab), release the gold
(Release), and shooting an arrow (Shoot). These actions can be represented by STRIPS
operators, using (among others) the following predicates:
• At(sq) means the agent is at square sq.
• Heading(dir) means the agent is facing direction dir.
• N ext(sq1 , dir, sq2 ) means that square sq2 is adjacent to square sq1 in direction dir.
• N inety(dir1 , dir2 ) means that dir2 is 90 degrees clockwise from dir1 .
• OK(sq) means that square sq is safe.
• W umpus(sq) means the Wumpus is in square sq.
The initial state of our planning problem can be described with the knowledge base:
At(h1, 1i), Heading(W est)
N inety(W est, N orth), N inety(N orth, East), ...
N ext(h1, 1i, N orth, h1, 2i), N ext(h1, 2i, N orth, h1, 3i), ...
OK(h1, 1i) OK(h1, 2i)
W umpus(h1, 3i)
(a) Represent the Shoot action with a STRIPS operator. The agent could Shoot an arrow
if it is facing direction dir and the square adjacent to its current position in direction
dir contains the Wumpus. The Wumpus will be killed by this action.
(b) Give a plan for killing the Wumpus in square h1, 3i, i.e. give a sequence of fully instan-
tiated operators that achieves the goal ¬W umpus(h1, 3i).
(c) Describe how STRIPS could find this plan.
3 Qualification and Ramification
Consider the action of taking a train from Edinburgh to London with preconditions At(Agent, Edinburgh)∧
At(T rain, Edinburgh) and add list At(Agent, London) ∧ At(T rain, London).
(a) What additional preconditions might be required to guarantee that the action can be
applied?
(b) What additional effects might be caused by the action?