Information Technology Reference
In-Depth Information
Exercises
1.
The version of the monkey and bananas problem in section 9.2.4 did not consider
what happened after the monkey grabbed the bananas. Imagine that there is a
very clever monkey who wants to trick the scientists studying him (while they
are out having coffee) by obtaining the bananas as before, but then restoring
everything else as it was, so that it looks like the box has not even been touched.
Suppose you want to use the plan predicate to solve this new version of the
problem. The states and operators will be exactly the same as before. The initial
state will also be the same, but some of the definitions of legal moves will have
to change. In particular, if the monkey has the bananas and goes somewhere, the
location of the bananas should change as well.
a.
What is the new goal state?
b.
Explain why the legal_move clauses for climb_on , climb_off , and grab do
not need to be changed from those in section 9.2.4.
c.
Write a clause for the legal_move predicate for the go action for those initial
states where the monkey does not have the bananas.
d.
Write a clause for the legal_move predicate for the go action for those initial
states where the monkey has the bananas.
e.
Repeat the exercise for the push action (two clauses required).
f.
Use the plan predicate to find a solution. How many steps are now needed
to solve the problem?
2.
Suppose the plan predicate from figure 9.3 had been defined by
plan(L) :- initial_state(I), reachable(I,L,G), goal_state(G).
Are there planning problems where this might work better than the previous
version? Are there problems where it might do worse?
3.
Consider a more ambitious version of the monkey and bananas problem. In this
version, the monkey cannot reach the bananas even if he is on the box. However,
there is a big stick located in a corner of the room that can be used to knock
the bananas down when the monkey has the stick and is on the box under the
bananas. The monkey can pick up or drop the stick, and can climb on the box
while holding the stick. But the stick is bulky, and he can only push the box if he
is not carrying the stick.
 
Search WWH ::




Custom Search