Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

EXPERIMENT 1

Aim: Study of PROLOG.

Theory:

PROLOG stands for programming in logic. In the logic programming paradigm, PROLOG
language is most widely available. PROLOG is a declarative language, which means that a
program consists of data based on the facts and rules (Logical relationship) rather than
computing how to find a solution. A logical relationship describes the relationships which hold
for the given application. Building blocks of logic programming are Facts, Rules and the
Queries.

 Symbols Used

If :-
Not Not
Or ;
and ,

 Knowledge Base: It is a collection of facts and rules

o Facts: We can define fact as an explicit relationship between objects, and properties
these objects might have.

 Names of properties/relationships begin with lower case letters.


 The relationship name appears as the first term.
 Objects appear as comma-separated arguments within parentheses.
 A period "." must end a fact.

Syntax:
relation(object1,object2...).

o Rules: We can define rule as an implicit relationship between objects. So facts are
conditionally true. So, when one associated condition is true, then the predicate is also
true.

Syntax:
rule_name(object1, object2, ...) :-
fact/rule(object1,object2, ...)

 Queries: Queries are some questions on the relationships between objects and object
properties.
How to download GNU PROLOG?

Install the latest version GNU PROLOG setup file from google.

After clicking on the setup file this dialog will open. Select the drive in which you want to install
GNU PROLOG.

Accept all terms and conditions and it will automatically install the program and the files related
to it.
You will see these files inside the GNU PROLOG folder. The experiments will pe performed
inside the bin folder.

This is what how the application (GNU PROLOG) will look like when no file is opened.

You might also like