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

7-Inference Theory for Predicate Calculus, Formulas With More Than One Quantifier.-23!09!2024

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)
17 views63 pages

7-Inference Theory for Predicate Calculus, Formulas With More Than One Quantifier.-23!09!2024

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/ 63

Module-4

Reference:
Predicate Calculus
• Predicate: A part of a declarative sentences describing the
properties of an object (subject) is called a predicate.
• The logic based upon the analysis of predicate in any
statement is called predicate logic.
• Let us consider the following statements:
1. John is a bachelor.
2. Smith is a bachelor.
• Here John, Smith are subjects and the part “is a bachelor” is a
predicate.
• Symbolic form:
1. J(x)
2. S(x)
NOTE: J,S are predicate variables and x is a subject. Small letter
for subject and capital letter for predicate.
The statement functions, variables,
quantifiers
The statement functions, variables,
quantifiers
a) Simple statement function of one variable is defined to
be an expression consisting of a predicate symbol & an
individual variable.
• Example: Let H be the predicate “is a mortal”, b the name
“Mr.Smith”. Then H(b) denote simple statement function.
b) Compound statement function: Obtained by combining
one or more simple statement function and logical
connectives.
• Example: Let M(x) be “x is a man” & H(x) be “x is a mortal”.
Then M(x)H(x), M(x) H(x), ˥ H(x), M(x)H(x), etc are
compound statement functions.
• NOTE: small letter represents individual or object variables
as well as names of objects.
Quantifiers
• It tells for how many elements a given predicate is
“True”.
• Refers to quantities such as “some” or “all”.
• Types:
1.  - Universal quantifiers (for all).
2.  - Existential quantifiers(there exist).
• Suppose that P is a one-place predicate.
– ∀x(P(x)) is a proposition, which is true if and only if P(a) is
true for every entity a in the domain of discourse for P .
– ∃x(P(x)) is a proposition which is true if and only if there is
at least one entity, a, in the domain of discourse for P for
which P(a) is true.
Predicate
• One-place predicate (one subject):
– Example: Pavithra is rich: R(x)
• Two-place predicate (two subjects):
– Example: Sam is taller than Ram: T(x,y)
• Examples of 3-place & 4-place predicates:
– Susan sits between Ram and Sita.
– Green and Miller played bridge against Joshn and Smith.
• n-place predicate is one with n number of objects.
1. Universal quantifiers: For all, for every, for
each, everything, each thing.
• Example: All cows are black.
• Paraphrase: x is a cow C(x), x is black B(x).
• Symbolic form: (x) (C(x)  B(x))
2. Existential quantifiers: For some, some, there
exist, there is, there is atleast one.
• Example: There exist some cows, which are
black.
• Symbolic form: (x) (C(x)  B(x))
1. All men are mortal.
Example-1
2. Every apple is red.
3. Any integer is either positive or negative.
• Paraphrase:
1a) For all x, if x is a man, then x is a mortal.
2a) For all x, if x is an apple, then x is red.
3a) For all x, if x is a integer, then x is either positive or negative.
• Symbolic form

• Finally;
1. There exists a man.
Example-2
2. Some men are clever.
3. Some real numbers are rational.
• Symbolic form

• Finally;
Example-3
Example-4
Example-5

