Implementation of Monkey Banana Problem using PROLOG.
Description : Monkey
-Banana Problem
The Monkey-Banana Problem
can be stated as follows.
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. At the window of the room there is a box
the monkey may use. The monkey can perform the following actions: walk on the floor,
climb the box, push the box around (if it is already at the box) and grasp the
banana if standing on the box directly under the banana. Can the monkey get the
banana?
OutPut :
-
canget(monkey, banana).
true.
?-
canget(X,Y).
X = monkey,
Y = banana.
?- canget(X,
banana).
X = monkey.
?-
canget(monkey, apple).
false.
?-
Post a Comment
Thanks, for contacting us.
We will reviewing us on your comments . Please wait an hour.
Air Reality Team....