0% found this document useful (0 votes)
15 views62 pages

06 Predicate Logic

The document covers various aspects of predicate logic, including universal and existential quantification, satisfaction and validity, and the roles of free and bound variables. It explains the syntax of first-order logic (FOL), predicates, and methods of reasoning such as equational reasoning and natural deduction. Additionally, it discusses concepts like substitution, restriction, uniqueness, and negation of quantifiers, providing examples and exercises throughout.

Uploaded by

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

06 Predicate Logic

The document covers various aspects of predicate logic, including universal and existential quantification, satisfaction and validity, and the roles of free and bound variables. It explains the syntax of first-order logic (FOL), predicates, and methods of reasoning such as equational reasoning and natural deduction. Additionally, it discusses concepts like substitution, restriction, uniqueness, and negation of quantifiers, providing examples and exercises throughout.

Uploaded by

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

Predicate Logic

Topics
• Universal quantification
• Existential quantification
• Satisfaction and validity
• The negation of quantifiers
• Free and bound variables
• Substitution
• Restriction
• Uniqueness
• Equational reasoning
• Natural deduction
• One point rule
Page 2
Syntax of FOL: Basic
elements
• Constants KingJohn, 2,…
• Functions Sqrt, Likes...
• Variables x, y, a, b,...
• Connectives ¬, ⇒, ∧, ∨, ⇔
• Equality =
• Quantifiers ∀, ∃
Predicates
• A predicate is a proposition whose truth
depends on the value of one or more
variables.
• For example, “n is a perfect square” is a
predicate whose truth depends on the
value of n.
• A function like notation is used to
denote a predicate supplied with
specific variable values. P(n)=“n is a
perfect square”
• P(4) is true and P(5) is false.

Page 4
Universal Quantification
• Universal Quantification denoted as
• Universal Quantification allows us to capture
statements of the form “for all” or “for every”.
• For example, “every natural number is
greater than or equal to zero” can be written
formally as

Page 5
Universal Quantification
• A quantified statement consists of three
parts: the quantifier, the quantification,
and the predicate
• Every predicate logic statement can be
considered as follows

Page 6
Universal Quantification

Page 7
Exercise
• Everybody likes Jaffa cakes
• All vegetarians don’t like Jaffa
cakes
• Everybody either likes Jaffa cakes
or is a vegetarian
• Either every body likes Jaffa cakes
or everybody is a vegetarian

Page 8
Solution

Page 9
Universal Quantification
• Law 1

• Example

Page 10
Universal Quantification
• Law 2

• Example

Page 11
Existential quantification
• Existential quantifier denoted by
• Existential quantification is used to
assert that a property holds of some
(or at least one) elements of a set
• “Some natural numbers are divisible
by 3” may be written as

Page 12
Exercise
• Some people like Jaffa cakes
• Some vegetarians don’t like Jaffa
cakes
• Some people either like Jaffa cakes
or are vegetarian
• Either some people like Jaffa cakes
or some people are vegetarian

Page 13
Solution

Page 14
Existential quantification
• Law 3

• Example

Page 15
Existential quantification
• Law 4

• Example

Page 16
Satisfaction and validity
• The predicate n>3 can be considered neither
true nor false unless we know the value
associated with n

• A predicate p is valid if and only if it is true


for all possible values of the appropriate
type. That is, if a predicate p is associated
with a variable x of type X, then p is valid if,
and only if,

• Example
Page 17
Satisfaction and validity
• A predicate p is satisfiable if and only if
it is true for some values of the
appropriate type. That is, if a predicate
p is associated with a variable x of type
X, then p is satisfiable if, and only if ,

• Example

Page 18
Satisfaction and validity
• A predicate p is unsatisfiable if, and only
if, it is false for all possible values of the
appropriate type.

• If a predicate p is associated with a


variable x of type X, then p is
unsatisfiable if, and only if,

Page 19
Satisfaction and validity
• Valid predicates and tautologies are
always true
• Satisfiable predicates and contingencies
are sometimes true and sometimes
false
• Unsatisfiable predicates and
contradictions are never true

Page 20
Exercise
• Everyone likes everyone
• Everyone likes someone
• Someone likes everyone
• Someone likes someone

Page 21
The negation of quantifiers
• The statement “some body like Brian”
may be expressed via predicate logic
as

• To negate this expression, we may


write as,

• which in natural language may be


expressed as “nobody likes Brian”
Page 22
The negation of quantifiers
• Logically saying “nobody likes Brian” is
equivalent to saying “everybody does not like
Brian”.
• The negation of quantifiers behaves exactly in
this fashion, just as in natural language,
“nobody likes Brian” and “everybody does not
like Brian” are equivalent so in predicate logic

• And

• are equivalent.
Page 23
The negation of quantifiers
• Law 5

• When negation is applied to a quantified


expression it flips quantifiers as it moves
inwards(i.e negation turns all universal
quantifiers to existential quantifiers and
vice versa, and negates all predicates)

Page 24
Free and bound variables
• Consider two predicates
• n>5…..Eq. 1

• In equation 1, n is free as its value


may not be determined or restricted

• In equation 2, the variable n is


bound, it is existentially quantified
variable.
Page 25
Free and bound variables
• Example

• In this statement, y and x are two variables. y


is universally quantified and it is bound, while
x is free variable.

Page 26
Substitution
• Consider statement,

• we may replace the name n with any term t,


This process is called substitution: the
expression p[t/n] denotes the fact that the
term t is being substituted for the variable
name n in the predicate p.

• Example, we may denote the substitution of 3


for n in the predicate n>5 by

Page 27
Substitution
• Also, we may denote the substitution of
3+4 for n in n>5 by
n>5[3+4/n]

Page 28
Substitution
• More than one substitution in case of more than
one free variable
• Consider predicate,
• Here x and y are both free variables. We may
substitute nigel for x as follows,

• Now substituting ken for y,

Page 29
Substitution
• Similarly, in one step, overall substitution
may be denoted as,

• These two substitutions take place


sequentially, first nigel is substituted for x,
then ken is substituted for y. However, for
simultaneous substitutions,

Page 30
Substitution
• To illustrate the difference between sequential
and simultaneous substitution, consider the
example,

• In former there is only one occurrence of y and in


latter there are two occurrences of y
Page 31
Restriction
• Filters role in predicate logic
• Considering an example, all natural
numbers which are prime numbers and
are greater than 2 are odd, may be
written as,

• Using a filter, statement may be


written as,

• Form of restricted predicates as,


Page 32
Exercise
• Represent the following statement in
the form,

• Everyone who likes cheese likes pizza


• There is a person who likes cheese
that likes pizza
• Everyone who likes cheese also likes
pizza and likes bananas

Page 33
Solution

Page 34
Restriction
• Law 6

• Law 7

Page 35
Uniqueness
• Existential quantifier, allows us to
represent statements such as “there is
at least one x, such that…”.
• In order to be more specific, consider,
“there is exactly one x, such that…”
• Consider an example statement,

it is the case that the predicate x+1=1


is true for exactly one natural number:0
Page 36
Uniqueness
• The operator which allow us to state
that “ there is exactly one natural
number, x, is denoted as

• As an example,

Page 37
Uniqueness
• Assuming the statement

• The µ operator allows us to do exactly this,


the statement (µx:X | p) is read as “ the
unique x from set X such that p holds of x”

• Example, (µx:N | x+1=1) where µ is


associated with value 0

Page 38
Uniqueness
• On the other hand, µ expressions that are not
associated with a unique element generate an
undefined value.
• As an example, the µ expressions
(µn:N | n is even)
and
(µc:Country | population (c) > 10,000,000)
are both undefined

Page 39
Uniqueness
• Expressions of the form,

• return the result of applying the term t to


the unique element of the set X which
satisfies the predicate p

• gives the value Washington

Page 40
Uniqueness
• If there is no unique element which
possesses the relevant property, then the
result is undefined

• and

• are both undefined.

Page 41
Exercise
• Write the following in terms of µ
expressions
– The tallest mountain in the world
– The height of the tallest mountain
– The oldest person in the world
– The nationality of the oldest person in
the world

Page 42
Solution

Page 43
Equational Reasoning
• Two methods of reasoning

– Equational reasoning

– Natural deduction

Page 44
Equational Reasoning
• Law 8
If a predicate holds for all elements of a
set, then it holds for some of them

• Law 9
If a predicate holds for exactly one
element of a set, then it holds for at
least one of them

Page 45
Equational Reasoning
• Law 10
If p holds for all elements of X and t is of type
X, then p holds for t

Example,
The predicate
holds for all natural numbers. The term 3+4 is of
type N and as such,

holds.

Page 46
Equational Reasoning
• Law 11
This law states that if t is a term of
type X and p holds of t, then we can
conclude that p holds for some
elements of X

• Example
The proposition 7εN is true and
furthermore 7 is prime. As such,
Page 47
Equational Reasoning
• Law 16
It states that as x does not appear free
in q, the following holds

• Example,

Page 48
Equational Reasoning
• Law 17
It states that as x does not appear free
in q, the following holds,

• Example

Page 49
Equational Reasoning
• Law 18
It states as x does not appear free in q,
the following holds

• Example

Page 50
Equational Reasoning
• Law 19
It states as x does not appear free in q,
the following holds

• Example

Page 51
Equational Reasoning
• Example: A theorem in predicate
logic

• Proof:

Page 52
Equational Reasoning
• Example Theorem

Page 53
Exercise

Page 54
Solution

Page 55
Natural deduction
• Natural deduction can also be extended to
predicate logic
• Natural deduction rules for universal
quantification

• Rule1 states that if p holds for all values of


X, then provided that t is of type X- p holds
for t

Page 56
Natural deduction
• Example:
All natural numbers which are prime and
greater than 2 are odd. 7 is prime and greater
than 2 and we may conclude that it is odd.

Page 57
Natural deduction
• Rules for existential quantification
If xεX such that p holds for x, then if
we are able to define further
predicate, q in which x does not
appear free, then we may conclude
q

Page 58
Natural deduction
• Intro rule
• If p is true for any term t of set X, then
we conclude that, holds

Page 59
The one-point rule
• It states that p is a person that likes
chocolates, but also that the name of person
is Rick
• We can conclude that rick ε Person and rick
likes chocolates are both true

• Law 20

Page 60
The one-point rule
• Example

Page 61
Thank you!

Page 62

You might also like