• Solution:
Let z as a mother of y. So, x is a father of z & z is a
mother of y.
Now, symbolize predicate as;
(z) (P(z)  F(x,z)  M(z,y))
Example-6
Example-7
• The expression of type “All A are B” the correct connective
that should be used is conditional. On the other hand , for
symbolizing expression “Some A are B”, the correct
connective is conjunction.
• Example:
• Symbolize the statements:
a) “All men are giants”.
b) “Some men are giants”.
• Solution:
G(x): x is a giant.
M(x): x is a man
a) (x)(M(x)G(x))
b) (x)(M(x)G(x))
Example-8
• Translate each of the following sentences into a proposition using
predicate logic. Make up any predicates you need. State what each
predicate means & what its domain of discourse is.
(a) All crows are black.
(b) Any white bird is not a crow.
• Solution:
a. Let C(x) be “is a crow” and B(x) be “is black”. The domain of discourse for
both predicates is things.
(x) ( C(x)  B(x) )
For all things which are crows, they are black.
b. Let L(x) be “is a bird”, C(x) be “is a crow”, and W(x) be “is white”. The
domain of discourse for all predicates is things.
(x) ( W(x)  L(x) ˥C(x) )
For all things which are white birds, they are not crows.
Predicate formula
Predicate formula
• If P is a predicate variable & x1,x2,x3,…..xn are individual variables, then
P(x1,x2,x3,…..xn) denotes n-place predicate formula.
• It is called as Atomic formula of predicate calculus.
• Examples: R, Q(x), P(x,y), A(x,y,z), P(a,y), A(x,a,z)
Free & bound variables
Free and Bound Variable
• The scope of a quantifier in a formula P is the
quantifier itself & the sub-formula that
immediately follows the quantifier.
• Example:
a) y[P(y)  H(x)]
b) y[F(y) x[F(x) G(x,y)]]
c) y[F(y) x[F(x)]]  L(y)
Free and Bound Variable
• An occurrence of a variable x is bound in a
formula P iff it is in the scope of quantifier with
x.

• An occurrence of a variable x is free otherwise.


Free & Bound variables - Example
Closed & open formula
• If a formula P contains no free variables, it is a
closed formula and it can be evaluated.

• If a formula P contains atleast one free


variable, it is a open formula and we cannot
evaluate it as we cannot say whether this is T
or F.
Exercises
A) Closed/Open formula?

B)
Universe of discourse
(domain or universe)
Universe of discourse
(domain or universe)
• The objects are the members of particular set or class. Such class is
called as universe. i.e., it is a set from which the variable can take
values.
• Example:
– If the discussion refers to human beings only, then the universe of discourse is
the class of human beings.
– In number theory, the universe of discourse could be numbers.
• The truth value of the statement depends on it.
– Example: Consider the predicate Q: x is less than 5 and statements (x)(Q(x)
and (x)(Q(x)
– Universe of discourse: (1) [-1,0,1,2,4]
(2) [3,-2,7,8,-2]
(3) [15,20,24]
Then (x)(Q(x) is true for the universe of discourse (1) and false for (2) & (3).
(x)(Q(x) is true for both (1) & (2) and false for (3).
Example-1
Symbolize the following sentences:
1.Some cats are not black
2.All politicians are clever
3.For every positive integer, there is a positive integer greater than it.
Solution:
1. X ε set of cats
P(x): x is black
x˥P(x)
2. X ε set of politicians
P(x): x is clever
x P(x)
3. x,y ε z+
P(x,y) : x is greater than y
x y P(y,x)
Inference theory
Valid formulas
&
Equivalences
Valid formulas & Equivalences
Equivalences:
• Let A & B are predicate formulas defined over common
universe ‘E’. A and B are said to be equivalent (AB) if and
only if they have same truth value in all possible case.
• Example: x{2,4,6,8}, Q(x): x>5, Then (x)Q(x)  ˥(x) ˥ Q(x)
• Valid formula: A formula ‘A’ is said to be valid in E, if for every
assignment of object names from E to the corresponding
variables, the resulting statements have the truth value ‘T’
and is denoted as A.
• Validity of the formula is determined by;
– Truth table.
– Derivation
Form valid formulas of predicate calculus from tautologies
• Consider the following tautology of statements;
P  ˥P, PQ  ˥P  Q
• Substitute the formulas (x)R(x) and (x)S(x) for P & Q
respectively;
((x)R(x))  ˥((x)R(x))
((x)R(x)) ((x)S(x))  ˥ ((x)R(x))  ((x)S(x))
Thus, any substitution instance of tautology is also a tautology in
the statement calculus.
• Substitution instance, in which any variable in the formula is
consistently replaced any other formula throughout.
• Prime(simple/atomic) formula: A predicate formula without
any connectives.
• In general, the tautology of statement calculus remains a valid
formula of predicate calculus when prime formulas are
substituted for statement variables throughout the formula.
• Thus, all implications & equivalences of the statement
calculus discussed in module 3 (refer next slide) can be
considered as implications & equivalences of predicate
calculus in which the statement variables are replaced by
prime predicate formulas.
• Let A(x), B(x), and C(x,y) denote any prime formulas of the
predicate calculus. Then the following are valid formulas of
the predicate calculus;
˥ ˥A(x)  A(x) E1
C(x,y)  B(x)  B(x)  C(x,y) E2
A(x)  B(x)  ˥ A(x)  B(x) E3
Implications

NOTE: Replace all atomic variables by


Prime predicate formula to obtain a
valid formulas of predicate calculus
Equivalences

NOTE: Replace all atomic variables by


Prime predicate formula to obtain a
valid formulas of predicate calculus
Valid formula over finite
universe
Valid formula over finite universe
• If in a formula A(x) we replace each occurrence of the variable x by another
variable y, then we say that y is substituted for x in the formula i.e., A(y). For
each substitution A(x) must be free for y.
• Example:
a) Replace x by y in the following formula: P(x,y)  (y)Q(y)
Solution: First check whether ‘y’ is bounded or not. If so replace bounded ‘y’ by
some other variable say for example ‘z’. i.e., P(x,y)  (z)Q(z)
Then replace x by y. i.e P(y,y)  (z)Q(z).

b) Replace x by y in the following predicate formula: (z)S(z)S(x).


Solution: (z)S(z)S(y)

c) Replace x by y in the following predicate formula: (S(x) S(y)) (x)R(x)


Solution: (S(y) S(y)) (x)R(x)
Note: replace x by y provide x should be a free variable otherwise before x is
replace by z (S(y) S(y)) (z)R(z)
• DeMorgan’s law of predicate logic:
ù ((x) A(x))  (x) ˥ A(x) --------------- 1
ù ((x) A(x))  (x) ˥ A(x) --------------- 2
• Let the universe be denoted by a finite set S by S
= {a1, a2, a3,….. an} and from the meaning of
quantifiers we get;
(x) A(x)  A(a1) A(a2)…….  A(an)
( x) A(x)  A(a1) A(a2)  …….  A(an)
• Proof of eq 1:
˥((x) A(x))  ˥ (A(a1) A(a2)…….  A(an))
 ˥A(a1)  ˥ A(a2)  …….  ˥ A(an))
 (x) ˥ A(x). Hence proved.
