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

CSE-4103 Artificial Intelligence: Unification

This document contains information about a Prolog lecture on unification given by MD. Nazmus Salehin from the Department of Computer Science and Engineering at Bangladesh Army University of Engineering and Technology. It provides 3 rules of unification in Prolog: 1) A free variable will unify with any term that satisfies preceding conditions and the variable will be bound to that term's value. 2) A constant can unify with itself or a free variable, binding the variable to the constant if unified. 3) A free variable will unify with any other free variable, and they will be bound to the same value if one becomes bound. Examples are given to demonstrate each rule.

Uploaded by

Mominul Haque
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

CSE-4103 Artificial Intelligence: Unification

This document contains information about a Prolog lecture on unification given by MD. Nazmus Salehin from the Department of Computer Science and Engineering at Bangladesh Army University of Engineering and Technology. It provides 3 rules of unification in Prolog: 1) A free variable will unify with any term that satisfies preceding conditions and the variable will be bound to that term's value. 2) A constant can unify with itself or a free variable, binding the variable to the constant if unified. 3) A free variable will unify with any other free variable, and they will be bound to the same value if one becomes bound. Examples are given to demonstrate each rule.

Uploaded by

Mominul Haque
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CSE-4103

Artificial Intelligence
Unification

MD. NAZMUS SALEHIN

LECTURER

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CSE)

BANGLADESH ARMY UNIVERSITY OF ENGINEERING AND TECHNOLOGY (BAUET)

CONTACT:

[email protected]
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


Unification
/* A simple prolog program */
3
domains
disease, indication = symbol Goal: symptom(Disease , mild_body_ache)
Disease=cold
predicates
1 Solution
symptom(disease, indication)
clauses
symptom(chicken_pox, high_fever).
symptom(cold, mild_body_ache).
symptom(cold, runny_nose).

Rule1: A variable that is free will unify with any term that satisfies the
preceding conditions. After unification, the variable is bound to the value of
the term.
Unification Cont.
/* A simple prolog program */
4
domains
name= symbol Goal: man(socrates)
Yes
predicates Goal: mortal(socrates)
man(name) Yes
mortal(name)
clauses
man(socrates).
mortal(X):-
man(X).

Rule 2: A constant can unify with itself or any free variable. If the constant is
unified with a variable, the variable will be bound to the value of the
constant.
Unification Cont.
domains
5
name=symbol

Predicates

parent(name, name)

mother(name, name)

female(name) Goal: mother(M, bill).


Clauses
M = jane
parent(john, bill).
1 Solution
parent(jane, bill).

female(jane).

mother(X, Y):-

parent(X, Y),

female(X).

Rule 3: A free variable will unify with any other free variable. After unifying,
the two variable will act as one. If one of the variable becomes bound, the
other will be bound to the same value.
Summary
6

You might also like