0% found this document useful (0 votes)
17 views25 pages

DS - Chapter 2.1 - Predicate Logic

Uploaded by

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

DS - Chapter 2.1 - Predicate Logic

Uploaded by

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

23Z304 - DISCRETE STRUCTURES

19Z304 - DISCRETE STRUCTURES 1

Chapter 2 – 2.1 Predicate Logic

❑ Fundamentals Of Predicate Logic


❑ Quantifiers

❑ Quantifier Expressions for Representation In Predicate Logic

❑ Negating quantified expression

19Z304 - DISCRETE STRUCTURES 2

Text Books:
T1. Kenneth H. Rosen, Discrete Mathematics and its Applications, Tata McGraw Hill,
7th Ed., 2018.
Logic and Proofs:
1.3. Predicates and Quantifiers

19Z304 - DISCRETE STRUCTURES 3

HOW TO SYMBOLIZE IN MATHEMATICAL FORM


??????????????

All students in my class are good

Every book is good friend


All students in my class are good
.

Some people are not social responsible

some books are good friends

some houses in my street have a cat, a dog, or fish.

19Z304 - DISCRETE STRUCTURES 4

Introduction:
Predicate Logic
Predicates and Quantifiers :
A more powerful type of logic called predicate logic. We will see how predicate logic can be used to express
the meaning of a wide range of statements in mathematics and computer science in ways that permit us to
reason and explore relationships between objects. To understand predicate logic, we first need to introduce the
concept of a predicate. Afterward, we will introduce the notion of quantifiers, which enable us to reason with
statements that assert that a certain property holds for all objects of a certain type and with statements that assert
the existence of an object with a particular property.

Predicates
Statements involving variables, such as are often found in mathematical assertions, in computer programs, and in
system specifications. These statements are neither true nor false when the values of the variables are not
specified.

19Z304 - DISCRETE STRUCTURES 5


Predicate Logic

• Propositional logic (recall) treats simple propositions (sentences) as atomic entities. • Predicate
logic is an extension of propositional logic that permits concisely reasoning about whole
classes of entities.
• In the sentence “Krishna is sleeping”:
• The phrase “Krishna” denotes the subject - the object or entity that the sentence is about. •
The phrase “is sleeping” denotes the predicate- a property that is true of the subject. • In
predicate logic, a predicate is modeled as a function P(·) from objects to propositions. •
P(x) = “x is sleeping” (where x is any object).

19Z304 - DISCRETE STRUCTURES 6


Predicate Logic

• It is the basis for clearly expressed formal specifications for any complex system. • It is
basis for automatic theorem provers and many other Artificial Intelligence systems. • E.g.
automatic program verification systems.
• Predicate-logic like statements are supported by some of the more sophisticated database query
engines and container class libraries
• Convention:
• Lowercase variables x, y, z... denote objects/entities;
• uppercase variables P, Q, R… denote propositional functions (predicates).
E.g. if P(x) = “x is a prime number”,
P(3) is the proposition “3 is a prime number.”
19Z304 - DISCRETE STRUCTURES 7

GENERALIZATION

EXAMPLE : Let A(c, n) denote the statement “Computer c is connected to network n,” where c is a variable
representing a computer and n is a variable representing a network. Suppose that the computer MATH1 is connected to
network CAMPUS2, but not to network CAMPUS1. What are the values of
i. A(MATH1, CAMPUS1) ?
ii. A(MATH1, CAMPUS2)?
Solution: Because MATH1 is not connected to the CAMPUS1 network, we see that A(MATH1,
CAMPUS1) is false. However, because MATH1 is connected to the CAMPUS2 network, we
see that A(MATH1, CAMPUS2) is true.
19Z304 - DISCRETE STRUCTURES 8

19Z304 - DISCRETE STRUCTURES 9


Predicate Logic
EXAMPLE 3 Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the
propositions Q(1, 2) and Q(3, 0)?
Solution: Q(x, y) denote the statement “x = y + 3.”
Q(1, 2) is the statement “1 = 2 + 3,” which is false.
The statement Q(3, 0) is the proposition “3 = 0 + 3,” which is true.

19Z304 - DISCRETE STRUCTURES 10


Universes of Discourse

19Z304 - DISCRETE STRUCTURES 11

Quantifiers
∙ If the variables in a propositional function are assigned values, the resulting statement becomes a proposition
with a certain truth value.
∙ However, there is another important way, called quantification, to create a proposition from a propositional
function.
∙ Quantification expresses the extent to which a predicate is true over a range of elements. ∙
In English, the words all, some, many, none, and few are used in quantifications. ∙ We will focus
on two types of quantification here:
⮚ Universal quantification, which tells us that a predicate is true for every element under consideration.
⮚ Existential quantification, which tells us that there is one or more element under consideration for
which the predicate is true.
∙ The area of logic that deals with predicates and quantifiers is called the predicate calculus.

19Z304 - DISCRETE STRUCTURES 12


Universal Quantifiers
∙ Many mathematical statements assert that a property is true for all values of a variable in a particular domain,
called the domain of discourse (or the universe of discourse. Such a statement is expressed using universal
quantification.

• DEFINITION :
• The universal quantification of P(x) is the statement “P(x) for all values of x in the domain.”
• Notation : ∀xP(x)
• ∀ is called the universal quantifier.
• We read ∀xP(x) as “for all xP(x)” or “for every xP(x).”
• Example: “Every computer on campus is connected to the network.”
Let x is computers on campus
N(x) is “Computer x is connected to the network”
the statement “Every computer on campus is connected to the network.”: ∀x N(x)

19Z304 - DISCRETE STRUCTURES 13


Existential Quantifiers
Many mathematical statements assert that there is an element with a certain property. Such statements are
expressed using existential quantification. With existential quantification, we form a proposition that is true if
and only if P(x) is true for at least one value of x in the domain.

DEFINITION 2 The existential quantification of P(x) is the proposition “There exists an element x in the
domain such that P(x).” We use the notation ∃xP(x) for the existential quantification of P(x). Here ∃ is called the
existential quantifier
• Example: “Some student in CSE branch has joined the course under CISCO”
Let x is student in CSE branch
C(x) is “has joined the course under CISCO”
Therefore the statement “Some student in CSE branch has joined the course under CISCO” has
the Symbolic Form: ∃x C(x)

19Z304 - DISCRETE STRUCTURES 14


Every student in this class has studied calculus

There is a student in your class who has not taken a course in calculus.

All Americans eat cheeseburgers

All computer science students can code in C and C++

Some student in this class has visited Mexico

There is a student at your school who can speak Tamil but who doesn’t know Hindi.
19Z304 - DISCRETE STRUCTURES 15

Statement Domain ∀xP(x) ∃xP(x)


x is a prime number x belongs R False True
x is good x belongs to the set of student in True True
this class
x<2x x belongs to Positive integers True True

19Z304 - DISCRETE STRUCTURES 16

Universal Quantifiers
EXAMPLE 8: Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification ∀xP(x),
where the domain consists of all real numbers?

Solution: Because P(x) is true for all real numbers x, the quantification ∀xP(x) is true.

EXAMPLE 13 What is the truth value of ∀x(x2 ≥ x) if the domain consists of all real numbers? What is
the truth value of this statement if the domain consists of all integers?
Solution: The universal quantification ∀x(x2 ≥ x), where the domain consists of all real
numbers, is false. For example, ( 1/2 )2 ≥ 1/2 . Note that x2 ≥ x if and only if x2 − x = x(x − 1) ≥
0.

Consequently, x2 ≥ x if and only if x ≤ 0 or x ≥ 1. It follows that ∀x(x2 ≥ x) is false if the domain consists of all real
numbers (because the inequality is false for all real numbers x with (0 < x < 1).
If the domain consists of the integers, ∀x(x2 ≥ x) is true, because there are no integers x with 0 < x < 1.

19Z304 - DISCRETE STRUCTURES 17


Existential Quantifiers
EXAMPLE 15 Let Q(x) denote the statement “x = x + 1.”What is the truth value of the quantification
∃xQ(x), where the domain consists of all real numbers?
Solution: Because Q(x) is false for every real number x, the existential quantification of Q(x), ∃xQ(x), is false.

EXAMPLE 16 What is the truth value of ∃xP(x), where P(x) is the statement “x2 > 10” and the universe of
discourse consists of the positive integers not exceeding 4?
Solution: Because the domain is {1, 2, 3, 4}, the proposition ∃xP(x) is the same as the
disjunction P(1) ∨ P(2) ∨ P(3) ∨ P(4).
Because P(4), which is the statement “42 > 10,” is true, it follows that ∃xP(x) is true.

Note : Binding Variables


When a quantifier is used on the variable x, we say that this occurrence of the variable is bound. An
occurrence of a variable that is not bound by a quantifier or set equal to a particular value is said to be
free.
19Z304 - DISCRETE STRUCTURES 18
EXAMPLE
Negating quantified expression
Example :
“Every student in your class has taken a course in calculus.”
Notation : ∀xP(x)

Negation: not (∀xP(x)) equivalently


Some student in your class has not taken a course in calculus

19Z304 - DISCRETE STRUCTURES 20


19Z304 - DISCRETE STRUCTURES 21

PRECENDENCE OF QUANTIFIER

LOGICAL EQUIVANLENCE INVOLVING QUANTIFIERS


19Z304 - DISCRETE STRUCTURES 22

Logical Equivalences Involving Quantifiers

DEFINITION : Statements involving predicates and quantifiers are logically equivalent if and only if they have
the same truth value no matter which predicates are substituted into these statements and which domain of
discourse is used for the variables in these propositional functions. We use the notation S ≡ T to indicate that two
statements S and T involving predicates and quantifiers are logically equivalent.

EXAMPLE : Show that ¬∀x(P(x) → Q(x)) and ∃x(P(x)∧¬Q(x)) are logically


equivalent. Solution: By De Morgan’s law for universal quantifiers, we know that
¬∀x(P(x) → Q(x))
= ∃x(¬(P (x) → Q(x)))
=¬(P (x) → Q(x))
=P(x)∧¬Q(x)
=¬∀x(P(x) → Q(x)) and ∃x(P(x)∧¬Q(x)) are logically equivalent.

19Z304 - DISCRETE STRUCTURES 23

THANKS
19Z304 - DISCRETE STRUCTURES 24

You might also like