Predicate Logic: Quantifier
Predicate Logic: Quantifier
Predicate Logic deals with predicates, which are propositions, consist of variables.
Quantifier:
The variable of predicates is quantified by quantifiers. There are two types of quantifier in predicate logic -
The variable of predicates is quantified by quantifiers. There are two types of
quantifier in predicate logic - Existential Quantifier and Universal Quantifier. Universal
Quantifier.
There are several ways to write a proposition, with an existential quantifier, i.e.,
(∃x∈A)p(x) or ∃x∈A such that p (x) or (∃x)p(x) or p(x) is true for some x
∈A.that p (x) or (∃x)p(x) or p(x) is true for some x ∈A.
Universal Quantifier:
If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read as "For every x ∈U,p(x)
If p(x) is a proposition over the universe U. Then it is denoted as ∀x,p(x) and read as
"For every x∈U,p(x) is true." The quantifier ∀ is called the Universal Quantifier.
∀x∈A,p(x) or p(x), ∀x ∈A Or ∀x,p(x) or p(x) is true for all x ∈A. (x) is true for
all x ∈A.
Negation of Quantified Propositions:
When we negate a quantified proposition, i.e., when a universally quantified
proposition is negated, we obtain an existentially quantified proposition,and when an
existentially quantified proposition is negated, we obtain a universally quantified
proposition.
The two rules for negation of quantified proposition are as follows. These are also
called DeMorgan's Law.
2. (∃x∈U) (x+6=25)
3. ~( ∃ x p(x)∨∀ y q(y)
The proposition which contains both universal and existential quantifiers, the order
of those quantifiers can't be exchanged without altering the meaning of the
proposition, e.g., the proposition ∃x ∀ y p(x,y) means "There exists some x such that p
(x, y) is true for every y."
Example: Write the negation for each of the following. Determine whether the
resulting statement is true or false. Assume U = R.
1.∀ x ∃ m(x2<m)
2. ∃ m∀ x(x2<m)
To represent the above statements, PL logic is not sufficient, so we required some more
powerful logic, such as first-order logic.
First-Order logic:
o First-order logic is another way of knowledge representation in artificial
intelligence. It is an extension to propositional logic.
o FOL is sufficiently expressive to represent the natural language statements in a
concise way.
o First-order logic is also known as Predicate logic or First-order predicate
logic. First-order logic is a powerful language that develops information about
the objects in a more easy way and can also express the relationship between
those objects.
o First-order logic (like natural language) does not only assume that the world
contains facts like propositional logic but also assumes the following things in
the world:
o Objects: A, B, people, numbers, colors, wars, theories, squares, pits,
wumpus, ......
o Relations: It can be unary relation such as: red, round, is adjacent, or
n-any relation such as: the sister of, brother of, has color, comes
between
o Function: Father of, best friend, third inning of, end of, ......
o As a natural language, first-order logic also has two main parts:
o Syntax
o Semantics
C++ vs Java
Variables x, y, z, a, b,....
Connectives ∧, ∨, ¬, ⇒, ⇔
Equality ==
Quantifier ∀, ∃
Atomic sentences:
o Atomic sentences are the most basic sentences of first-order logic.
These sentences are formed from a predicate symbol followed by a
parenthesis with a sequence of terms.
o We can represent atomic sentences as Predicate (term1, term2, ......,
term n).
CConsider the statement: "x is an integer.", it consists of two parts, the first part x
is the subject of the statement and second part "is an integer," is known as a
predicate.nt and second part "is an integer," is known as a predicate.
Universal Quantifier:
is Universal quantifier is a symbol of logical representation, which specifies that the
statement within its range is true for everything or every instance of a particular
thing.
o For all x
o For each x
o For every x.
Let a variable x which refers to a cat so all x can be represented in UOD as below:
IfIf x is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as: x
is a variable, then existential quantifier will be ∃x or ∃(x). And it will be read as:
It will be read as: There are some x where x is a boy who is intelligent.
Points to remember:
o The main connective for universal quantifier ∀ is implication →.
o The main connective for existential quantifier ∃ is and ∧.
Properties of Quantifiers:
o In universal quantifier, ∀x∀y is similar to ∀y∀x.
o In Existential quantifier, ∃x∃y is similar to ∃y∃x.
o ∃x∀y is not similar to ∀y∃x.
b. Some Examples of FOL using quantifier:
c. 1. All birds fly.
In this question the predicate is "fly(bird)."
And since there are all birds who fly so it will be represented as follows.
∀x bird(x) →fly(x).
d. 2. Every man respects his parent.
In this question, the predicate is "respect(x, y)," where x=man, and y=
parent.
Since there is every man so will use ∀, and it will be represented as follows:
∀x man(x) → respects (x, parent).
e. 3. Some boys play cricket.
In this question, the predicate is "play(x, y)," where x= boys, and y= game.
Since there are some boys so we will use ∃, and it will be represented as:
∃x boys(x) → play(x, cricket).
f. 4. Not all students like both Mathematics and Science.
In this question, the predicate is "like(x, y)," where x= student, and y=
subject.
Since there are not all students, so we will use ∀ with negation, so following
representation for this:
¬∀ (x) [ student(x) → like(x, Mathematics) ∧ like(x, Science)].
g. 5. Only one student failed in Mathematics.
In this question, the predicate is "failed(x, y)," where x= student, and y=
subject.
Since there is only one student who failed in Mathematics, so we will use
following representation for this:
∃(x) [ student(x) → failed (x, Mathematics) ∧∀ (y) [¬(x==y) ∧
student(y) → ¬failed (x, Mathematics)].
Some Examples of FOL using quantifier:
cs)].
ifiers interact with variables which appear in a suitable way. There are two types of variables in First-order
logic which are given below:
Free Variable: A variable is said to be a free variable in a formula if it occurs outside the scope of the
quantifier.
Bound Variable: A variable is said to be a bound variable in a formula if it occurs within the scope of the
quantifier.