Example
Example
• Simplify each of the following propositions. In your answer,
the ˥ operator should be applied only to individual predicates.
a) ˥ x(˥P(x))
b) ˥ z(P(z)  Q(z))
• Solution:
a) ˥x(˥P(x))  x ˥ (˥P(x)) [DeMorgan’s law of predicate
logic]
 x P(x) [Double Negation law]

b) ˥z(P(z)  Q(z))  ˥z(˥P(z)  Q(z))


 z ˥(˥P(z)  Q(z))
 z (P(z)  ˥ Q(z))
Exercise
• Simplify each of the following propositions. In
your answer, the ˥ operator should be applied
only to predicates.
Negation of quantifiers
All players are healthy
Solution:
1. Xεset of players
P(x):X is healthy
x P(x):
˥ (xP(x)) : x ˥P(x))
Negation: Some players are not healthy.
Valid formulas involving
quantifiers
Valid formulas involving quantifiers
• Rules of inference:
Rule name Formula
Rule US (x)P(x)  P(α) Remove quantifiers
(Universal specification or
instantiation)
Rule ES (x)P(x)  P(a)
(Existential specification)
Rule UG P(α)  (x)P(x) Add quantifiers
(Universal generalization)
Rule EG P(a)  (x)P(x)
(Existential generalization)

• Note: Use greek letters in universal quantifier & alphabets in existential


quantifiers.
Frequently used implication & equivalence
formulas
(x)(A(x)  B(x))  (x)A(x)  (x)B(x) (x) (A  B(x))  A  (x)B(x)

