×
☰ Menu

Experiment No. 4

OBJECTIVE: Write a program to Solve the Monkey Banana problem.

Imagine a room containing a monkey, chair and some bananas. That has been hanged from the centre of ceiling. If the monkey is clever enough he can reach the bananas by placing the chair directly below the bananas and climb on the chair .The problem is to prove the monkey can reach the bananas. The monkey wants it, but cannot jump high enoughfrom the floor. At the window of the room there is a box that the monkey can use. 

The monkey can perform the following actions:-'


1)Walk on the floor.
2)Climb the box.
3)Push the box around (if it is beside the box).
4)Grasp the banana if it is standing on the box directly under the banana.

 

Clauses:

on(floor,monkey). 
on(floor,chair). 
in(room,monkey). 
in(room,chair). 
in(room,banana). 
at(ceiling,banana). 
strong(monkey). 
grasp(monkey). 
climb(monkey,chair).
push(monkey,chair):-strong(monkey). 
under(banana,chair):-push(monkey,chair).
canreach(banana,monkey):-at(floor,banana);at(ceiling,banana),under(banana,chair), climb(monkey,chair).canget(banana,monkey):-canreach(banana,monkey),grasp(monkey).

Output: 

 

 


 

To Download Complete Artificial Intelligence Lab Manual Click Here

 

 Download Now 

 


Artificial Intelligence Lab, AKTU manual, 4th year, Computer Science and Engineering, Information Technology, Prolog, programming

Artificial Intelligence Lab (RCS752)

Artificial Intelligence Lab Manual AKTU

Artificial Intelligence Lab Manual using Prolog PDF

Artificial Intelligence Lab Notes Download