0% found this document useful (0 votes)
62 views3 pages

Experiment No. 1: Prolog-Programming in Logic

PROLOG is a logic programming language developed in the 1970s that uses logic for programming. It is well-suited for symbolic problems involving objects and relations between objects. Programming in PROLOG involves creating a database of facts and rules about objects, their properties, and relationships. Queries can then be posed and valid conclusions will be determined and returned by the program. PROLOG is useful for designing expert systems because it can reason with knowledge rather than just data, modify knowledge bases without recompiling programs, explain conclusions, and perform symbolic computations resembling natural language.

Uploaded by

behl1anmol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views3 pages

Experiment No. 1: Prolog-Programming in Logic

PROLOG is a logic programming language developed in the 1970s that uses logic for programming. It is well-suited for symbolic problems involving objects and relations between objects. Programming in PROLOG involves creating a database of facts and rules about objects, their properties, and relationships. Queries can then be posed and valid conclusions will be determined and returned by the program. PROLOG is useful for designing expert systems because it can reason with knowledge rather than just data, modify knowledge bases without recompiling programs, explain conclusions, and perform symbolic computations resembling natural language.

Uploaded by

behl1anmol
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment No.

PROLOG- PROGRAMMING IN LOGIC

PROLOG stands for Programming, In Logic — an idea that emerged in the early
1970’s to use logic as programming language. The early developers of this
idea included Robert Kowaiski at Edinburgh (on the theoretical side),
Marrten van Emden at Edinburgh (experimental demonstration) and Alian
Colmerauer at Marseilles (implementation).
David D.H. Warren’s efficient implementation at Edinburgh in the mid -
1970’s greatly contributed to the popularity of PROLOG. PROLOG is a
programming language centred around a small set of basic mechanisms,
Including pattern matching, tree based data structuring and automatic
backtracking. This Small set constitutes a surprisingly powerful and flexible
programming framework. PROLOG is especially well suited for problems that
involve objects- in particular, structured objects- and relations between them.
SYMBOLIC LANGUAGE
PROLOG is a programming language for symbolic, non-numeric
computation. It is especially well suited for solving problems that involve
objects and relations between objects. For example, it is an easy exercise in
prolog to express spatial relationship between objects, such as the blue sphere is
behind the green one. It is also easy to state a more general rule: if object X is
closer to the observer than object Y. and object Y is closer than Z, then X must
be closer than Z. PROLOG can reason about the spatial relationships and their
consistency with respect to the general rule. Features like this make
PROLOG a powerful language for ArtJIcia1 LanguageA1,) and non- numerical
programming.
There are well-known examples of symbolic computation whose
implementation in other
standard languages took tens of pages of indigestible code, when the same
algorithms were implemented in PROLOG, the result was a crystal-clear program
easily fitting on one page.
FACTS, RULES AND QUERIES
Progmmming in PROIOG is accomplished by creating a database of facts
and rules about objects, their properties, and their relationships to other objects.
Queries then can be posed about the objects and valid conclusions will be
determined and returned by the program Responses to user queries are
determined through a form of inference control known as resolution.
FOR EXAIPLE:
a) FACTS:
Some facts about family
relationships could be written as:
sister( sue,bill) male(jo)
female( riya)

b) RULE : To represent the general rule for grandfather, we write:


grandfather(
X2)
parent(X
,Y)
parent(Y
,Z)
male(X)

c) QUERIES: Given a database of facts and rules such as that above, we may
make queries by
typing after a query a symbol’?’ statements such as:
?-parent(X,sam)
Xann
?grandfather(
X,Y)
X=jo,
Y=sam

PROLOG IN DISGINING EXPERT SYSTEMS


An expert system is a set of programs that manipulates encoded knowledge to
solve problems in a specialized domain that normally requires human
expertise. An expert system’s knowledge is obtained from expert sources
such as texts, journal articles. databases etc and encoded in a form suitable for
the system to use in its inference or reasoning processes. Once a sufficient body
of expert knowledge has been acquired, it must be encoded in some form,
loaded into knowledge base, then tested, and refined continually throughout
the life of the system PROLOG serves as a powerful language in designing
expert systems because of its following features.
Use of knowledge rather than data
Modification of the knowledge base without recompilation of the control
programs.
Capable of explaining conclusion.
Symbolic computations resembling manipulations of natural language.
Reason with meta-knowledge.
META
PROGRAMMING
A meta-program is a program that takes other programs as data. Interpreters and
compilers are examples of mela-programs. Meta-interpreter is a particular
kind of meta-program: an interpreter for a language written in that language.
So a PROLOG interpreter is an interpreter for PROLOG, itself written in
PROLOG. Due to its symbol- manipulation capabilities, PROLOG is a
powerful language for meta-programming. Therefore, it is often used as an
implementation language for other languages. PROLOG is particularly suitable
as a language for rapid prototyping where we are interested in implementing
new ideas quickly. New ideas are rapidly implemented and experimented with.

You might also like