(x) (A(x)  B(x))  (x) A(x)  (x) B(x) (x) (A  B(x))  A  (x)B(x)

˥ (x)(A(x)  (x) ˥A(x) (x) A(x) B  (x) (A(x) B)

˥ (x)(A(x)  (x) ˥A(x) (x) A(x) B  (x) (A(x) B)

(x) A(x)  (x) B(x)  (x)(A(x)  B(x)) A  (x)B(x)  (x)(AB(x))

(x) A(x)  (x) B(x)  (x)A(x)  (x)B(x) A  (x)B(x)  (x)(AB(x))


Theory of inference for the predicate
calculus
• To derive conclusion;
1. First eliminate quantifiers using either rule US or
ES.
2. Apply appropriate implication and equivalences.
3. Use DeMorgan’s law of predicate logic when
negation involved.
4. Finally, add quantifiers using either rule UG or EG.
– NOTE: on combining two statement formulas, if
one with alphabet and one with greek letter, then
the final conclusion is with alphabet.
Example-1
• Prove that (x)Q(x) derives from (x)(P(x)Q(x)), (x)P(x).
• Solution:

Step Statement Formula Rule Justification


1 (x)P(x) P -
2 P(a) ES (1)
3 (x)(P(x)Q(x)) P -
4 P(α)Q(α) US (3)
5 Q(a) T (2),(4)
Modus ponens
6 (x)Q(x) EG (5)
Hence proved
Example 2
Example-3
• Show that (x) (H(x)M(x))  H(s)  M(s). Note that this problem is a symbolic
translation of a well-known argument known as the “Socrates argument” which is
given by;
All men are mortal.
Socrates s a man.
Therefore Socrates is a mortal.
All men are mortal it can be written as fro all x if x is a man then x is mortal (x)
H(x)M(x)
• If we denote H(x): x is a man, M(x): x is a mortal, and s:Socrates, Socrates is a
man: H(s) Socrates is a mortal: M(s) we can put the argument in the above form.
• Solution:

Step Statement Formula Rule Justification


1 (x) H(x)M(x) P -
2 H(α)M(α) US (1)
3 H(s) P -
4 M(s) T (2),(3) Modus ponens
Hence proved
Example-4
• Use indirect method to prove that (x)(P(x)  Q(x))  ((x)P(x))  (
(x)Q(x)).
• Solution:
Step Statement Formula Rule Justification

1 ˥[((x)P(x))  ((x)Q(x))] P -

2 (x)˥P(x)  (x)˥Q(x) T (1)


DeMorgan’s law
3 (x)˥P(x) T (2) Simplification

4 (x)˥Q(x) T (3) Simplification

5 ˥P(a) ES (3)

6 ˥Q(α) US (4)

7 (x)(P(x)  Q(x)) P -

8 P(α)  Q(α) US (7)

9 Q(a) T (5),(8) Disjunctive syllogism

10 ˥Q(a)  Q(a) T (7),(8) Conjunction

11 F T (10) Complement law


Hence proved
Example-5
• Show that (x)(P(x)  Q(x))  (x) (Q(x)  R(x))  (x) (P(x)  R(x))
• Solution:

Step Statement Formula Rule Justification


1 (x) P(x)Q(x) P -
2 P(α)Q(α) US (1)
3 (x) Q(x)R(x) P
4 Q(α)R(α) US (3)
5 P(α)R(α) T (2),(4) chain rule
6 (x) P(x)R(x) UG (5)
Hence proved
Example-6
• Show that (x)M(x) follows logically from the premises (x)(H(x)M(x)) and
(x)H(x).
• Solution:
Step Statement Formula Rule Justification
1 (x)H(x) P -
2 H(a) ES (1)
3 (x)(H(x)M(x)) P -
4 H(α)M(α) US (3)
5 M(a) T (2),(4) Modus
ponens
6 (x)M(x) EG (5)
Hence proved
Example-7
• Prove that (x)(P(x)  Q(x))  (x)P(x)  (x)Q(x)
• Solution:
Step Statement Formula Rule Justification
1 (x)(P(x)  Q(x)) P -
2 P(a)  Q(a) ES (1)
3 P(a) T (2) simplification
4 Q(a) T (2) simplification
5 (x) P(x) EG (3)
6 (x) Q(x) EG (4)
7 (x)P(x)  (x)Q(x) T (4),(5) I9
Hence proved
Example-8
• Show that form
a) (x) (F(x)  S(x))  (y) (M(y)  W(y))
b) (y) (M(y)  ˥W(y)) and the conclusion (x) (F(x)  ˥S(x)) follows.
Solution:
Step Statement Formula Rule Justification
1 (y) (M(y)  ˥W(y)) P -
2 M(a)  ˥W(a) ES (1)
3 ˥M(a)  W(a) T (2), E17
4 (y) ˥M(y)  W(y) EG (3)
5 ˥ (y) M(y)  W(y) T (4), E26
6 (x) (F(x)  S(x))  (y) (M(y)  W(y)) P -
7 ˥ (x) F(x)  S(x) T (5),(6), I12
8 (x) ˥F(x)  S(x) T (7), E26
9 ˥F(α)  S(α) US (8)
10 F(α)  ˥S(α) T (9), E9 , E16 , E17
11 (x) F(x)  ˥S(x) UG (10), Hence proved
Formulas involving more than one
quantifiers
• Two quantifiers are said to be nested if one is within
the scope of the other. Ex: (x)(x) Q(x,y)
• Different combination of nested quantifiers:
– If P(x,y) is a 2-place predicates then the following
possibilities exist:

