point(x,y)- point at location (x,y)
seg(p1,p2)- line segment from point p1 to point p2
Monkey and Banana Problem: There is a monkey at the door into a room. In the middle of the room a banana is hanging from the ceiling. The monkey is hungry and wants to get the banana, but he cannot stretch high enough from the floor to reach the banana. At the window of the room there is a box the monkey may use. The monkey can do the following things: walk on the floor, climb on the box, push the box around (if it is next to the box) and grasp the banana if standing on the box directly under the banana. How can the monkey get the banana?
statethat takes four arguments, and the constant values that can occur for each argument.
move(State1,Action,State2), which describes the state
State2that results from applying the action
Actionin the state
canget(State1)that returns yes if the monkey can get the banana from
State1and no otherwise.
canget(State1,Actions)that computes the list
Actionsof actions that the monkey performs to get the banana (if at all) from