Trường Đại Học Bách Khoa Tp.Hồ Chí Minh
Khoa Khoa Học và Kỹ Thuật Máy Tính
Tutorial 6
PREDICATE LOGIC and
STRUCTURED KNOWLEDGE
Question 1:
Wrong in:
¬gt(5, 2) ∨ ¬succ(y, 2) combines with 6¬gt(x, y) ∨ ¬gt(y, z) ∨ gt(x, z) by the substitution
5/x, y/z
This combination is wrong because the variable y in each clause is different to each other.
To correct the resolution, we have to change the name of variable y in either first clause or
second clause.
Question 2:
What is wrong with the following argument:
• Men are widely distributed over the earth.
• Socrates is a man.
• Therefore, Socrates is widely distributed over the earth.
How should the facts represented by these sentences be represented in logic so that this
problem does not arise?
Solution
The conclusion is false because the property "widely distributed over the earth" is appli-
cable over a set (group of men). Not to each individual in the set.
To avoid that wrong conclusion, we can represent these facts like this:
man(Socrates).
widelyDistributed(men,earth)
Question 3:
Consider the following axioms:
1. All hounds howl at night.
2. Anyone who has any cats will not have any mice.
3. Light sleepers do not have anything which howls at night.
4. John has either a cat or a hound.
Use resolution with predicate logic to affirm the following conclusion:
If John is a light sleeper, then John does not have any mice.
Solution
Artificial Intelligence Exercises Page 1/5
Trường Đại Học Bách Khoa Tp.Hồ Chí Minh
Khoa Khoa Học và Kỹ Thuật Máy Tính
Before going to do resolution, we have to represent these facts in predicate logic:
1. ∀x(HOUND(x) → HOW L(x))
2. ∀x∀y(HAV E(x, y) ∧ CAT (y) → ¬∃z(HAV E(x, z) ∧ MOUSE(z)))
3. ∀x(LS(x) → ¬∃y(HAV E(x, y) ∧ HOW L(y)))
4. ∃x(HAV E(John, x) ∧ ((CAT (x) ∨ HOUND(x)) ∧ (¬CAT (x) ∨ ¬HOUND(x)))
Conclusion: LS(John) → ¬∃z(HAV E(John, z) ∧ MOUSE(z))
Convert to clause form
1.¬HOUN D(x) ∨ HOW L(x)
2.¬HAV E(x, y) ∨ ¬CAT (y) ∨ ¬HAV E(x, z) ∨ ¬MOUSE(z)
3.¬LS(x) ∨ ¬HAV E(x, y) ∨ ¬HOW L(y)
4a.HAV E(John, a)
4b.CAT (a) ∨ HOU ND(a)
4c. ¬CAT (a) ∨ ¬HOUND(a)
Negation of conclusion
5a.LS(John)
5b.HAV E(John, b)
5c.MOUSE(b)
Resolution
5c b/z 2 6.¬HAV E(x, y) ∨ ¬CAT(y) ∨ ¬HAV E(x, b)
5b John/x 6 7.¬HAV E(John, y) ∨ ¬CAT (y)
4b a/y 7 8.¬HAV E(John, a) ∨ HOU N D(a)
4a 8 9.HOW L(a)
3 a/y 9 10.¬LS(x) ∨ ¬HAV E(x, a)
4a John/x 10 11.¬LS(John)
5a 11 []
Question 4:
Prove that each of the following sentences is valid by using existential graph’s rules of
inferences:
a. P ⇒ (Q ⇒ P )
b. ((Smoke ⇒ F ire) ∨ (Heat ⇒ F ire)) ⇒ ((Smoke ∧ Heat) ⇒ F ire)
c. (Q ⇒ ¬P ) ⇒ ((Q ⇒ P ) ⇒ ¬Q)
d. ((P ⇒ Q) ∧ (¬P ⇒ R)) ⇒ ((P ∧ Q) ⇒ (¬P ∧ R))
Solution
Artificial Intelligence Exercises Page 2/5
Trường Đại Học Bách Khoa Tp.Hồ Chí Minh
Khoa Khoa Học và Kỹ Thuật Máy Tính
a
( () ) Double negation
(P () ) Insertion
(P ( (()) ) ) Double negation
(P ( ((P)) ) ) Iteration
(P ( ( Q (P) ) ) ) Insertion
(P ( ( Q (P) ) ) ) Insertion
b: ( ( ( (S (F)) ) ( (H (F)) ) ) ((S H (F))) )
( () ) Double negation
( () ((S H (F))) ) Insertion
( ( ((S H (F))) ) ((S H (F))) ) Iteration
( ( S H (F) ) ((S H (F))) ) Double negation
( ( S H (F) (F) ) ((S H (F))) ) Iteration
( ( S (F) ((H (F))) ) ((S H (F))) ) Double negation
( ( ((S (F))) ((H (F))) ) ((S H (F))) ) Double negation
c: ( (Q ((P))) ((Q (P)) ((Q))) )
( () ) Double negation
( () ((Q (P)) ((Q)))) Insertion
( () ((Q (P)) ((Q))) ((Q (P)) ((Q))) ) Iteration
( () ((Q (P)) Q) ((Q (P)) ((Q))) ) Double negation
( () (((P)) Q) ((Q (P)) ((Q))) ) Deiteration
( () ( P Q) ((Q (P)) ((Q))) ) Double negation
( ( (P Q) ) (P Q) ((Q (P)) ((Q))) ) iteration
( ( (Q ((P))) ) (P Q) ((Q (P)) ((Q))) ) Double negation
Artificial Intelligence Exercises Page 3/5
Trường Đại Học Bách Khoa Tp.Hồ Chí Minh
Khoa Khoa Học và Kỹ Thuật Máy Tính
d: ( (P (Q)) ((P) (R)) (((P Q) ((P) R))) )
( () ) Double negation
( () ((P)) ((Q)) ((P) (R))) Insertion
( (((P)) ((Q))) ((P)) ((Q)) ((P) (R)) ) Iteration
( (P Q) ((P)) ((Q)) ((R)) ((P) (R)) ) Double negation
( (P Q) ((P)) ((Q) ((P)) ) ((P) (R)) ) Iteration
( (P Q) ((P)) ((Q) P) ((P) (R)) ) Double negation
( (P Q) ((Q) P) ((P) ((P) (R))) ((P) (R)) ) Iteration
( (P Q) ((Q) P) ( (P) R ) ((P) (R)) ) Deiteration + Double negation
( (P (Q)) ((P) (R)) (P Q) ((P) R) ) Just reorder
( (P (Q)) ((P) (R)) (( (P Q) ((P) R) )) ) Double negation
Question 5:
Convert the following sentence into predicate logic, existential graph (EG) and conceptual
graph (CG):
If a cat is on a mat, then it is a happy pet.
Solution
Prediate logic:
∀x∀y : cat(x) ∧ mat(y) ∧ on(x, y) → happyP et(x)
¬(∃x∃y : cat(x) ∧ mat(y) ∧ on(x, y) ∧ ¬happyPet(x)
Another possible solution:
∀x∀y∀z((cat(x) ∧ mat(y) ∧ on(x, y)) → (pet(x) ∧ happy(z) ∧ haveattr(x, z)))
Artificial Intelligence Exercises Page 4/5
Trường Đại Học Bách Khoa Tp.Hồ Chí Minh
Khoa Khoa Học và Kỹ Thuật Máy Tính
Artificial Intelligence Exercises Page 5/5
. following argument:
• Men are widely distributed over the earth.
• Socrates is a man.
• Therefore, Socrates is widely distributed over the earth.
How should. arise?
Solution
The conclusion is false because the property "widely distributed over the earth" is appli-
cable over a set (group of men). Not