SolutionsHuthRyanChapter2
SolutionsHuthRyanChapter2
Exercises from Huth and Ryan, Logic in Computer Science, 2nd ed.
Exercise 2.1.3. We use the predicates,
InBox(x): x is in the box
Red(x): x is red
Animal(x): x is an animal
Cat(x): x is a cat
Dog(x): x is a dog
Boy(x): x is a boy
P rize(x): x is a prize
W on(x, y): x won y
to formalize the following sentences.
a. All red things are in the box.
∀x(Red(x) → InBox(x))
∀x(InBox(x) → Red(x))
Exercise 2.1.4. Let F (x, y) mean that x is the father of y; M (x, y), that x
is the mother of y; H(x, y), that x is the husband of y; S(x, y), that x is the
sister of y; and B(x, y), that x is the brother of y. We use these predicate
symbols to translate the following sentences into predicate logic.
a. Everybody has a mother.
∀x∃yM (y, x)
or, equivalently,
∀x∃y∃z(F (y, x) ∧ M (z, x))
d. Ed is a grandfather.
g. No uncle is an aunt.
or, equivalently,
H(Ed, P atsy)
Exercise 2.4.1. Let φ be the formula ∀x∀yQ(g(x, y), g(y, y), z).
If M is a model with universe A, such that QM = A × A × A, then
M |=l φ, for every environment l (regardless of what function g M is).
On the other hand, if M0 is a model with universe A, such that QM is
the empty set, then M0 6|=l φ, for any environment l.
Exercise 2.4.2. Let φ be the sentence
The following models all have the set N of natural numbers as universe.
a. The model M with P M = {(m, n) | m < n} satisfies φ because for
every environment l and every natural number k,
M |=l[x7→k][y7→k+1][z7→k] P (x, y) ∧ P (z, y) ∧ (P (x, z) → P (z, x)).
0
b. The model M0 with P M = {(m, 2 ∗ m) | m ∈ N} satisfies φ because
for every environment l and every natural number k,
M0 |=l[x7→k][y7→2∗k][z7→k] P (x, y) ∧ P (z, y) ∧ (P (x, z) → P (z, x)).
00
c. The model M00 with P M = {(m, n) | m < n + 1} satisfies φ because
for every environment l and every natural number k,
M00 |=l[x7→k][y7→k][z7→k] P (x, y) ∧ P (z, y) ∧ (P (x, z) → P (z, x)).
φ1 = ∀x P (x, x)
φ2 = ∀x∀y (P (x, y) → P (y, x))
φ3 = ∀x∀y∀z (P (x, y) ∧ P (y, z) → P (x, z))
M |= ∀x P (x) ∨ ∀x Q(x).
M |= ∀x (P (x) ∨ Q(x)).
M |= ∀x P (x)
or
M |= ∀x Q(x).
(i) We first consider the case that M |= ∀x P (x). By the semantics of
universal quantification, we know that
M |=l[x7→a] P (x)
for every environment l and all elements a ∈ A. But then we also have
M |= ∀x (P (x) ∨ Q(x)).
Exercise 2.4.11.
b. The model from the preceding part also satisfies the formula ∀x∀y∀z(S(x, y)∧
S(y, z) → S(x, z)), which expresses that S denotes a transitive binary
relation.
Exercise 2.4.12(h). The formula ∀x∀y ((P (x) → P (y)) ∧ (P (y) → P (x)))
is not a theorem. For instance, it is false in the model M with the set of
natural numbers as universe and for which P M is the relation {n | n is even}.
Exercise 2.4.12(i). The formula
is not a theorem. For example, it is false in the model M with the set of
natural numbers as universe and for which P M is the relation {n | n is even}
and QM is the relation {n | n is odd}.