point(A,B)
=?= point(1,2)
point(A,B)
=?= point(X,Y,Z)
plus(2,2)
=?= 2
+(2,D)
=?= +(E,2)
triangle(point(-1,0),P2,P3)
=?= triangle(P1,point(1,0),point(0,Y))
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?
state
that takes four arguments, and
the constant values that can occur for each argument.
move(State1,Action,State2)
, which describes the state
State2
that results from applying the action
Action
in the state State1
.
canget(State1)
that returns yes if
the monkey can get the banana from State1
and no otherwise.
canget(State1,Actions)
that
computes the list Actions
of actions that the monkey
performs to get the banana (if at all) from State1
.