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

CSE-4103

Artificial Intelligence
THE PROLOG RULES

MD. NAZMUS SALEHIN

LECTURER

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CSE)

BANGLADESH ARMY UNIVERSITY OF ENGINEERING AND TECHNOLOGY (BAUET)

CONTACT:

salehinfall2020.cse@gmail.com
Reference Book 2

 Introduction to Turbo Prolog by Carl Townsend

CHAPTER 5: USING RULES

"All healing is first a healing of the heart." - Carl Townsend


Prolog Rules
3
Clauses

Facts Rules
Rules: A rule is an expression that indicates that the
truth of a particular fact depends upon one or Periods (.) Predicates
more other facts. A rule allows us to find out about
a relationship even if the relationship isn't explicitly Relations Arguments
stated as a fact.
Objects Variables
Example of Rules:

hypothesis (corona) :-
symptom (fever) ,
symptom (cough).
Prolog Rules: Some Examples
4
Conclusion/head

hypothesis(vitc_deficiency):- Antecedent/body: consisting of one or


more premises
symptom(arthritis),
symptom(infection_sensitivity).

Explanation:

o The operator :- is called a break.


o Comma(,) expresses an “and” relationship.
o Must be ended with a full stop(.)
o In English: There is evidence of vitamin C deficiency if there are symptoms of both arthritis
and infection_sensitivity.
Prolog Rules: Some Examples Cont.
5

In English:
There is evidence of vitamin C deficiency if there is either symptoms of arthritis and infection
sensitivity or symptoms of colitis and infection sensitivity.

How can you convert this sentence into Prolog Rules?


Prolog Rules: Some Examples Cont.
6

In English:
There is evidence of vitamin C deficiency if there is either symptoms of arthritis and
infection sensitivity or symptoms of colitis and infection sensitivity.

hypothesis(vitc_deficiency):-

symptom(arthritis),
symptom(infection_sensitivity).

hypothesis(vitc_deficiency):-

symptom(colitis),
symptom(infection_sensitivity).

You might also like