Unit-4 Using Predicate Logic
Unit-4 Using Predicate Logic
(2180703)
Rutal Mahajan
S.N.P.I.T.R.C., Umrakh
[email protected]
Quantifiers:
2 types:-
Existential quantifier ( ):
Pompeian
Pompeian were Romans
Algorithm steps :-
1. Convert all the propositions (statements) of Knowledge Base to clausal Normal
form (S).
2. Negate and convert it to clause form. Add it to set of clauses S.
3. Repeat until either a contradiction is found or no progress can be made.
a. Select two clauses ( P) and ( P).
b. Add the resolvent ( ) to S
c. If resolvent is empty clause, then contradiction has been found.
1. Eliminate .
P Q P Q
2. Reduce the scope of each to a single term.
(P Q) P Q
(P Q) P Q
x: P x: P
x: p x: P
P P
3. Standardize variables so that each quantifier binds a unique variable.
(x: P(x)) (x: Q(x))
5. Eliminate (Skolemization).
x: P(x) P(c) Skolem constant
6. Drop .
x: P(x) P(x)
• Ex. 2:
y: x: leads ( y , x )
Here value of y that satisfies ‘leads’ depends on particular value of x hence above
stmt can be written as:
x: leads ( f(x) , x )
Where f(x) is skolem function.
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
¬ Pompeian (X), roman(X) Remove -> so: ¬ Pompeian(X) V roman (X)
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
¬ ¬Pompeian
man(X) V(X)person(X)
V roman(X)
Pompeian (Marcus)
x Pompeian (X)-> roman(X) x2: Pompeian(x2) [ loyal(x2 , caesar) hate(x2 , caesar) ]
¬¬ Pompeian
man(X1) (X) V roman(X)
V person(X1) x2: Pompeian(x2) loyal(x2 , caesar) hate(x2 , caesar)
Pompeian(x2) loyal(x2 , caesar) hate(x2 , caesar)
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
¬¬Pompeian
man(X1)(X), roman(X)
V person(X1)
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
¬¬Pompeian
man(X1)(X),
V person(X1)
roman(X)
loyal(X3) V f(X3)
Remove quantifiers
person(x4) ruler(f(x4)) tryassassinate(x4, f(x4)) loyal(x4, f(x4))
Final statement
Pompeian (Marcus)
x Pompeian (X)-> roman(X)
¬¬Pompeian
man(X1)(X) roman(X)
V person(X1)
loyal(X3) V f(X3)
Pompeian (Marcus)
Pompeian
¬ man(X1) (X1), roman(X1)
V person(X1)
• E.g.
Hate( marcus , X) Hate (marcus , caesar)
caesar/ X
e.g. 2.
x2 / marcus
(4)
ruler( caesar ) ruler( caesar )
Step1: To answer this question, first it must be considered true that someone hated
Caesar. i.e.
x: Hate (x,Caesar).
Step3: conversion to Clausal Form (if someone hate Caesar then x is someone)
(Hate (x, Caesar) V ans(x))
X2/Marcus
Loyal(Marcus,Caesar) V ans(Marcus)
ans(Marcus)
Answers: