CHPT 7 & 8
CHPT 7 & 8
?
[1,3]
Stench ?
[1,2] [2,2]
- Breeze ?
[1,1] [2,1] [3,1]
KB:
W1: There must be a Wumpus in either [1,3] or [2,2]. (W1,3 ^ ⌐ W2,2) v (⌐ W1,3 ^ W2,2 )
(Stench in [1,2])
W3: The Wumpus is in [1,3], and not in [2,2] or [3,1]. W1,3 ^ ⌐W2,2 ^ ⌐ W3,1
(Breeze in [2,1])
P3: There is a pit in [3,1] and no pit in [1,3] or [2,2]. P3,1 ^ ⌐P1,3 ^ ⌐ P2,2
Wumpus Pit in Pit in Pit in W[1,3] is P[3,1] is KB is δ2 = δ3 =
in [1,3], [1,3] [2,2] [3,1] true true true “There is “There is
[2,2], or no pit in a
[3,1] [2,2].” Wumpus
in [1,3].”
no 0 0 0 0 0 0 1 0
no 0 0 1 0 1 0 1 0
no 0 1 0 0 0 0 0 0
no 0 1 1 0 0 0 0 0
no 1 0 0 0 0 0 1 0
No 1 0 1 0 0 0 1 0
no 1 1 0 0 0 0 0 0
No 1 1 1 0 0 0 0 0
[1,3] 0 0 0 1 0 0 1 1
[1,3] 0 0 1 1 1 1 1 1
[1,3] 0 1 0 1 0 0 0 1
[1,3] 0 1 1 1 0 0 0 1
[1,3] 1 0 0 1 0 0 1 1
[1,3] 1 0 1 1 0 0 1 1
[1,3] 1 1 0 1 0 0 0 1
[1,3] 1 1 1 1 0 0 0 1
[2,2] 0 0 0 0 0 0 1 0
[2,2] 0 0 1 0 1 0 1 0
[2,2] 0 1 0 0 0 0 0 0
[2,2] 0 1 1 0 0 0 0 0
[2,2] 1 0 0 0 0 0 1 0
[2,2] 1 0 1 0 0 0 1 0
[2,2] 1 1 0 0 0 0 0 0
[2,2] 1 1 1 0 0 0 0 0
[3,1] 0 0 0 0 0 0 1 0
[3,1] 0 0 1 0 1 0 1 0
[3,1] 0 1 0 0 0 0 0 0
[3,1] 0 1 1 0 0 0 0 0
[3,1] 1 0 0 0 0 0 1 0
[3,1] 1 0 1 0 0 0 1 0
[3,1] 1 1 0 0 0 0 0 0
[3,1] 1 1 1 0 0 0 0 0
Since δ 2 is true in every model (row) where the KB is true (W3 and P3 are ture),
Since δ 3 is true in every model (row) where the KB is true (W3 and P3 are ture),
If the unicorn is mythical, then it is immortal, but if it is not mythical, then it is a mortal mammal. If
the unicorn is either immortal or a mammal, then it is horned. The unicorn is magical if it is horned.
Therefore, the unicorn is horned and magical. However, there is no way to show the unicorn is mythical.
*************************************************************************************
7.4.
a. False |= True is true because False has no models and hence entails every sentence AND because True
is true in all models and hence is entailed by every sentence.
c. (A ∧ B) |= (A ⇔ B) is true because the left-hand side has exactly one model that is one of the two
models of the right-hand side.
d. A ⇔ B |= A ∨ B is false because one of the models of A ⇔ B has both A and B false, which does not
satisfy A ∨ B.
f. (A ∧ B) ⇒ C |= (A ⇒ C) ∨ (B ⇒ C) is true because the RHS is false only when both disjuncts are false,
g. (C ∨ (¬A ∧ ¬B)) ≡ ((A ⇒ C) ∧ (B ⇒ C)) is true; proof by truth table enumeration, or by application of
distributivity (Fig 7.11).
l. (A ⇔ B) ⇔ C does have the same number of models as (A ⇔ B); half the models of (A ⇔ B) satisfy (A
⇔ B) ⇔ C, as do half the non-models, and there are the same numbers of models and non-models.
7.5
Here, True |= α means True entails α if and only if α is true in each model where True is true. For
a statement to be valid, it must be true in every model. Hence α is valid if and only if True|= α.
Here, False |= α means False entails α if and only if in every model where False is true, α must
be true. Since False is false in every model, for any α, False |= α
¬(True) U β = true
False U β = true
β is true in m. (Semantics of U)
Now, α |= β is given,
α |= β means α entails β if and only if in every model where α is true, β must be true.
Let M = M1 U M2
For all m Є M,
Ξ True (Semantics of U)
Ξ True U False
Ξ True (Semantics of U)
α Ξ β (given)
According to definition of logical equivalence, α Ξ β if they are true in the same set of models.
now if α |= β, α => β
and if β |= α, β => α
Thus, if α Ξ β, (α β) is valid
(α β) (given)
α |= β (given)
α => β = true
¬ (α ^ ¬β) = ¬ (false)
(¬α V β) = true
α => β = true
i.e. α |= β
7.7 Consider a vocabulary with only four proposition logic A, B, C and D. How many models are there for
the following sentence?
(a) (A ^ B) v (B ^ C)
A B C D AvB
0 0 0 0 0
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 1
1 0 0 1 1
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
A B C D A B C
0 0 0 0 1
0 0 0 1 1
0 0 1 0 0
0 0 1 1 0
0 1 0 0 0
0 1 0 1 0
0 1 1 0 0
0 1 1 1 0
1 0 0 0 0
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 0
1 1 0 1 0
1 1 1 0 1
1 1 1 1 1
(a) B V C
A B C D BvC
0 0 0 0 0
0 0 0 1 0
0 0 1 0 1
0 0 1 1 1
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 1
1 0 0 0 0
1 0 0 1 0
1 0 1 0 1
1 0 1 1 1
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
1 1 1 1 1
A B C D ¬ ¬B ¬C ¬D ¬A v ¬B v ¬C v ¬D
A
0 0 0 0 1 1 1 1 1
0 0 0 1 1 1 1 0 1
0 0 1 0 1 1 0 1 1
0 0 1 1 1 1 0 0 1
0 1 0 0 1 0 1 1 1
0 1 0 1 1 0 1 0 1
0 1 1 0 1 0 0 1 1
0 1 1 1 1 0 0 0 1
1 0 0 0 0 1 1 1 1
1 0 0 1 0 1 1 0 1
1 0 1 0 0 1 0 1 1
1 0 1 1 0 1 0 0 1
1 1 0 0 0 0 1 1 1
1 1 0 1 0 0 1 0 1
1 1 1 0 0 0 0 1 1
1 1 1 1 0 0 0 0 0
There are 15 models for the sentence (B v C).
(c) (A => B) ^ A ^ ¬B ^ C ^ D
A B C D A=>B ¬B (A => B) ^ A ^ ¬B ^ C ^ D
0 0 0 0 1 1 0
0 0 0 1 1 1 0
0 0 1 0 1 1 0
0 0 1 1 1 1 0
0 1 0 0 1 0 0
0 1 0 1 1 0 0
0 1 1 0 1 0 0
0 1 1 1 1 0 0
1 0 0 0 0 1 0
1 0 0 1 0 1 0
1 0 1 0 0 1 0
1 0 1 1 0 1 0
1 1 0 0 1 0 0
1 1 0 1 1 0 0
1 1 1 0 1 0 0
1 1 1 1 1 0 0
Therefore, there is no model for the sentence (A => B) ^ A ^ ¬B ^ C ^ D.
7.10
Decide whether each of the following sentences is valid, unsatisfiable, or neither. Verify your decisions
using truth tables or the equivalence rules of Figure 7.1 1.
e. (smoke ^ heat) => fire) ((smoke => fire) V (heat => fire))
(¬ (smoke ^ heat) V fire) ((¬smoke V fire) V (¬heat V fire)) (Implication elimination)
(¬smoke V ¬heat V fire) (¬smoke V fire V ¬heat V fire) (De Morgan)
(¬smoke V ¬heat V fire) (¬smoke V ¬heat V fire) (Semantics of V)
((¬smoke V ¬heat V fire) => (¬smoke V ¬heat V fire)) ^ (Biconditional elimination)
((¬smoke V ¬heat V fire) => (¬smoke V ¬heat V fire))
¬(¬smoke v ¬heat v fire) v (¬smoke v ¬heat v fire)
(smoke ^ heat ^ ¬fire) v (¬smoke v ¬heat v fire)
True (Semantics of ^)
*************************************************************************************
KB: R1: P
R2: (P ^ Q) => R
R3: (S v T) => Q
R4: T
Prove α=R.
CNF
1. P
2. P v Q v R
3. S v Q
4. T v Q
5. T
A resolution proof of R:
P v Q v R R
P v Q P
Q T v Q
T T
*************************************************************************************
R4: ⌐B1,1
R5: B2,1.
Using resolution for propositional logic, does KB entails ⌐P1,2? Show your work.
B1,1 => (P1,2 v P2,1) ^ (P1,2 v P2,1) => B1,1 …………………………………. ( AND Elimination)
⌐P1,2
Therefore, KB |= ⌐P1,2.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Given the following knowledge base:
KB: R1: A v B
R2: ⌐C v A
S: A ^ C
A B C ⌐C AvB ⌐C v A KB S=A ^ C
0 0 0 1 0 1 0 0
0 0 1 0 0 0 0 0
0 1 0 1 1 1 1 0
0 1 1 0 1 0 0 0
1 0 0 1 1 1 1 0
1 0 1 0 1 1 1 1
1 1 0 1 1 1 1 0
1 1 1 0 1 1 1 1
************************************************************************************
R1: ⌐P1,1
R4: ⌐B1,1
R5: B2,1
R6: ⌐B1,2
R7: B2,1
R8: ⌐P2,2
(B2,1 => (P1,1 v P2,2 v P3,1)) ^ ((P1,1 v P2,2 v P3,1) => B2,1 ) …………………………………. ( AND Elimination)
P3,1
Therefore, KB |= P3,1.
************************************************************************************
Given the following propositional logic sentences in a knowledge base KB, use resolution to prove that
the knowledge base entails the sentence G, i.e., KB |= G.
F2 => ⌐F4
F3 => F5
F1
G: ⌐F2 ^ F5
Solution
(⌐F1 v F3) ^ F4
KB4: F1
F3 ^ F4
KB3: ⌐F3 v F5
F4 ^ F5
⌐F2 ^ F5
Therefore, KB |= G.
************************************************************************************
Given the following propositional logic sentences in a knowledge base KB, use resolution to prove that
the knowledge base entails the sentence G, i.e., KB |= G.
KB: P ^ Q
P => ⌐ (Q v R)
S => R
G: ⌐S
Therefore, KB |= G.
*************************************************************************************
Given the following propositional logic sentences in a knowledge base KB, use resolution to prove that
the knowledge base entails the sentence G, i.e., KB |= G.
⌐A
⌐C
G: B.
1. ⌐ (A v B) => C
2. ⌐ (⌐(A v B)) v C
3. (A v B) v C
4. ⌐A using KB2
5. BvC
6. ⌐C using KB3
B
Therefore, KB |= G.
*************************************************************************************
Consider the following Knowledge base (KB):
R1: Q ^ R => P
R2: S ^ T => R
R3: T v U
R4: Q
R5: S
R6: ⌐U
1. Q ^ R => P
2. ⌐ (Q ^ R) v P
3. ⌐Q v ⌐R v P
4. Q using R4
5. ⌐R v P
6. S ^ T => R
7. ⌐ (S ^ T) v R
8. ⌐S v ⌐T v R
9. S using R5
10. ⌐T v R
11. T v U using R3
12. RvU
13. ⌐R v P using step 5
14. UvP
15. ⌐U using R6
16. P
Therefore, KB |= P.
*************************************************************************************
~Q v R ~R
~Q PvQ
P ~P v S
S ~S
It will rain.
Chpater-8 (First Order Logic)
8.10 Consider a vocabulary with the following symbols:
Occupation(p,o): Predicate. Person p has occupation o.
Customer(p1,p2): Predicate. Person p1 is a customer of person p2.
Boss(p1,p2): Predicate. Person p1 is a boss of person p2.
Doctor, Surgeon, Lawyer, Actor: Constants denoting occupations.
Emily, Joe: Constants denoting people.
Use these symbols to write the following assertions in first order logic:
Spring2001).
¬Insured(z)).
h. There is a barber who shaves all men in town who do not shave
k. Politicians can fool some of the people all of the time, and they can fool
all of the people some of the time, but they can’t fool all of the people all of
the time.
∀ x Politician(x) ⇒ (∃ y ∀ t Person(y) ∧ Fools(x, y, t)) ∧ (∃ t ∀ y
Person(y) ⇒ Fools(x, y, t)) ∧ ¬(∀ t ∀ y Person(y) ⇒ Fools(x, y, t))
1. The only sets are the empty set and those made by adjoining something to a set:
2. The empty set has no elements adjoined into it. In other words, there is no way to decompose
{ } into a smaller set and an element:
x,s {x|s} = {}
x,s x s s = {x|s}
4. The only members of a set are the elements that were adjoined into it. We express this
recursively, saying that x is a member of s if and only if s is equal to some sets2 adjoined with
some element y, where either y is the same as x or x is a member of s2:
5. A set is a subset of another set if and only if all of the first set’s members are members of the
second set: