Sie sind auf Seite 1von 4

Discrete Mathematics 2002 Lecture 14, 22-August-2002

4.7 Predicate Logic


• To date we’ve looked at propositional logic
(‘the logic of propositions’)
• However, sometimes this is inadequate
because it can’t cope with logical structure
that may be present within propositions
• The following example illustrates this point

Example of the Inadequacy of


Propositional Logic
• Example: Consider the argument:
It is not true that all animals are cows.
Therefore there is at least one animal that
is not a cow.
• This seems a perfectly reasonable argument
• However, we run into difficulties if we try
to use propositional logic to show the
argument is valid
2

Example (continued)
• Let p, q denote the atomic propositions:
p: ‘All animals are cows’
q: ‘There is at least one animal that is not a cow’
• Then the argument is ¬p → q
• Is this a tautology?
• NO! – for if p and q are both false, then ¬p → q
is false
• Thus the original argument, which seems quite
reasonable, doesn’t appear to be logically valid
3

1
Discrete Mathematics 2002 Lecture 14, 22-August-2002

Why isn’t the Argument Valid?


• The problem occurs because we’re unable
to break down further the propositions ‘All
animals are cows’ and ‘There is at least one
animal that is not a cow’ into component
propositions, to reveal the full extent of
what is contained in the statements
• To achieve this, we need to use predicate
logic
4

Predicates
• A predicate is a statement containing one or
more variables. If values are assigned to all
the variables, the result is a proposition.
• Example: ‘y ≥ 7’ is a predicate, where y is a
variable denoting any real number
• Example: ‘x is in Africa’ is a predicate,
where x is a variable denoting the name of a
country
5

Propositions from Predicates


• A proposition can be obtained from a
predicate by means other than allocating
values to the variable(s)
• Example: From the predicate ‘y ≥ 7’ we
can obtain the proposition ‘For all y, y ≥ 7’
• Note that ‘For all y, y ≥ 7’ is false
• However, it is true that y ≥ 7 for some
values of y
• Thus the proposition ‘There exists a y such
that y ≥ 7’ is true
6

2
Discrete Mathematics 2002 Lecture 14, 22-August-2002

Quantifiers
• The expressions ‘for all’ and ‘there exists’ are
called quantifiers
• The process of applying a quantifier to a
variable is called quantifying the variable
• A variable that has been quantified is said to
be bound
• Example: In ‘There exists a y such that y ≥ 7’,
the variable y is bound by the quantifier ‘there
exists’
• A variable that is not bound is said to be free
7

Notation for Predicates & Quantifiers


• Use capitals for predicates – e.g. A predicate
P that contains a variable x is denoted by P(x);
if it contains x & y, it is denoted by P(x, y)
• The quantifier ‘for all’ is denoted by ∀
• The quantifier ‘there exists’ is denoted by ∃
• Example: Write in symbols ‘There exists a y
such that y ≥ 7’
Solution: Let P(y) denote the predicate ‘y ≥ 7’.
Then the proposition is ∃y P(y)
8

Another Example
• Example: Write in symbols
‘For all y, y < 7 or y ≥ 7’
Solution: Let P(y) & Q(y) denote the
predicates ‘y < 7’ & ‘y ≥ 7’, respectively.
Then the proposition can be written as
∀y [P(y) ∨ Q(y)].
Note: Since Q(y) is equivalent to ¬P(y),
this can also be written as
∀y [P(y) ∨ ¬P(y)]
9

3
Discrete Mathematics 2002 Lecture 14, 22-August-2002

An Example with 2 Variables


• Example: Write the propositions in symbols:
1. ‘For every number y there is a number x
such that x = y – 3’
2. ‘There is a number x such that, for every
number y, x = y – 3’
Solution: Let P(x, y) denote the predicate
‘x = y – 3’. Then the propositions are:
1. ∀y ∃x P(x, y)
2. ∃x ∀y P(x, y)
Question: Are these propositions true or false?
10

Practical Use of the Notation


• Example: In a car rally, suppose R(c, p) denotes
the predicate ‘Car c has visited checkpoint p’.
Put the following in symbolic form.
1. ‘Car 6 has visited checkpoint 3’
Answer: R(6, 3)
2. ‘Car 8 has not visited checkpoint 4’
Answer: ¬R(8, 4)
3. ‘Car c has not visited checkpoint p’
Answer: ¬R(c, p)
4. ‘All cars have visited checkpoint p’
Answer: ∀cR(c, p)
11

Practical Use of the Notation (contd)


5. ‘Car c has not visited all checkpoints’
Answer: ¬[∀pR(c, p)] or ∃p[¬R(c, p)]
6. ‘All cars have visited all checkpoints’
Answer: ∀c∀pR(c, p)
7. ‘Car c has visited at least two checkpoints’
Answer: ∃p1∃p2 [R(c, p1) ∧ R(c, p2) ∧ (p1≠p2)]
8. ‘No more than one car has visited checkpt p’
Answer: ∀c1∀c2[(R(c1, p) ∧ R(c2, p)) → (c1=c2)]
9. ‘Exactly one car has visited checkpoint p’
Answer: [∃cR(c, p)] ∧
{∀c1∀c2[(R(c1, p) ∧ R(c2, p)) → (c1=c2)]} 12

Das könnte Ihnen auch gefallen