Predicate Logic
Predicate Logic
M.A.Gal
an, TDBA64, VT-03
1
Introduction
There are certain arguments that seem to be perfectly logical,
yet they cannot be specified by using propositional logic.
M.A.Gal
an, TDBA64, VT-03
2
Introduction
Generally, predicates are used to describe certain properties or
relationships between individuals or objects.
In addition to predicates one uses terms and quantifiers.
Syntax: Symbols.
constants: a, b, c, . . .
variables: x, y, z, . . .
function symbols: f, g, h, . . .
predicate symbols: p, q, r, . . .
logical connectives: , , ,
quantifiers: (for all), (there exists)
parenthesis and comas
M.A.Gal
an, TDBA64, VT-03
4
Predicates
Generally, predicates make statements about individuals. In predicate calculus, each predicate is given a name, which is followed
by the list of arguments. The list of arguments is enclosed in
parentheses.
To express Jane is the mother of Mary, one would choose an
identifier, say mother, to express the predicate is mother of
and one would write mother(J ane, M ary)
Note that the order of the arguments is important.
The number of elements in the predicate list is called the arity
of the predicate. The arity of a predicate is fixed.
M.A.Gal
an, TDBA64, VT-03
5
Predicates
A predicate name, followed by an argument list in parentheses,
is called an atomic formula.
The atomic formulas are statements, and they can be combined
by logical connectives.
For instance, to express the fact that Jane is the mother of Mary,
one can use the atomic formula mother(J ane, M ary), and this
statement can be part of some compound statement, such as
M.A.Gal
an, TDBA64, VT-03
6
Variables
Often, one does not want to associate the arguments of an
atomic formula with a particular individual. To avoid this, variables are used.
cat(x) hastail(x)
Syntactically, one can use variables in any place where one is
allowed to use constants. The word term is used to refer to
anything that can be used in place of an individual.
M.A.Gal
an, TDBA64, VT-03
7
M.A.Gal
an, TDBA64, VT-03
8
M.A.Gal
an, TDBA64, VT-03
9
Quantifiers
All cats have tails
Some people like going to the cinema
These statements indicate how frequently certain things are true.
In predicate calculus, one uses quantifiers in this context.
The universal quantifier indicates that something is true for all
individuals.
The existential quantifier indicates that a statement is true for
some individuals.
M.A.Gal
an, TDBA64, VT-03
10
Universal quantifier
Let P be an expression, and let x represent a variable.
If we want to indicate that P is true for all possible values of x,
we write x P.
Here x is called the universal quantifier and P the scope of the
quantifier. The variable x is said to be bound by the quantifier.
The symbol is pronounced for all
Example: Everyone gets a break once in a while
x getsbreak(x)
M.A.Gal
an, TDBA64, VT-03
11
Existential quantifier
Let P be an expression, and let x represent a variable. If we
want to indicate that P is true for at least one value of x, we
write x P. This statement is pronounced there exists an x such
that P.
Here x is called the existential quantifier, and P is called the
scope of the existential quantifier. The variable x is said to be
bound by the quantifier.
Example: Some objects are blue
x blue(x)
M.A.Gal
an, TDBA64, VT-03
12
Free variables
Any variable that is not bound is said to be free.
In the formula,
M.A.Gal
an, TDBA64, VT-03
13
Precedence rules
Same rules as in propositional logic but the quantifiers are given
a higher precedence than all the rest of the connectives.
Consider the predicates p(x) =x is living and q(x) =x is
dead, then
M.A.Gal
an, TDBA64, VT-03
14
Semantic
1.
2.
3.
4.
There are many people named Jane and Paul, and without further information the statement Jane is Pauls mother can refer
to many different people.
To remove such ambiguities, we introduce the concept of domain
(collection of all individuals that affect the logical argument under consideration)
M.A.Gal
an, TDBA64, VT-03
15
Semantic: Interpretation
An interpretation t is a mapping that
Interpretation
The interpretation of a formula is defined inductively by:
t(f (s1, . . . , sn)) = ft(t(s1), . . . , t(sn)) for the term f (s1, . . . , sn).
t(p(s1, . . . , sn)) = pt(t(s1), . . . , t(sn)) for all atomic formula
p(s1, . . . , sn).
t(P Q)
t(P Q)
For all formula P, Q
t()P
t(P Q)
=
=
=
=
t(P )t(Q)
t(P )t(Q)
t(P )
t(P )t(Q)
M.A.Gal
an, TDBA64, VT-03
17
Interpretation
For all formula P
t(x P ) = T if tx=d(P ) = T for all d D (otherwise is F )
M.A.Gal
an, TDBA64, VT-03
18
G
odels Theorems
G
odels completeness theorem
There exists a sound and complete proof system for predicate
logic.
G
odels incompleteness theorem
For number theory (N, >, +, , 0, 1) is not possible to find a sound
proof system that is complete.
M.A.Gal
an, TDBA64, VT-03
19
Examples
Domain= {animals} How can we express All dog are mammals?
One rephrases the statement as If x is a dog, then x is a
mammal.
x (dog(x) mammal(x))
Generally, the sentence x (P (x) Q(x)) can be translated as
All individuals with property P also have property Q
M.A.Gal
an, TDBA64, VT-03
20
Examples
How can we express Some dogs are brown?
This statement means that there are some animals that are dogs
and that are brown. The statement x is a dog and x is brown
can be translated as
dog(x) brown(x)
There are some brown dogs can now be translated as
x (dog(x) brown(x))
In general, the statement x (P (x) Q(x)) can be interpreted
as Some individuals with property P also have property Q.
M.A.Gal
an, TDBA64, VT-03
21
Examples
Only dogs bark
To convert this into predicate calculus, this must be reworded
as It barks only if it is a dog or, equivalently, If it barks, then
it is a dog. One has therefore
x (barks(x) dog(x))
M.A.Gal
an, TDBA64, VT-03
22