04 Handout Predicate Logic
04 Handout Predicate Logic
Michael Franke
1 Motivation
Alex is as tall as Bo
Bo is as tall as Alex
in virtue of our knowledge of what the predicate “being as tall as” means.
Propositional logic cannot capture this. It can model the first sentences as p
(= “Alex is as tall as Bo”) and the second as q (= “Bo is as tall as Alex”), but
since we cannot look inside the structure of a simple proposition, there is no
way in which we can say that p, based on its internal form and relatedness to
the internal form of q, must necessarily entail q.1 1 We can, of course, make the additional
Predicate logic (PredLog) is an extension of PropLog which adds two premise by writing down that p → q, but
that clearly does not explain the general
things. Firstly, PredLog models the internal structure of atomic proposi- relationship.
tions in terms of predicates and individual constants. For example, we could
have a (two-place) predicate T meaning (“being as tall as”) and two sym-
bols, so-called individual constants, a and b which represent Alex and Bo
respectively. We can then translate the sentence “Alex is as tall as Bo” into
the formula T ab, which is a minimal truth-evaluable unit, but does have inter-
nal structure. Similarly, the sentence “Bo is as tall as Alex” would translate
into T ba.
Secondly, PredLog allows to express quantification, which is extremely
important in order to represent general rules, generalizations and key aspects
of our semantic and world knowledge.2 Imagine that you have a reasoning 2 Semantic knowledge is what we know
machine (computer, robot, friend . . . ) able to compute logical inferences about the meaning of words and expressions.
For example, semantic knowledge tells
in predicate logic. Even though we have not introduced any of the formal us that “being taller than” is a transitive
machinery (syntax, semantics, definition of validity, deduction system) nec- relation, and that “being as tall as” is an
equivalence relation. World knowledge is
essary to make such formal reasoning precise, imagine you give this machine what we know about the world. For exam-
ple, we know that Berlin is the capital of
Germany.
predicate logic 2
the information T ab. You want it to represent “Alex is as tall as Bo,” but the
machine only has the string of symbols to work with. Would that machine be
able to conclude that T ba? No, it wouldn’t because it doesn’t know that you
want the symbol T to mean “being as tall as” and not “being taller than” or
anything else. But, using predicate logic, you can tell the system about the
fundamental structural properties of the relation “being as tall as,” such as
that it is symmetric. Concretely, you can express that “being as tall as” is a
symmetric predicate with the PredLog formula:
∀x ∀y (T xy → T yx)
T ab, ∀x ∀y (T xy → T yx) / T ba
T ab/T ba
is not.
• sentential connectives ¬, ∧, ∨, →
• predicate letters A, B, C, D . . .
,↔
• variables w, x, y, z • quantifiers ∃, ∀
letter has a unique arity. The arity of a predicate letter is always an integer
bigger than zero. It gives the number of elements that the predicate letter
expects as an argument. A predicate letter with arity one is also called unary
predicate letter and will be interpreted to refer to a property. For example,
if B is a unary predicate letter denoting the property “x is a book”, then the
expression Bm can be interpreted as expressing that Moby Dick is a book.
A predicate letter with arity bigger than one will be interpreted to denote a
relation. For example, if the predicate letter L has arity two, it may stand for
a two-place relations such as “x loves y”. Consequently, we expect L to have
two arguments, so that Lab, Lam or Lmb would be well-formed expressions
(no matter whether true or meaningful), while Labm, Laaaa or Lb would not
be.
Variables are denoted by lower-case Roman letters (w, x, y, z), starting
from w. Variables are only interpretable in the scope of a quantifier, an impor-
tant technical concept we will introduce later. As a first intuitive guide, think
of variables as similar to pronouns4 which are used to refer to an unnamed 4 A proper logical treatment of pronouns
individual introduced by a quantifying expression like in these examples: in natural language requires more sophisti-
cated logical systems, like dynamic logics or
discourse representation theory.
For every boy it holds that he . . . [he = some boy]
There is a boy for which it holds that he . . . [he = some boy]
To build formulas, PredLog also uses parentheses and exactly the same
sentential connectives as PropLog does.
Quantifiers are special functional elements of the language of PredLog.
The quantifier ∃ is the existential quantifier. It is read as “there is” or “there
exists.” For example, the formula ∃x(Bx ∧ I x) would be read as “there is an
x such that x has property B and I.” It would mean that there is an individual
which has the property denoted by B (e.g., it is a book) and the property
denoted by I (e.g., it is interesting). In short, this formula would express
that there is at least one interesting book. The quantifier ∀ is the universal
quantifier. It is read as “for all,” “all” or “every.” For example, the formula
∀x(Bx → I x) would be read as “for all x it holds that if x has property B, then
it also has property I.” This would express that all books are interesting.
2.2 Formulas
The language L of PredLog is the set of all formulas which are recursively
defined as follows:
(iii) If ϕ and ψ are formulas, so are:5 5 We allow ourselves to omit the outer-
most pair of parentheses as in PropLog.
predicate logic 4
a. (ϕ ∧ ψ) b. (ϕ ∨ ψ) c. (ϕ → ψ) d. (ϕ ↔ ψ)
(iv) If ϕ is a formula and if x is a variable, then these are formulas:
a. ∀x ϕ [universal statement] b. ∃x ϕ [existential statement]
(v) Anything that cannot be constructed by (i)–(iv) is not a formula.
Here are examples of formulas of PredLog, together with intuitive para-
phrases based on the interpretation that a is Alex, b is Bo, m is the book
Moby Dick, Lxy means “x likes y,” Bx means “x is a book” and Oxy means
that “x owns y.”
Lam Alex likes Moby Dick.
Lab ∧ Lba Alex likes Bo and Bo likes Alex.
¬Oba Bo does not own Alex.
∃x(Bx ∧ Oax) Alex owns a book.
∀x ((Bx ∧ Obx) → Lax) Alex likes every book Bo owns.
¬∃x (Bx ∧ Oax) Alex does not own any books.
∀x (Bx → ¬Oax) Alex does not own any books.
Bx ∧ Oax ∃x Bx
predicate logic 5
2.4 Terminology
4 Domain of quantification
Just like PropLog, PredLog is useful for uncovering the logical structure of
sentences. Unlike PropLog, PredLog can lay bare the internal structure of
atomic propositions and aspects of quantification.
Suppose we want to translate this sentence to predicate logic:
Alex likes Bo but if Bo likes Alex, Bo likes everybody.
A formula that captures the logical structure of this sentence is:
and also include the predicate letter H in the translation key like so:
(iv) Hx: x is a human being
Let us consider a few examples. The domain of quantification D is the set
of all human beings.
predicate logic 7
b: Bo Px: x is a pilot
Here is a list with sentences and potential translations into PredLog.9 9 For some sentences, more than one
translation is given. These alternatives are
Alex is a pilot. Pa logically equivalent under the semantics of
PredLog which we will introduce later.
Bo is a friendly pilot. Fb ∧ Pb
No pilot is friendly. ∀x (Px → ¬F x)
¬∃x (Px ∧ F x)
Nobody likes pilots. ¬∃x ∃y (Py ∧ Lxy)
Bo has a friendly sibling. ∃x (F x ∧ S bx)
Every pilot has a friendly sibling. ∀x (Px → (∃y (Fy ∧ S xy)))
∀x ∃y (Px → (Fy ∧ S xy))
¬∃x (Px ∧ ¬∃y (Fy ∧ S xy))
¬∃x ¬∃y (Px → (Fy ∧ S xy))
predicate logic 8
Exercise 1. For each of the following strings, determine whether they are
formulas of PredLog or not. Assume that P and Q are unary predicate let-
ters, and that R is a binary predicate letter.
(i) Px (iv) ∃x Px ∧ Lx j
The domain D is a set of entities.10 The interpretation function I maps each 10 We will always assume that the domain
element of C (the set of constants of language L) and P (the set of all predi- has at least one element.
if P is an n-ary predicate letter, then I(P) ⊆ Dn .11 11 Dn is the set of all n-tuples with
elements from D.
The interpretation I(c) of a constant c is the entity in the domain that c stands
for (e.g., its name or identifier). The interpretation I(P) of an n-ary predicate
letter, is the set of all n-tuples which stand in the relation P to each other. For
example, if R is the one-place predicate letter denoting the property “red,”
then I(R) is the set of all red things (in the possible world we are modeling
with the help of I). Or, if L is the two-place predicate letter denoting the rela-
tion “x likes y,” then I(L) is the set of all pairs of elements from the domain,
e.g., hd1 , d2 i, such that the first likes the second (in the possible world we are
modeling with the help of I).
If t is a term of L, then [[t]] M,g is the term interpretation relative to M = extended to cover more than one variable,
like so: g[x/d1 ,y/d2 ,z/d3 ] .
hD, Ii and g:
7 Truth in a model
Assignment functions are just auxiliary constructs. At the end of the day, we
are interested in whether a formula is true in a possible world, i.e., a model
M = hD, Ii, no matter what assignment function is used.
If V M,g (ϕ) = 1 for all g, we write V M (ϕ) = 1 and say “ϕ is true in M.” If
V M,g (ϕ) = 0 for all g, we write V M (ϕ) = 0 and say “ϕ is false in M.”
Notice that any sentence of PredLog (i.e., any formula without free vari-
ables) is either true or false in any given model M. In other words, formulas
without free occurrences of variables are interpretable just with respect to a
model, and these formulas are —usually— what we care about.
Let’s consider a simple example of a model and the way it makes certain
sentences true or false. The language we are interested in has just one indi-
vidual constant a, two one-place predicate letters, P and Q, as well as one
two-place predicate letter R. An example model M = hD, Ii for this language,
fixing a domain and an interpretation of all basic vocabulary, can be written
out like this:
D = {1, 2, 3, 4, 5}
I(a) = 3
I(P) = {1, 2, 5}
I(Q) = {2, 5}
I(R) = {h1, 2i , h2, 2i , h1, 4i , h1, 5i}
For better visual grasp, small models can often be represented economi-
cally as a graph. Figure 1 is an example for the model at hand. The two-place
relation is represented in terms of arrows, small letters ornamenting the el-
ements of the domain show the interpretation of individual constants and
one-place predicate letters.
with reference to the model’s mathematical structure and the definition of the
semantics of PredLog, we would say that V M (∃x (Px ∧ Qx)) = 1 because,
no matter which g we use, there exists an element in D, namely 2, such that
V M,g[x/2] (Px ∧ Qx) = 1. This is because 2 ∈ I(P) and 2 ∈ I(Q).
Take another example. What is the truth value that the model assigns to
formula Pa? Well, that formula is false in the given model. The individual
referred to by constant a is 3, but 3 does not have property P. In formal
terms, we would then say that V M (Pa) = 0, because, for any valuation
function g, since I(a) = 3 and 3 < I(P), we have V M,g (P(a)) = 0.
8 Validity
Claim 3. ¬∀x (Px → F x) |= ∃x Px15 15 Intuitively, if it is not the case that every
pilot is friendly, there has to be at least one
Proof. Assume that the premise ¬∀x (Px → F x) is true in a model M = pilot.
hD, Ii. From V M (¬∀x (Px → F x)) = 1 we know that V M (∀x (Px → F x)) = 0.
But if ∀x (Px → F x) is false in M, it follows that there is at least one element
d ∈ D such that V M,g[x/d] (Px → F x) = 0, for arbitrary g. We know that
an implication is only false if the antecedent is true and the consequent is
false (from propositional logic, definition of →). That means that it must
be the case that V M,g[x/d] (Px) = 1. This entails that V M,g (∃x Px) = 1, by
definition of truth of existential statements. But since g was completely
arbitrary and nothing hinges on any specifics of g, we have actually shown
that V M (∃x Px) = 1.
Proof. Let M be a model in which ¬∃x ¬Px is true. This means that there is
not a single element d ∈ D, such that d < I(P). In other words, I(P) = D,
i.e., all elements in the domain have property P. So M also makes ∀x Px
true. The reverse direction has already been shown when proving ∀x Px |=
¬∃x ¬Px.
predicate logic 14
Exercise 4. Use the model from the example in Figure 1 to check the truth
value of the following formulas.
D = {1, 2, 3, 4, 5}
I(P) = {1, 2, 5}
I(Q) = {2, 5}
I(R) = {h1, 2i , h2, 2i , h1, 4i , h1, 5i}
Evaluate for each of the following formulas whether they are true or false in
the model. (Hint: It is highly recommended that you draw a graphical repre-
sentation for yourself similar to Figure 1, even if that is not required to obtain
points and/or a correct solution.)
We can write Pa (with the obvious translation key), expressing that Alex is
a pilot. But we also want to express that nobody else is. We can express that
nobody is a pilot with a formula like ∀x ¬Px or, equivalently (see Claim 4),
¬∃ Px. But that’s not actually true because Alex is. So writing Pa ∧ ∀x ¬Px
is a contradiction that does not express the meaning of “Only Alex is a pilot.”
Indeed, PredLog as we defined it so far is not expressive enough to capture
the meaning of this sentence. We need to add something. We will add a
special predicate: identity.
These are special symbols also in the semantics, because they are inter-
preted in the same manner in every model.16 Concretely, we just add the 16 Identity is the same concept in all pos-
following clause to the definition of the semantics of predicate logic:17 sible worlds. It is a logical concept that has
a fixed meaning in all (logically) possible
V M,g (t1 = t1 ) = 1 iff [[t1 ]] = [[t2 ]] worlds.
17 Notice that there are three occurrences
V M,g (t1 , t1 ) = 1 iff [[t1 ]] , [[t2 ]] of the symbol “=” in the first line of this
definition. The first occurrence refers to the
two-place predicate letter of PredLog with
10.2 Translations with PredLog with identity identity. The latter two refer to our usual
understanding of “=” as identity. Basically,
Using identity in the logical language, we can express the meaning of this is a complicated way of saying that “=”
is supposed to mean the same same thing in
Only Alex is a pilot. PredLog as what it means outside of it.
Pa ∧ ∀x (x , a → ¬Px)
which can be read as: “Alex is a pilot, and everybody who is not Alex is not a
pilot.”18 18 This is not the only paraphrase and
Here are further examples for translations, making use of identity:19 formula we can give to this example. See
the first example in the list that follows, for
instance.
(i) Alex is friendly but nobody else is. Fa ∧ ∀x (F x → x = a) 19 Translation key as before.
(ii) At least two people are friendly. ∃x∃y (F x ∧ Fy ∧ x , y)20 20 We omit parentheses here, even though
they would be strictly speaking required
by the definition of a formula. Instead of
writing ϕ ∧ (ψ ∧ χ) or (ϕ ∧ ψ) ∧ χ, given that
these two formulas are logically equivalent
(in PropLog and in PredLog), we simply
write ϕ ∧ ψ ∧ χ.
predicate logic 16
(iii) Alex likes only pilots, except for Bo. ∀x (Lax → (Px ∨ x = b))
at least one ∃x Px
at least two ∃x ∃y (Px ∧ Py ∧ x , y)
exactly one ∃x (Px ∧ ∀y (Py → x = y))
exactly two ∃x ∃y (x , y ∧ Px ∧ Py ∧ ∀z (Pz → (z = x ∨ z = y)))
at most one ∀x ∀y ((Px ∧ Py) → x = y)
at most two ∀x ∀y ((Px ∧ Py ∧ x , y) → ∀z (Pz → (z = x ∨ z = y)))
Exercise 7. Translate the following sentences into predicate logic with iden-
tity.