![]() We have some predicates that will move from one state to another state, by performing action. We will create some predicates as follows − Now, let us see how we can solve this using Prolog. When the monkey is on the block, and block is at the center, then the monkey can get the bananas. So the vertical position of the monkey will be changed. If monkey and the block both are on the floor, and block is at the center, then the monkey can climb up on the block. If the block position is not at the center, then monkey can drag it to the center. From the above image, we can see that both the monkey and the block are on the floor. Monkey can reach the block, if both of them are at the same level. Below are few observations in this case − So if the monkey is clever enough, he can come to the block, drag the block to the center, climb on it, and get the banana. The monkey wants the banana, but cannot reach it. ![]() ![]() There is a block (or chair) present in the room near the window. ![]() ![]() Problem StatementĪ hungry monkey is in a room, and he is near the door.īananas have been hung from the center of the ceiling of the room. In this prolog example, we will see one very interesting and famous problem, The Monkey and Banana Problem. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |