0% found this document useful (0 votes)
16 views22 pages

CHPT 7 & 8

Lecture Notes

Uploaded by

snow53726
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views22 pages

CHPT 7 & 8

Lecture Notes

Uploaded by

snow53726
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

7.2 Suppose the agent has progressed to the point shown in Figure 7.

4(a), having perceived nothing in


[1,1], a breeze in [2,1], and a stench in [1,2], and is now concerned with the contents of [1,3],[2,2], and
[3,1]. Each of these can contain a pit and at most one can contain a wumpus. Following the example of
Figure 7.5, construct the set of possible worlds. (You should find 32 of them.) Mark the worlds in which
the KB is true and those in which each of the following sentences is true:

δ 2 = “There is no pit in [2,2].”


δ 3 = “There is a Wumpus in [1,3].”
Hence show that KB |= δ 2 and KB |= δ 3.

?
[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])

W2: There cannot be a Wumpus in [2,2] or [3,1]. ⌐ W2,2 ^ ⌐ W3,1

(No stench in [2,1])

W3: The Wumpus is in [1,3], and not in [2,2] or [3,1]. W1,3 ^ ⌐W2,2 ^ ⌐ W3,1

(W1 and W2)

P1: There must be a pit in [2,2] or [3,1] or both. P2,2 ^ P3,1

(Breeze in [2,1])

P2: There cannot be a pit in [1,3] or [2,2]. ⌐P1,3 ^ ⌐ P2,2

(No breeze in [1,2])

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),

(KB |= δ 2 ). It can be concluded that δ 2 = “There is no pit in [2,2].”

Since δ 3 is true in every model (row) where the KB is true (W3 and P3 are ture),

(KB |= δ 3 ). It can be concluded that δ 3 = “There is a Wumpus in [1,3].”


7.2 Given the following, can you prove that the unicorn is mythical? How about magical? Horned?

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.

P1. Mythical ⇒ Immortal

P2. ¬Mythical ⇒ ¬Immortal ∧ Mammal

P3. Immortal ∨ Mammal ⇒ Horned

P4. Horned ⇒ Magical

1. ¬Immortal ⇒ ¬Mythical P1 contrapositive

2. ¬Immortal ⇒ ¬Immortal ∧ Mammal 1, P2, hypothetical syllogism

3. Immortal ∨ (¬Immortal ∧ Mammal) 2, implication defn

4. (Immortal ∨ ¬Immortal) ∧ (Immortal ∨ Mammal) 3, distributive

5. Immortal ∨ Mammal 4, tautology, identity

6. Horned 5, P3, modus ponens

7. Magical 6, P4, modus ponens

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.

b. True |= False is false.

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.

e. A ⇔ B |= ¬A ∨ B is true because the RHS is A ⇒ B, one of the conjuncts in the definition of A ⇔ B.

f. (A ∧ B) ⇒ C |= (A ⇒ C) ∨ (B ⇒ C) is true because the RHS is false only when both disjuncts are false,

counterintuitive, and would not hold if ⇒ is interpreted as “causes.”


i.e., when A and B are true and C is false, in which case the LHS is also false. This may seem

g. (C ∨ (¬A ∧ ¬B)) ≡ ((A ⇒ C) ∧ (B ⇒ C)) is true; proof by truth table enumeration, or by application of
distributivity (Fig 7.11).

h. (A ∨ B) ∧ (¬C ∨ ¬D ∨ E) |= (A ∨ B) is true; removing a conjunct only allows more models.


i. (A ∨ B) ∧ (¬C ∨ ¬D ∨ E) |= (A ∨ B) ∧ (¬D ∨ E) is false; removing a disjunct allows fewer models.

j. (A ∨ B) ∧ ¬(A ⇒ B) is satisfiable; model has A and ¬B.

k. (A ⇔ B) ∧ (¬A ∨ B) is satisfiable; RHS is entailed by LHS so models are those of A ⇔ B.

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

Prove each of the following assertions:

a. α is valid if and only if True |= α .

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|= α.

b. For any a, False |= a.

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 |= α

c. α |= β if and only if the sentence (α => β ) is valid.

Now, α => β = true (given)

¬(α) U β = true (Implication elimination)

¬(True) U β = true

False U β = true

β is true in m. (Semantics of U)

