0% found this document useful (0 votes)
2 views

AI FILE

The document outlines two experiments focused on the study of PROLOG, a high-level programming language used for symbolic reasoning and artificial intelligence. It covers the history, usage, and features of PROLOG, including its declarative syntax, logical inference, and pattern matching capabilities. The second experiment involves writing simple facts in PROLOG, demonstrating its application in expressing relationships.

Uploaded by

Aditya
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)
2 views

AI FILE

The document outlines two experiments focused on the study of PROLOG, a high-level programming language used for symbolic reasoning and artificial intelligence. It covers the history, usage, and features of PROLOG, including its declarative syntax, logical inference, and pattern matching capabilities. The second experiment involves writing simple facts in PROLOG, demonstrating its application in expressing relationships.

Uploaded by

Aditya
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/ 4

EXPERIMENT-1

AIM:- Study of PROLOG.

Apparatus required:- PC and PROLOG Software.

Theory:-
About PROLOG:- PROLOG, which stands for “Programming in logic,” is a high-level
programming language designed for symbolic reasoning and manipulation. It is particularly well-
suited for tasks related to artificial intelligence, logic programming, and rule-based systems.
PROLOG is declarative, meaning that you specify the desired outcome rather than the step-by-
step process to achieve it.

History:- PROLOG was developed in the early 1970s by Alain Colmerauer and a team of
researchers in Marseille,France. The language gained popularity in the field of artificial
intelligence and knowledge representation due to its natural support for formal logic and rule-
based reasoning. Since its inception, PROLOG has been used in a variety of applications,
including expert systems, natural language processing, and database querying.

Usage:- PROLOG finds applications in various domains, such as:-

1- Artificial intelligence (AI):- PROLOG is widely used in AI research and applications


for tasks such as expert systems, automated reasoning, and knowledge representation.
2- Natural Language Processing (NLP):- Its logical and pattern-matching capabilities
make PROLOG suitable for processing and understanding natural language.
3- Database Systems:- PROLOG is used for querying and manipulating knowledge in
databases through its powerful pattern-matching features.
4- Symbolic Mathematics:- PROLOG is employed in symbolic mathematics and
theorem proving, where logical interface is crucial.

Features:- Some key features of PROLOG include:-

1- Declarative Syntax:- PROLOG programs describe relationships and rules rather than
specifying a sequence of steps to achieve a goal.
2- Logical Inference:- PROLOG is based on formal logic, enabling users to express and
query relationships using rules of deduction and inference.
3- Pattern Matching:- The language excels at pattern matching,allowing for powerful
and flexible data manipulation.
4- Backtracking:- PROLOG’s unique backtracking mechanism allows the system to
explore alternative solutions when searching for answers to queries.
Basics of Programming in PROLOG:-

 Facts and Rules:- Programs consist of facts (statements about relationships) and
rules (logical conditions or implications).
 Predicates:- Predicates define relationships between terms. They are the building
blocks of PROLOG programs.
 Variables:- Variables are placeholders for unknown values. They allow for more
general and flexible rule definitions.
 Queries:- Users interact with the system by posing queries, asking questions, or
seeking solutions to problems.
 Recursion:- PROLOG supports recursion, allowing functions or rules to call
themselves, which is a fundamental concept for solving complex problems.

In Summary, PROLOG’s unique combination of logic-based programming, pattern matching and


inference mechanisms makes it a powerful language for a wide range of applications in the field
of artificial intelligence and symbolic reasoning.
EXPERIMENT-2
AIM:-
Write simple fact for the following:-

a. Ram likes mango.


b. Seema is a girl.
c. Bill likes Cindy.
d. Rose is red.
e. John owns gold.

APPARATUS USED:- SWI-PROLOG 9.0.4

THEORY:-

In Prolog, the format for expressing facts is generally predicate(term1,term2,…termN),

Where predicate is the name of the relation, and term1,term2,…,termN are the terms involved in the
relation. Each term can be a variable,an atom,,or a compound term.

PROGRAM:-

OUTPUT:-

RESULT:- We have written simple facts using PROLOG.

You might also like