## Induction and Heuristics

Exercises - Induction and Heuristics

1. How would you solve the following problem:

A team of mountain climbers equipped with only an altimeter and compass find themselves in heavy fog on the side of a mountain - what would the optimal strategy for reaching the summit?

2. Experiment with the following PROLOG program:
```	/* THE MONKEY AND THE BANANAS PROBLEM */
/*  an exercise in selective linear induction */
/*  by P. R. Whitehouse                        */
/*  after Patterson 1990		       */
domains
floor= symbol
chair= symbol
bananas= symbol
monkey= symbol
predicates
can_reach(symbol,symbol)	/*X can reach Y */
is_dextrous(symbol)	/* X is a dextrous animal */
is_close(symbol,symbol)	/* X is close to Y */
can_get_on(symbol,symbol)	/* X can get on Y */
is_under(symbol,symbol)	/* X is under Y */
is_tall(symbol)	/* X is tall */
is_in_room(symbol)	/* X is in the room */
can_move(symbol,symbol,symbol)	/* X canmove Y near Z */
can_climb_on(symbol,symbol)	/* X can climb onto Y */
clauses
is_in_room(bananas).	/* bananas are in the room*/
is_in_room(chair).	/* a chair is in the room*/
is_in_room(monkey).	/* a monkey is in the room*/
is_dextrous(monkey).	/* a monkey is dextrous*/
is_tall(chair).	/* the chair is tall*/
can_move(monkey,chair,bananas).	/* the monkey can move the chair towards the bananas*/
can_climb_on(monkey,chair).	/*monkey can climb on the chair*/
can_reach(X,Y) if is_dextrous(X) and is_close(X,Y).
is_close(X,Z) if can_get_on(X,Y) and is_under(Y,Z) and is_tall(Y).
can_get_on(X,Y) if can_climb(X,Y).
is_under(Y,Z) if is_in_room(X) and is_in_room(Y) and is_in_room(Z) and can_move(X,Y,Z).```

wonko@wonko.info