Sunteți pe pagina 1din 5

RESOLUTION EXAMPLE 1

Consider the knowledge base:

1. Steve only likes easy courses.

2. Science courses are hard.

3. All the courses in the basketweaving department are easy.

4. BK301 is a basketweaving course.

Use resolution, to prove Steve likes BK301

2) RESOLUTION EXAMPLE 2

Consider the following knowledge base:

1. Anything anyone eats is called food.

2. John likes all kind of food.

3. Bread is a food.

4. Mango is a food.

5. Alka eats pizza.

6. Alka eats everything John eats.

Using resolution principle answer the following:

1. Does John like pizza?

2. What food Alka eats?

Solution:

1)

Set F in symbolic form:

1) X: easy(X) -> likes(steve,X)

2) Y: science(Y) -> ~easy(Y)

3) Z: basketweaving(Z) -> easy(Z)

4) basketweaving(bk301)
P: likes(steve,bk301)

Step 1: Reduce F in Clause form:

1) X: easy(X) -> likes(steve,X)

(i) X: easy(X) likes(steve,X)

(ii) easy(X) likes(steve,X)

RESOLUTION EXAMPLE 1 CONTD

2) Y: science(Y) -> easy(Y)

(i) Y: science(Y) easy(Y)

(ii) science(Y) easy(Y)

3) Z: basketweaving(Z) -> easy(Z)

(i) Z: basketweaving basketweaving(Z) easy(Z) easy(Z)

(ii) basketweaving(Z) easy(Z)

4) basketweaving(bk301)

Step 2: Negate P: likes(steve,bk301)

It is already in Clause Normal Form.

RESOLUTION EXAMPLE 1 CONTD

Step 3:

likes(steve,bk301) (1)

bk301/X

(3) easy(bk301)

bk301/Z

basketweaving(bk301) (4)

Contradiction

Since, Contradiction is achieved. Therefore KB does

not entail P. Hence, P is false and P is true.


RESOLUTION EXAMPLE

2)

Anything anyone eats is called food.

X: Y: eats(X , Y) food(Y)

X: Y: eats(X , Y) food(Y)

eats(X , Y) food(Y) (1) (Y) (1)

2. John likes all kind of food

Y1: food(Y1) like(john , Y1)

y1: food(Y1) like( john , Y1) ( john , Y1)

food(Y1) like( john , Y1) (2)

3. Bread is a food

food(bread) ood(bread) (3)

4. Mango is a food

food( mango) food( mango) (4)

5. Alka eats Pizza

eats( alka, pizza) , pizza) (5)

6. Alka eats everything John eats

X1: eats(john , X1) eats(alka, x1)

=> X1: eats(john , X1) eats(john, X1)

=> eats(john , X1) eats(alka, X1) (6)

Question to be answered : 1. Does john likes Pizza ?

P: John like Pizza

P: like(john , pizza , pizza) (7)

like(john, pizza) (2)

food(Y1) like( john , Y1)


pizza/ Y1

food(pizza) (pizza)

(1)

eats(X, Y) food(Y) pizza/ Y

eats(x , pizza)

(5)

eats( alka, pizza) , pizza)

alka/ X

contradiction

Since like(john , pizza) , pizza) is contradiction is contradiction like(john , pizza) , pizza) is true is true

Question to be answered : 2. what food Alka eats ?

eats( alka, ??) , ??)

there exist something(T) which there exist something(T) which Alka eats we have to find the value eats
we have to find the value

of T

conclusion(P) T: eats ( alka, T)

P: [T: eats ( alka, T)]

=> => T: eats (alka ,T)

=> eats (alka , T) (7)

(7) (5)

eats (alka , T) eats( alka, pizza) , pizza)

pizza/ T

contradiction

Alka eats something is true.

And T stores pizza

Therefore we conclude :
eats ( alka, ??) answer is pizza

S-ar putea să vă placă și