AI Lab report - Copy
AI Lab report - Copy
PREPARED BY:
Rabina gurung
AI Submitted to
Signature: Signature
1
ACKNOWLEDGEMENT
This lab report has been prepared for the partial fulfilment of the requirements for the degree of
Bachelor of Information Management, prescribed by faculty of Management, Tribuwan
University. This is an individual report assigned to me during my academic study in BIM Seventh
semester, I should remain thankful to many people for the successful completion of this summer
project.
I would like to express sincere gratitude to my faculty member, Mr. Nischal khatiwoda sir for
providing necessary guidelines for completion of this report. I am thankful to him for his
continuous reinforcement and motivation for completing this lab report successfully. I thank for
his regular feedback and suggestion to improve the report further.
We are very thankful to respected Associate Lecturer, Mr. Nischal khatiwoda for helping and
encouraging us in every aspect of my academic study. Also, I would like to thank all the
respondents who filled the questionnaire and helped me with the continuation of the report.
Finally, I would like to thank my friends for uplifting my spirit to complete the report in time.
2
LIST OF FIGURES
Figure 1: FIG 1– Fact Table......................................................................................................3
Figure6:Output………………………………………………………….....................................16
3
CHAPTER ONE: PROLOG
In 1981, a Japanese computer Project of 5 th generation was announced. After that, it was adopted Prolog
as a development language. In this tutorial, the program was written in the 'Standard' Edinburgh Prolog.
Prologs of Prolog II family are the other kind of prologs which are descendants of Marseille Prolog.
Prolog is used in some areas like database, natural language processing, artificial intelligence, but it is
pretty useless in some areas like a numerical algorithm or instance graphics.
2. Click on Download which is adjacent to Home, dropdown list will appear then click on SWI-
Prolog.
5. After clicking on SWI-Prolog 8.4.0-1 for Microsoft Windows (64 bit), a new webpage will
open, check on I understand checkbox to make the download link active. Then click on the
download link, downloading of the executable file will start shortly. It is a small 11.9 MB file
that will hardly take a minute.
5
7. Setup screen will appear, click on Next.
9. After it there will be screen of installing options so check the box for Add swipl to the system
path for all users, and also check the box for create a desktop icon and then click on the Next
button.
10. The next screen will be of installing location so choose the drive which will have sufficient
memory space for installation. It needed only a memory space of 50 MB.
6
11. Next screen will be of choosing Start menu folder so don’t do anything just click on Next
Button.
12. This last screen is of choosing components, all components are already marked so don’t change
anything just click on Install button.
13. After this installation process will start and will hardly take a minute to complete
the installation.
7
14. Click on Finish after the installation process is complete.
SHORTEN FACTS
8
CHAPTER TWO: DEMONSTRATION OF FACTS IN PROLOG
2.1 Facts
A fact is a predicate expression that makes a declarative statement about the problem domain. Whenever
a variable occurs in a Prolog expression, it is assumed to be universally quantified. Note that all Prolog
sentences must end with a period.
2.2 Rules
A rule is a predicate expression that uses logical implication (:-) to describe a relationship among facts.
Thus a Prolog rule takes the form left_hand_side:- right_hand_side.
The left_hand_side is restricted to a single, positive, literal, which means it must consist of a positive
atomic expression. It cannot be negated and it cannot contain logical connectives.
9
FIG 3-Fact Table
10
CHAPTER THREE: DEMONSTRATION OF RELATIONSHIP TABLE
3.1 Relationship
When you define a fact dimension, you can define the relationship between the fact dimension and the
measure group as a fact relationship. The following constraints apply to fact relationships:
The granularity attribute must be the key column for the dimension, which creates a one-to-one
relationship between the dimension and the facts in the fact table.
A dimension can have a fact relationship with only a single measure group.
Fig 6: Output
11
CHAPTER FOUR: MONKEY BANANA PROBLEM
4.2 Solution
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. Below are few observations in this case :
• Monkey can reach the block, if both of them are at the same level. From the
above image, we can see that both the monkey and the block are on the
floor.
• If the block position is not at the center, then monkey can drag it to the
center.
• 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. So the vertical position of the
monkey will be changed.
• When the monkey is on the block, and block is at the center, then the
monkey can get the bananas.
Programs and Output
12
Fig 7: Monkey Banana Program
Fig 8: Output
13