Thus, If α => β then α |= β

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,

Where for M2, α = False and for M1, α = true

For every m Є M1, α is true in m, β is true in m

α => β Ξ ¬ α U β Ξ False U True

Ξ True (Semantics of U)

For every m Є M2, α is False in m, β is False in m


α => β Ξ ¬ α U β

Ξ True U False

Ξ True (Semantics of U)

Therefore, if α |= β, then α => β is true.

Thus, α |= β if and only if sentence α => β is valid

d. α ≡ β if and only if the sentence (α <=> β ) is valid.

α Ξ β (given)

According to definition of logical equivalence, α Ξ β if they are true in the same set of models.

i.e. α Ξ β then α |= β and β|= α

now if α |= β, α => β

and if β |= α, β => α

as α => β is true and β => α is true, by definition, α  β is true.

Thus, if α Ξ β, (α  β) is valid

(α  β) (given)

(α => β) ^ (β => α) (Biconditional elimination)

Thus α |= β and β |= α i.e. α Ξ β

Therefore, if (α  β) is valid then α Ξ β.

So, we can say that α Ξ β if and only if the sentence (α  β) is valid

e. α |= β if and only if the sentence (α ^ ⌐ β ) is unsatisfiable.

α |= β is true if and only if α => β.

α |= β (given)

α => β = true

(¬α V β) = true (implication elimination)

¬ (¬ α V β) = ¬ (true) (- on both side)

(α ^ ¬β) = false (De Morgan)

Thus, if α |= β then (α ^ ¬β) is unsatisfiable.

Now, (α ^ ¬β) = false (given)

¬ (α ^ ¬β) = ¬ (false)
(¬α V β) = true

α => β = true

i.e. α |= β

Thus, if (α ^ ¬β) is unsatisfiable, α |= β

Thus, α |= β is unsatisfiable if and only if (α ^ ¬β) is unsatisfiable

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 A^B B^C (A^B) v


(B^C)
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 1 0 0 0 0
0 0 1 1 0 0 0
0 1 0 0 0 0 0
0 1 0 1 0 0 0
0 1 1 0 0 1 1
0 1 1 1 0 1 1
1 0 0 0 0 0 0
1 0 0 1 0 0 0
1 0 1 0 0 0 0
1 0 1 1 0 0 0
1 1 0 0 1 0 1
1 1 0 1 1 0 1
1 1 1 0 1 1 1
1 1 1 1 1 1 1

Therefore, there are 6 Models for (A^B) v (B ^ C)


(b) (A v B)

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

Therefore, there are 12 models for the sentence (A v B)


(c) A B  C

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

There are 12 models for the sentence (B v C).


(b) ¬A v ¬B v ¬C v ¬D

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.

a. Smoke => Smoke


⌐Smoke v Smoke
True

Smoke ⌐Smoke Smoke v ⌐Smoke


0 1 1
1 0 1

Hence, as the statement is true for all models, it is valid.

b. Smoke => Fire


⌐Smoke v Fire

Hence, the statement can be true and can be false, it is neither.

c. (smoke => fire) => (¬smoke => ¬fire)


(¬Smoke \/ Fire) => (Smoke \/ ¬Fire) [elimination the inside implications]
¬ (¬Smoke \/ Fire) \/ (Smoke \/ ¬Fire) [elimination the remaining implication]
(Smoke /\ ¬Fire) \/ (Smoke \/ ¬Fire) [moving negation inside - DeMorgan's laws]
(Smoke \/ Smoke \/ ¬Fire) /\ (Fire \/ Smoke \/ ¬Fire) [distributivity]
(True v Smoke)
(True)
(Smoke \/ ¬Fire) /\ True [simplification - see also part (d)]
(Smoke \/ ¬Fire) [note: P /\ True is equivalent to P]
(Fire => Smoke) [converting back to implication]

Hence, as the statement can be true and can be false, it is neither.


d. smoke V fire V ¬fire
smoke V True (Semantics of V)
True (Semantics of V)

Hence, as the statement is true for all models, it is valid.

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 ^)

Hence, as the statement is true for all models, it is valid.

f. (smoke => fire) => ((smoke ^ heat) => fire)


(¬smoke V fire) => (¬(smoke ^ heat) V fire) (Implication elimination)
(¬smoke V fire) => (¬smoke V ¬heat V fire) (De Morgan)
¬ (¬smoke V fire) V (¬smoke V ¬heat V fire) (Implication elimination)
(smoke ^ ¬fire) V (¬smoke V ¬heat V fire) (De Morgan)
(smoke V (¬smoke V ¬heat V fire)) ^ (¬fire V (¬smoke V ¬heat V fire)) (Distributivity of V)
((smoke V ¬smoke) V ¬heat V fire) ^ ((¬fire V fire) V (¬smoke V ¬heat)) (Associativity of V)
(True V ¬heat V fire) ^ (True V ¬smoke V ¬heat) (Semantics of V)
(True) ^ (True) (Semantics of V)
True (Semantics of ^)
Hence, as the statement is true for all models, it is valid.

g. big V dumb V (big => dumb)


big V dumb V (¬big V dumb) (Implication elimination)
(big V ¬big) V (dumb V dumb) (Associativity of V)
True V dumb (Semantics of V)
True (Semantics of V)

Hence, as the statement is true for all models, it is valid.

*************************************************************************************

Resolution in Propositional Logic

To show KB╞ α then show KBα unsatisfiable is proved by contradiction.

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

*************************************************************************************

Given the following Knowledge Base (KB):

R1: ⌐P1,1 (There is no pit in [1,1].)

R2: B1,1  (P1,2 v P2,1)

R3: B2,1  (P1,1 v P2,2 v P3,1)

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)

B1,1 => (P1,2 v P2,1) ^ (P1,2 v P2,1) => B1,1 …………………………………. ( AND Elimination)

(P1,2 v P2,1) => B1,1 …………………………………………………………. ( Contraposition)

⌐ B1,1 => ⌐ (P1,2 v P2,1) …………………………………………………….. (Modus Ponens)

⌐(P1,2 v P2,1) …………………………………………………………………(De Morgan)

⌐P1,2 ^ ⌐ P2,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

Using truth table, does KB entails S ( KB |= S)? Show your work.

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

KB |= S because KB is true but S is false.

************************************************************************************

Given the following Knowledge Base (KB):

R1: ⌐P1,1

R2: B1,1  (P1,2 v P2,1)

R3: B2,1  (P1,1 v P2,2 v P3,1)

R4: ⌐B1,1

R5: B2,1

R6: ⌐B1,2

R7: B2,1

R8: ⌐P2,2

Using equivalence rule, does KB entails P3,1? Show your work.

B2,1  (P1,1 v P2,2 v P3,1)

(B2,1 => (P1,1 v P2,2 v P3,1)) ^ ((P1,1 v P2,2 v P3,1) => B2,1 ) …………………………………. ( AND Elimination)

B2,1 => (P1,1 v P2,2 v P3,1) …………………………………………………………. ( implication elimination)

⌐ B2,1 v (P1,1 v P2,2 v P3,1) …………………………………………………….. (using R7 )

(P1,1 v P2,2 v P3,1) …………………………………………………….. (using R1 )


P2,2 v P3,1 …………………………………………………….. (using R8 )

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.

KB: (⌐F1 v F3) ^ (⌐F4 => ⌐F3)

F2 => ⌐F4

F3 => F5

F1

G: ⌐F2 ^ F5

Solution

KB1: (⌐F1 v F3) ^ (⌐(⌐F4 v ⌐F3))

(⌐F1 v F3) ^ (F3 => F4)

(⌐F1 v F3) ^ F4

KB4: F1

F3 ^ F4

KB3: ⌐F3 v F5

F4 ^ F5

KB2: ⌐F2 v ⌐F4

⌐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

1. P^Q (AND Elimination)


2. Q
3. ⌐Q^⌐R (using Rule 2)
4. Q
5. ⌐R
6. ⌐SvR (using Rule 3)
7. ⌐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.

KB: ⌐(A v B) => C

⌐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

Use the Resolution Algorithm to show that: KB |= P.

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.

*************************************************************************************

(1) How many models


(2) Entail? (equivalent /Model checking (or) truth table)
(3) Truth table (valid/satisfiable/unsatisfiable)
(4) Equivalence Rule (valid/satisfiable/ unsatisfiable)
(5) Resolution proved by contradiction
Assume that a knowledge base KB contains the
following rules:
1.The humidity is high or the sky is cloudy.
2.If the sky is cloudy, then it will rain.
3.If the humidity is high, then it is hot.
4.It is not hot.
Use resolution to prove that “It will rain”.
Let’s the proposition logic symbols-
P = the humidity is high
Q = the sky is cloudy
R = it will rain
S = it is hot
KB:
R1: P v Q
R2: Q => R
R3: P => S
R4: ~S
CNF:
R1: P v Q
R2: ~Q v R
R3: ~ P v S
R4: ~S

~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:

O(E, S) ∨ O(E, L).


(a) Emily is either a surgeon or a lawyer.

O(J, A) ∧ ∃ p p /= A ∧ O(J, p).


(b) Joe is an actor, but he also holds another job.

∀ p O(p, S) ⇒ O(p, D).


(c) All surgeons are doctors.

¬∃ p C (J, p) ∧ O(p, L).


(d) Joe does not have a lawyer (i.e., is not a customer of any lawyer).

∃ p B(p, E) ∧ O(p, L).


(e) Emily has a boss who is a lawyer.

∃ p O(p, L) ∧ ∀ q C(q, p) ⇒ O(q, D).


(f) There exists a lawyer all of whose customers are doctors.

∀ p O(p, S) ⇒ ∃ q O(q, L) ∧ C(p, q).


(g) Every surgeon has a lawyer.

Translate each of the following sentences into First-Order Logic (FOL).

∃ x Student(x) ∧ T akes(x, F, Spring2001).


a. Some students took French in spring 2001.

∀ x, s Student(x) ∧ T akes(x, F, s) ⇒ P asses(x, F, s).


b. Every student who takes French passes it.
∃ x Student(x)∧Takes(x, G, Spring2001)∧∀ y y̸ = x ⇒ ¬Takes(y, G,
c. Only one student took Greek in spring 2001.

Spring2001).

∀ s ∃ x ∀ y Score(x, G, s) > Score(y, F, s).


d. The best score in Greek is always higher than the best score in French.

∀ x Person(x) ∧ (∃ y, z Policy(y) ∧ Buys(x, y, z)) ⇒ Smart(x).


e. Every person who buys a policy is smart.

∀ x, y, z Person(x) ∧ Policy(y) ∧ Expensive(y) ⇒ ¬Buys(x, y, z).


f. No person buys an expensive policy.

∃ x Agent(x) ∧ ∀ y, z Policy(y) ∧ Sells(x, y, z) ⇒ (Person(z) ∧


g. There is an agent who sells policies only to people who are not insured.

¬Insured(z)).

h. There is a barber who shaves all men in town who do not shave

∃ x Barber(x) ∧ ∀ y M an(y) ∧ ¬Shaves(y, y) ⇒ Shaves(x, y).


themselves.

i. A person born in the UK, each of whose parents is a UK citizen or a UK

∀ x Person(x)∧Born(x, U K)∧(∀ y Parent(y, x) ⇒ ((∃ r Citizen(y, U K,


resident, is a UK citizen by birth.

Resident(y, U K))) ⇒ Citizen(x, U K, Birth).


r))∨

j. A person born outside the UK, one of whose parents is a UK citizen by

∀ x Person(x) ∧ ¬Born(x, U K) ∧ (∃ y Parent(y, x) ∧ Citizen(y, U K,


birth, is a UK citizen by descent.

Birth)) ⇒ Citizen(x, U K, Descent).

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:

s Set(s)  (s = {} )  (x,s2 Set(s2)  s = {x|s2})

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} = {}

3. Adjoining an element already in the set has no effect:

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:

x,s x  s  y,s2 (s = {y|s2}  (x = y  x  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:

s1,s2 s1  s2  (x x  s1  x  s2)

6. Brothers are siblings


x,y Brother(x,y)  Sibling(x,y)
7. One's mother is one's female parent
m,c Mother(c) = m  (Female(m)  Parent(m,c))

∀ g, c grandparent(g, c) ⇔∃ p Parent(g, p) ∧ Parent(p, c)


8. A grandparent is a parent of one’s parent:

∀ x, y sibling(x, y) ⇔ ¬ (x = y) ∧ ∃ p Parent(p, x) ∧ Parent(p, y)


9. A sibling is another child of one’s parents:

You might also like