Q2

A) Use the Resolution Algorithm to prove that "Alice is accepted"

1. Define Predicates and Constants:

2. Translate the story into First-Order Logic:

  1. Everyone who has high grades or has strong recommendations is accepted:

    x((H(x)R(x))A(x))
  2. Everyone who works hard has high grades:

    x(W(x)H(x))
  3. Alice did not work hard but she has strong recommendations:

    ¬W(a)R(a)

3. Convert to Conjunctive Normal Form (CNF):

4. Resolution Steps:

We only need a few steps to reach a contradiction because her strong recommendations alone are sufficient for acceptance.

Conclusion: By deriving the empty clause, we prove the original goal is true. Alice is accepted.


B) Translate the following statements into predicate logic

Constants: s (Sarah), t (Tom), m (Mike)

Predicates: Animal(x), Loves(x,y), Dog(x), Cat(x), Barks(x), Dangerous(x), Owns(x,y), Friendly(x)

a. Sarah loves every animal.

x(Animal(x)Loves(s,x))

b. Dogs and cats are animals.

x((Dog(x)Cat(x))Animal(x))

c. Everything that barks and is not dangerous is a dog.

x((Barks(x)¬Dangerous(x))Dog(x))

d. Tom owns a dog and it's friendly.

x(Dog(x)Owns(t,x)Friendly(x))

e. Mike owns every pet that Tom owns.

x(Owns(t,x)Owns(m,x))

(Note: Assuming we don't need a Predicate for Pet).


C) Prove or disprove the goal friend1(X) & friend2(X) by using backward chaining (Look Lecture 4).

Initial Facts Database:

Goal: Prove friend1(X) , friend2(X)

Evaluating Sub-goal 1: Prove friend1(X)


Evaluating Sub-goal 2: Prove friend2(X)

- c(X) is true for X=2

then Friend2(X) is true where X=2