– Note: We cannot change the order of variables , but we


change the order of quantifiers
Graphical representation of relationship
among formulas involving two quantifiers.
Valid formulas
Example
• Show that ˥P(a,b) follows logically from (x)(y) (P(x,y)  W(x,y)) and
˥W(a,b).
• Solution:

Step Statement Formula Rule Justification


1 (x) (y) (P(x,y)  W(x,y)) P -
2 (y) (P(a,y)  W(a,y)) US (1)
3 P(a,b)  W(a,b) US (2)
4 ˥ W(a,b) P -
5 ˥ P(a,b) T (3),(4), I12
Hence Proved
Example
• Verify the validity of the following inference
“If one person is more successful than another, then he has worked hard to
deserve success. Naveen has not worked harder than Amul. Therefore, Naveen is
not more successful than Amul”.
Solution:
S(x,y): x is more successful than y
W(x,y: x has worker harder than y to deserve success
N:Naveen
A: Amul
Symbolic Form: (x) (y) ((P(x,y)  W(x,y))
˥ W(n,a)
Therfore ˥ S(n,a)
Exercises
1. Show that P(x)  (x)Q(x)  (x)(P(x)  Q(x)).
2. Explain why the following steps in the derivations are not correct.
• (a) (1) (x)P(x)  Q(x)
(2) P(x)  Q(x) (1), US
• (b) (1) (x)P(x)  Q(x)
(2) P(y)  Q(x) (1), US
• (c) (1) (x)(P(x)  Q(x))
(2) P(a)  Q(b) (1), US
• (d) (1) (x)(P(x)  (x)(Q(x)R(x)))
(2) P(a)  (x)(Q(x)R(a)) (1), US
Exercise
3. What is wrong in the following steps of derivation?
• (a) (1) P(x)  Q(x) P
(2) (x)P(x)  Q(x) (1), EG
• (b) (1) P(a)  Q(b) P
(2) (x)(P(x)  Q(x)) (1), EG
• (c) (1) P(a)  (x)(P(a) Q(x)) P
(2) (x)(P(x)  (x)(P(x) Q(x))) (1), EG
4. Demonstrate the following implications.
(a) ˥ ((x)P(x)  Q(a))  (x) P(x ) ˥Q(a)
(b) (x)(˥P(x) Q(x)), (x) ˥Q(x)  P(a)
(c) (x)(P(x) Q(x)), (x) (Q(x)  R(x))  P(x) R(x)
(d) (x)(P(x)  Q(x)), (x) ˥P(x)  (x)Q(x)

You might also like