Reader
Reader
September 2016
Contents
Part A
1 Introduction 2
2 Atomic sentences 2
3 Propositional logic: conjunction, disjunction and negation 3
4 Propositional logic: material conditional and biconditional 4
5 First-order logic: introduction to quantifiers 5
6 First-order logic: sentences with multiple quantifiers 7
Part B
7 Introduction 8
8 Set theory 8
9 Propositional logic: normal forms 12
10 First-order logic: syntax and semantics 12
11 First-order logic: normal forms 13
Part A
1 Introduction
This syllabus complements the book “Language, Proof and Logic” by Bar-
wise and Etchemendy. It provides some alternative notations, additional
exercises and background information. These are mainly drawn from the
following existing sources:
Special thanks goes out to Vı́ctor Sánchez for providing some translation ex-
ercises, Erik Krabbe for his remarks about an earlier version of this syllabus,
Jan Misker for providing solutions to some of the exercises in this syllabus,
Ayla Kangur and Sybren Jansen for helping in translating the syllabus.
LPL Introduction pp. 1 – 11 The introduction of “Language, Proof and Logic” describes what logic en-
tails, why we study logic, and provides instructions on how to use the book
properly.
2 Atomic sentences
Alternative pp. 23 LPL The book LPL (Language, Proof and Logic) is exceptional in the way that
definition of atomic sentences of propositional logic are defined. In most books the con-
atomic sentences vention is to write atomic sentences of propositional logic with a single up-
percase letter. Instead of writing Taller(claire, max) those books simply
write it as H provided with the translation key:
in which the validity depends on the meaning of connectives like not, and,
or, if ... then and if and only if. Everything else is disregarded. Other
books are therefore not interested in the construction of atomic sentences:
abbreviating them with a single uppercase letter is sufficient.
In first-order logic, arguments of which the validity depends on the mean-
ing of quantifiers, including all and some, is studied as well. In this case the
structure of the atoms is of great importance. In LPL, logic is presented as
a single system in which atomic propositions are decomposed using pred-
icate symbols and constants. For the final exam it is important that you
can distinguish between both logics. You should know that in propositional
logic, atomic sentences are represented by a single uppercase letter and that
in first-order logic, these sentences are further decomposed using predicate
symbols and constants.
For c, d and e suppose that the atomic sentences A and C are logically equiv-
alent, for example A stands for Larger(e,d) and C stands for Smaller(d,e).
c. Specify which rows of the truth table constructed in part a are spurious
rows.
a. P ∨ ¬P without premises
b. ¬(P ∧ Q) from premise ¬P ∨ ¬Q
c. ¬P ∨ ¬Q from premise ¬(P ∧ Q)
d. ¬(P ∨ Q) from premise ¬P ∧ ¬Q
e. ¬P ∧ ¬Q from premise ¬(P ∨ Q)
f. Q from premises P ∨ Q and ¬P
g. ¬¬P from premise P
m. Some open source and closed source computer programs are affordable.
n. No open source computer program is unaffordable.
6
EXERCISE 5.2 Translate the following sentences into first-order logic. Provide as much
structure as possible and give a translation key for each sentence. The
domain of discourse is the set of integers: . . . , −2, −1, 0, 1, 2, . . .
a. 2 is an even number.
b. 2 is greater than 3.
c. If 5 is greater than 4, then 5 is also greater than 3.
d. Every number greater than 4 is also greater than 3.
h. ¬∃x(P (x) ∧ R(x)) from the premises ∀x(P (x) → Q(x)) and
¬∃x(Q(x) ∧ R(x))
EXERCISE 5.4 Prove by natural deduction, if necessary use Fitch:
a. c = i from the premises ∀x(O(b, x) → x = i) and O(b, c).
Part B
7 Introduction
Part B of this syllabus explores some topics which are of special interest for
students Artificial Intelligence, Computing Science and Mathematics. For
example, normal forms are essential for logic programming, and the extra
attention to models of first-order logic is useful for courses such as Advanced
Logic, Artificial Intelligence, Multiagent Systems, Program Correctness and
Discrete Structures.
8 Set theory
Informal pp. 37 – 38 LPL You have encountered many different sets in mathematics classes in high
introduction to school and university, for example N, the set of natural numbers 0, 1, 2, . . .,
sets and Z, the set of integers . . . , −2, −1, 0, 1, 2, . . .. Strangely enough one can-
not precisely define the concept of “set”. However, since the end of the 19th
century Cantor, Zermelo, Fraenkel and other mathematicians have made
axiomatic descriptions of set theory. More on this topic can be found in
Chapter 15.9 of LPL (not part of the course material). We provide a short
but more intuitive introduction to the most common concepts encountered
in set theory, including a number of examples and exercises.
An example of a set is {1, 2, 3}. This set contains the members (or elements)
1, 2 and 3. You write 1 ∈ {1, 2, 3} to denote that 1 is a member of the set
{1, 2, 3} (and similarly for the other members), but 4 6∈ {1, 2, 3}. Sets can
have all sorts of members; for example {Aristoteles, P lato} is the set that
contains exactly two philosophers, namely Aristoteles and Plato, as its mem-
bers. Sets can also contain other sets as their members. For example, the
set {1, {2, 3}} contains two members: 1 ∈ {1, {2, 3}} and {2, 3} ∈ {1, {2, 3}}.
9
EXERCISE 8.1 Which of the following statements are true, which are not? Explain your
answers.
a. 1 ∈ {1}
b. 1 ⊆ {1}
f. ∅ ⊆ {∅}
For the next three exercises (8.2, 8.3 and 8.4), we make use of the following
sets:
A = {a, b, c, 2, 3, 4}
B = {a, b}
C = {c, 2}
D = {b, c}
E = {a, b, {c}}
F = ∅
G = {{a, b}, {c, 2}}
We assume that a, b and c are not natural numbers and that they differ
from one another (so a 6= b, a 6= c and b 6= c).
EXERCISE 8.2 Which of the following statements are true, which are not? Explain your
answers.
a. c ∈ A
b. c ∈ F
c. c ∈ E
d. {c} ⊆ E
e. b ∈ G
f. B ⊆ G
EXERCISE 8.3 Write down the following sets (listing all members):
a. B ∪ C
b. D ∪ F
c. A ∩ B
d. A \ B
e. B \ A
f. G \ B
11
a. Ac
b. (A ∩ C)c
c. ((A \ D) \ C)
d. (A ∩ B) ∪ C
e. ((C ∪ D) ∩ B)c
f. ((A ∪ D) ∪ B) ∩ F
g. ((A \ D) \ C)c
EXERCISE 8.5 Make a graph of the following relations; represent ordered pairs by an arrow
between their members.
a. R1 = {h1, 1i}
b. R2 = {h1, 2i}
g. R7 = ∅
c. ¬((P → Q) ∧ (R → S))
This shows that you can reapply function symbols over and over again
(termed “stacking”). The term father(mother(max)), for example, refers to
the maternal grandfather of Max. But also (x + 5) ∗ (y − 2) is a stacking of
function symbols. This can be easily observed if you use the prefix notation
instead of the infix notation: ∗(+(x, 5), −(y, 2))
Note: predicate symbols cannot be stacked. Big(Dodec(a)) is total non-
sense. If you want to express in first-order logic that a is a big dodecahedron
you will need a conjunction: Big(a) ∧ Dodec(a).
10.2 Semantics
LPL 18.1, 18.2 pp. 511 – 522 This exercise is about the three musketeers. Suppose that we have a struc-
ture M with the domain of discourse D = {Aramis, Athos, Porthos}.
EXERCISE 10.1
We know the following facts about the predicates and constants:
– M(Tall ) = {Porthos},
– M(Rich) = {Aramis},
– M(Fast) = {Aramis, Porthos},
– M(Old ) = {Athos},
– (a)M = Aramis
13
– h(x3 ) = Porthos
Which of the following statements are true, which are not? Explain your
answers for c, f , j and o.
a. M |= Fast(a) [h]
b. M |= Fast(x2 ) [h]
c. M |= Fast(x3 ) [h[x3 /Aramis]]
Explain your answer
d. M |= Fast(x3 ) [h[x3 /Porthos]]
e. M |= Rich(x2 ) [h]
f. M |= Fast(x1 ) ↔ ¬Old (x1 ) [h[x1 /Aramis]]
Explain your answer
g. M |= Fast(x1 ) ↔ ¬Old (x1 ) [h[x1 /Athos]]
– P (c), and
– ∃xP (x) → P (c) (this formula does not conform to the form quantifier
+ quantifier-free formula, because ∃x only applies to P (x)).
Equivalences for LPL p. 285 In addition to the equivalences provided on page 285, there are some other
prenex normal equivalences that you can use to convert formulas to prenex normal form.
form They are all listed below. See also LPL 10.3 and 10.4 (pp. 277–285).
To create an alphabetical variant.
Note: y is free in P (y) exactly where x is free in P (x).
The equivalences i and j are convenient because they provide more effi-
ciency. Besides, i follows from e and k, and j follows from f and l.
To push quantifiers to the front in formulas containing →:
Here follows an example how to put a formula in prenex normal form using
the above-mentioned equivalences. Suppose we start with the following
formula:
¬∃xP (x) ∨ ∀xQ(x).
We first push the negation sign past the quantifier, by rule d. This leads to
∀x¬P (x) ∨ ∀xQ(x).
We canno push all the quantifiers to the front by using rules e–l at this mo-
ment: we first have to make sure that both disjuncts have different quanti-
fiers as main connective. Using rule a we can create an alphabetical variant
∀x¬P (x) ∨ ∀yQ(y).
By rule g we get
∀x(¬P (x) ∨ ∀yQ(y)),
Note that we are using square brackets here. Square brackets are interpreted
in the same way as normal parentheses, but in some situations provide more
clarity.
EXERCISE 11.1 Put the following formulas into prenex normal form:
a. ∀xA(x) ∧ B(c)
b. B ∨ ¬∃xA(x)
c. ∀xA(x) → B(x)
d. ∀xA(x, y) → ∃xA(x, y)
– The formula ∃zP (z) has as its Skolem normal form the formula P (d);
in this case the constant d can be viewed as a nullary Skolem function.
EXERCISE 11.2 Skolemize the following formulas. If necessary, put them in prenex normal
form first.
a. ∀x∃y∀zP (x, y, z)
b. ∀x∃y∀z∃uQ(x, y, z, u)
c. ∀x∀y(A(x, y) → ∃z(B(z) ∧ ∃uC(z, y, u)))
– ∀x(¬R(x) ∨ T (x))
– ∀xR(x)
– ∀x((¬A(x) ∨ B(f (x))) ∧ (¬B(f (x)) ∨ ¬C(x) ∨ A(x))).
∃x∃y∀z(¬R(x, y) ∨ A(z)).
This formula is now in prenex normal form. The next step is to Skolemize
this formula to create a (non-equivalent) Skolem normal form:
∀z(¬R(c, d) ∨ A(z)).
This sentence is already in Horn form, because the quantifier-free part is
a conjunction of a single disjunction, which indeed contains at most one
positive disjunct, namely A(z).
EXERCISE 11.3 Put the following formulas in Horn form; if necessary use Skolem normal
forms:
3. Student(max)
1. Student(max) ∧ ¬P et(max)
5. Student(max) ↔ ¬Student(claire)
a. Translation key:
Even(x) = x is an even number
two = the number 2
Translation: Even(two)
19
b. Translation key:
Greater(x, y) = x is greater than y
two = the number 2
three = the number 3
f. Translation key:
Greater(x, y) = x is greater than y
a. {a, b, c, 2}
b. {b, c}
c. {a, b}
d. {c, 2, 3, 4}
e. ∅
f. {{a, b}, {c, 2}}
∀x(Cube(x) → Large(x)),
∃x¬Large(x)
a. P ∧ (Q ∨ R) from premise (P ∧ Q) ∨ (P ∧ R)
b. (P ∧ Q) ∨ (P ∧ R) from premise P ∧ (Q ∨ R)
c. P ∨ (Q ∧ R) from premise (P ∨ Q) ∧ (P ∨ R)
d. (P ∨ Q) ∧ (P ∨ R) from premise P ∨ (Q ∧ R)
a. 1. P ∧ Q
2. P ∧ Elim: 1
3. P ∨ Q ∨ Intro: 2
b. 1. (a = b) ∧ (b = c)
2. a = b ∧ Elim: 1
3. b = c ∧ Elim: 1
4. a = c = Elim: 2,3
c. 1. (A ∧ B) ∨ C
2. A ∧ B
3. B ∧ Elim: 2
4. C ∨ B ∨ Intro: 3
5. C
6. C ∨ B ∨ Intro: 5
7. C ∨ B ∨ Elim: 1, 2–4, 5–6
d. 1. A
2. B ∨ C
3. B
4. A ∧ B ∧ Intro: 1, 3
5. (A ∧ B) ∨ (A ∧ C) ∨ Intro: 4
6. C
7. A ∧ C ∧ Intro: 1, 6
8. (A ∧ B) ∨ (A ∧ C) ∨ Intro: 7
9. (A ∧ B) ∨ (A ∧ C) ∨ Elim: 2, 3–5, 6–8
22
Add. exercise 2
a.
1. A
2. B
3. A Reit: 1
4. B → A → Intro: 2–3
5. A → (B → A) → Intro: 1–4
b.
1. A → (B → C)
2. A ∧ B
3. A ∧ Elim: 2
4. B → C → Elim: 1, 3
5. B ∧ Elim: 2
6. C → Elim: 4, 5
7. (A ∧ B) → C → Intro: 2–6
8. (A ∧ B) → C
9. A
10. B
11. A ∧ B ∧ Intro: 9, 10
12. C → Elim: 8, 11
13. B → C → Intro: 10–12
14. A → (B → C) → Intro: 9–13
15. (A → (B → C)) ↔ ((A ∧ B) → C) ↔ Intro: 1–7, 8–14
c. 1. A ∨ (B ∧ C)
2. ¬E
3. (A ∨ B) → (D ∨ E)
4. ¬A
5. A
6. ⊥ ⊥ Intro: 4,5
7. C ∧ D ⊥ Elim: 6
8. B ∧ C
9. B ∧ Elim: 8
10. C ∧ Elim: 8
11. A ∨ B ∨ Intro: 9
12. D ∨ E → Elim: 3, 11
13. D
14. D Reit: 13
15. E
16. ⊥ ⊥ Intro: 2, 15
17. D ⊥ Elim: 16
18. D ∨ Elim: 12, 13–14, 15–17
19. C ∧ D ∧ Intro: 10, 18
20. C ∧ D ∨ Elim: 1, 5–7, 8–19
23
Add. exercise 3
1. P → Q
2. ¬(¬P ∨ Q)
3. P
4. Q → Elim: 1, 3
5. ¬P ∨ Q ∨ Intro: 4
6. ⊥ ⊥ Intro: 2, 5
7. ¬P ¬ Intro: 3–6
8. ¬P ∨ Q ∨ Intro: 7
9. ⊥ ⊥ Intro: 2, 8
10. ¬¬(¬P ∨ Q) ¬ Intro: 2–9
11. ¬P ∨ Q ¬ Elim: 10
12. ¬P ∨ Q
13. P
14. ¬P
15. ⊥ ⊥ Intro: 13,14
16. Q ⊥ Elim: 15
17. Q
18. Q Reit: 17
19. Q ∨ Elim: 12, 14–16, 17–18
20. P → Q → Intro: 13–19
21. (P → Q) ↔ (¬P ∨ Q) ↔ Intro: 1–11, 12–20
a. 1. ∀yP(y)
2. a
3. P(a) ∀ Elim: 1
4. ∀xP(x) ∀ Intro: 2–3
24
b. 1. ∃yP(y)
2. a P(a)
3. ∃xP(x) ∃ Intro: 2
4. ∃xP(x) ∃ Elim: 1, 2–3
Add. exercise 6
a. 1. ∃x¬P(x)
2. a ¬P(a)
3. ∀xP(x)
4. P(a) ∀ Elim: 3
5. ⊥ ⊥ Intro: 2, 4
6. ¬∀xP(x) ¬ Intro: 3–5
7. ¬∀xP(x) ∃ Elim: 1, 2–6
b. 1. ∀x¬P(x)
2. ∃xP(x)
3. a P(a)
4. ¬P(a) ∀ Elim: 1
5. ⊥ ⊥ Intro: 3, 4
6. ⊥ ∃ Elim: 2, 3–5
7. ¬∃xP(x) ¬ Intro: 2–6
c. 1. ¬∃xP(x)
2. a
3. P(a)
4. ∃xP(x) ∃ Intro: 3
5. ⊥ ⊥ Intro: 1, 4
6. ¬P(a) ¬ Intro: 3–5
7. ∀x¬P(x) ∀ Intro: 2–6
Add. exercise 7
a. 1. ∀x∀yLikes(x, y)
2. a
3. ∀yLikes(a, y) ∀ Elim: 1
4. Likes(a, b) ∀ Elim: 3
5. ∃yLikes(a, y) ∃ Intro: 4
6. ∀x∃yLikes(x, y) ∀ Intro: 2–5
25
b. 1. ∀x(Small(x) → Cube(x))
2. ∃x¬Cube(x) → ∃xSmall(x)
3. ¬∃xCube(x)
4. ¬Cube(a)
5. ∃x¬Cube(x) ∃ Intro: 4
6. ∃xSmall(x) → Elim: 2, 5
7. b Small(b)
8. Small(b) → Cube(b) ∀ Elim: 1
9. Cube(b) → Elim: 8
10. ∃xCube(x) ∃ Intro: 9
11. ⊥ ⊥ Intro: 3, 10
12. ⊥ ∃ Elim: 6, 7–11
13. ¬¬Cube(a) ¬ Intro: 4–12
14. Cube(a) ¬ Elim: 13
15. ∃xCube(x) ∃ Intro: 14
16. ⊥ ⊥ Intro: 3, 15
17. ¬¬∃xCube(x) ¬ Intro: 3–16
18. ∃xCube(x) ¬ Elim: 17
c. 1. Likes(carl, max)
2. ∀x[∃y(Likes(y, x) ∨ Likes(x, y)) → Likes(x, x)]
3. Likes(max, carl) ∨ Likes(carl, max) ∨ Intro: 1
4. ∃y(Likes(y, carl) ∨ Likes(carl, y)) ∃ Intro: 3
5. ∃y(Likes(y, carl) ∨ Likes(carl, y)) → Likes(carl, carl) ∀ Elim: 2
6. Likes(carl, carl) → Elim: 4, 5
7. ∃xLikes(x, carl) ∃ Intro: 6
4. b ∀yLikes(b, y)
5. Likes(b, a) ∀ Elim: 4
6. ∀yLikes(b, y) → Likes(y, b) ∀ Elim: 1
7. Likes(b, a) → Likes(a, b) ∀ Elim: 6
8. Likes(a, b) → Elim: 5, 7
9. ∃yLikes(a, y) ∃ Intro: 8
10. ∃yLikes(a, y) ∃ Elim: 2, 4–9
11. ∀x∃yLikes(x, y) ∀ Intro: 3–10
26
Add. exercise 8
a. 1. (P ∧ Q) ∨ (P ∧ R)
2. P ∧ Q
3. P ∧ Elim: 2
4. Q ∧ Elim: 2
5. Q∨R ∨ Intro: 4
6. P ∧ (Q ∨ R) ∧ Intro: 3, 5
7. P ∧ R
8. P ∧ Elim: 7
9. R ∧ Elim: 7
10. Q ∨ R ∨ Intro: 9
11. P ∧ (Q ∨ R) ∧ Intro: 8, 10
12. P ∧ (Q ∨ R) ∨ Elim: 1, 2–6, 7–11
b. 1. P ∧ (Q ∨ R)
2. P ∧ Elim: 1
3. Q ∨ R ∧ Elim: 1
4. Q
5. P ∧ Q ∧ Intro: 2, 4
6. (P ∧ Q) ∨ (P ∧ R) ∨ Intro: 5
7. R
8. P ∧ R ∧ Intro: 2, 7
9. (P ∧ Q) ∨ (P ∧ R) ∨ Intro: 8
10. (P ∧ Q) ∨ (P ∧ R) ∨ Elim: 3, 4–6, 7–9
c. 1. (P ∨ Q) ∧ (P ∨ R)
2. P ∨ Q ∧ Elim: 1
3. P ∨ R ∧ Elim: 1
4. P
5. P ∨ (Q ∧ R) ∨ Intro: 4
6. Q
7. P
8. P ∨ (Q ∧ R) ∨ Intro: 7
9. R
10. Q ∧ R ∧ Intro: 6, 9
11. P ∨ (Q ∧ R) ∨ Intro: 10
12. P ∨ (Q ∧ R) ∨ Elim: 3, 7–8, 9–11
13. P ∨ (Q ∧ R) ∨ Elim: 2, 4–5, 6–12
27
d. 1. P ∨ (Q ∧ R)
2. P
3. P ∨ Q ∨ Intro: 2
4. P ∨ R ∨ Intro: 2
5. (P ∨ Q) ∧ (P ∨ R) ∧ Intro: 3, 4
6. Q ∧ R
7. Q ∧ Elim: 6
8. R ∧ Elim: 6
9. P ∨ Q ∨ Intro: 7
10. P ∨ R ∨ Intro: 8
11. (P ∨ Q) ∧ (P ∨ R) ∧ Intro: 9, 10
12. (P ∨ Q) ∧ (P ∨ R) ∨ Elim: 1, 2–5, 6–11