Q2
A) Use the Resolution Algorithm to prove that "Alice is accepted"
1. Define Predicates and Constants:
-
: has high grades -
: has strong recommendations -
: is accepted -
: works hard -
: Alice
2. Translate the story into First-Order Logic:
-
Everyone who has high grades or has strong recommendations is accepted:
-
Everyone who works hard has high grades:
-
Alice did not work hard but she has strong recommendations:
- Goal to prove:
3. Convert to Conjunctive Normal Form (CNF):
-
From Premise 1:
-
-
Apply De Morgan's Law:
-
Distribute:
-
C1:
-
C2:
-
-
From Premise 2:
- C3:
- C3:
-
From Premise 3:
-
C4:
-
C5:
-
-
Negated Goal:
- C6:
- C6:
4. Resolution Steps:
We only need a few steps to reach a contradiction because her strong recommendations alone are sufficient for acceptance.
-
Step 1: Resolve C6 (
) with C2 ( ) by substituting : - Result: C7:
- Result: C7:
-
Step 2: Resolve C7 (
) with C5 ( ): - Result:
(Contradiction)
- Result:
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:
Predicates:
a. Sarah loves every animal.
b. Dogs and cats are animals.
c. Everything that barks and is not dangerous is a dog.
d. Tom owns a dog and it's friendly.
e. Mike owns every pet that Tom owns.
(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)
-
Rule 1 says IF
is true THEN is true. - Check Database:
is not in the database. Rule 1 fails.
- Check Database:
-
Rule 2 says IF
is true AND is true THEN is true. -
Attempt to prove
a:-
Rule 4 says IF
is true THEN is true. (This requires to be false). -
Attempt to prove
d:-
Rule 8 says IF
is true AND is true THEN is true. -
Check Database:
is true, and is true. Therefore, is true.
-
-
Since
is true, is false. Therefore, Rule 4 fails, meaning is false.
-
-
Because
is false, the condition for Rule 2 ( ) fails. Rule 2 fails.
-
-
Conclusion for Sub-goal 1:
cannot be proven and is evaluated as False.
Evaluating Sub-goal 2: Prove friend2(X)
-
Matching friend2(X):
-
R3: IF c(X) is true THEN Friend2(X) is true
-
Matching c(X) :
-
R7: IF not(e) is true THEN c(2) is true
-
Matching e
-
R9: IF h2 is true AND h3 is true THEN e is true
-
h2 is true and h3 is false then e is false then R9 is false
-
-
Return to R7:
-
R7: IF not(e) is true THEN c(2) is true
-
e is false, then not(e) become true
-
So, c(2) is true then R7 is true
-
-
Return to R3:
-
R3: IF c(X) is true THEN Friend2(X) is true
- c(X) is true for X=2
then Friend2(X) is true where X=2