Understanding Predicate Calculus Basics
Understanding Predicate Calculus Basics
Module Two
2.2 Propositions
A declarative sentence (or assertion) which is true or false, but not both, is called a proposition
(or statement). Sentences which are exclamatory, interrogative or imperative in nature are not
propositions. Lower case letters such as p, q, r · · · are used to denote propositions. For example, we
consider the following sentences:
(a) New Delhi is the capital city of India.
(b) How beautiful is Rose?
(c) 2 + 2 = 3
(d) What time is it?
(e) x + y = z
(f) Take a cup of coffee.
In the given statements, (b), (d) and (f) are obviously not propositions as they are not declarative in
nature. (a) and (c) are propositions, but (e) is not, since (a) is true, (c) is false and (e) is neither true
nor false as the values of x, y and z are not assigned.
If a proposition is true, we say that the truth value of that proposition is true, denoted by T or 1.
If a proposition is false, the truth value is said to be false, denoted by F or 0.
Propositions which do not contain any of the logical operators or connectives (to be introduced
in the next section) are called atomic (primary or primitive) propositions. Many mathematical
102 Chapter 2. Predicate Calculus
statements which can be constructed by combining one or more atomic statements using connectives
are called molecular or compound propositions.
The truth value of a compound proposition depends on those of sub- propositions and the way
in which they are combined using connectives.
The area of logic that deals with propositions is called propositional logic or propositional
calculus.
2.3 Connectives
Definition 2.3.1 — Conjunction. When p and q are any two propositions, the proposition
“p and q′′ denoted by p ∧ q and called the conjunction of p and q is defined as the compound
proposition that is true when both p and q are true and is false otherwise. (∧ is the connective
used) A truth table is a table that displays the relationships between the truth values of sub-
propositions and that of compound proposition constructed from them.
Table 2.1 is the truth table for the conjunction of two propositions p and q viz., “p and q′′ .
p q p∧q
T T T
T F F
F T F
F F F
Table 2.1
Definition 2.3.2 — Disjunction. When p and q are any two propositions, the propositions
“p or q′′ denoted by p ∨ q′′ and called the disjunction of p and q is defined as the compound
proposition that is false when both p and q are false and is true otherwise. (∨ is the connective
used).
Table 2.2 is the truth table for the disjunction of two propositions p and q, viz., “p ∨ q′′ .
p q p∨q
T T T
T F T
F T T
F F F
Table 2.2
Definition 2.3.3 — Negation. Given any proposition p, another proposition formed by writing
“It is not the case that” or “It is false that” before p or by inserting the word ‘not’ suitably in p is
called the negation of p and denoted by ¬p (read as ‘not p’). ¬p is also denoted as p′ , p and
∼ p. It p is true, then ¬p is false and if p is false, then ¬p is true.
p ¬p
T F
F T
Table 2.3
2.4 Order of Precedence for Logical Connectives 103
Table 2.3 is the truth table for the negation of p. For example, if p is the statement “New Delhi
is in India”, the ¬p is any one of the following statements.
(a) It is not the case that New Delhi is in India
(b) It is false that New Delhi is in India
(c) New Delhi is not in India
The truth value of p is T and that of p is F.
For example, let us consider the statement. “If I get up at 5 A.M., I will go for a walk”, which may
be represented as p → q and considered as a contract.
If p is true and q is also true, the contract is not violated and so ‘p → q′ is true.
If p is true and q is false (viz., I get up at 5 A.M., but I do not go for a walk), the contract is
violated and so ‘p → q′ is false.
If p is false and whether q is true or false (viz., when I have not got up at 5 A.M; I may or may
not go for a walk), the contract is not violated and so ‘p → q′ is true.
Accordingly, the truth table for the conditional proposition p → q will be as given in Table 2.4.
The alternative terminologies used to express p → q (if p, then q) are the following:
p q p→q
T T T
T F F
F T T
F F T
Table 2.4
(i) p implies q,
(ii) p only if q [“If p, then q” formulation emphasizes the hypothesis, whereas “p only if q”
formulation emphasizes the conclusion; the difference is only stylistic,
(iii) q if p or q when p,
(iv) q follows from p,
104 Chapter 2. Predicate Calculus
p q p↔q
T T T
T F F
F T F
F F T
Table 2.5
p ¬p p ∨ ¬p p ∧ ¬p
T F T F
F T T F
Table 2.6
Note 2.5.1 1. The negation of a tautology is a contradiction and the negation of a contradiction
is a tautology.
2. If P(p1 , p2 , · · · , pn ) is a tautology, then P(q1 , q2 , · · · , qn ) is also a tautology, where q1 , q2 , · · · , qn
are any set of propositions. This is known as the principle of substitution. For example, since
p ∨ ¬p is a tautology, ((p ∨ q) ∧ r)v¬((p ∨ q) ∧ r) is also a tautology.
3. If a proposition is neither a tautology nor a contradiction, it is called a contingency.
Definition 2.5.4 — Equivalence of Propositions. Two compound propositions A(p1 , p2 , · · · , pn )
and B(p1 , p2 , · · · , pn ) are said to be logically equivalent or simply equivalent, if they have iden-
tical truth tables, viz. if the truth value of A is equal to the truth value of B for every one of the
2n possible sets of truth values assigned to p1 , p2 , · · · , pn .
p q p∨q ¬(p ∨ q) ¬p ¬q ¬p ∧ ¬q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
Table 2.7
Note 2.5.2 We have already noted that the biconditional proposition A ↔ B is true whenever both
A and B have the same truth value, viz. A ↔ B is a tautology, when A and B are equivalent.
Conversely, A ≡ B, when A ↔ B is a tautology. For example, (p → q) ≡ (¬p ∨ q), since
(p → q) ↔ (¬p ∨ q) is a tautology, as seen from the truth Table 2.8 given below:
p q p→q ¬p ¬p ∨ q (p → q) ↔ (¬p ∨ q)
T T T F T T
T F F F F T
F T T T T T
F F T T T T
Table 2.8
(2.1) and (2.2) are known as De Morgan’s laws. Using (2.1) and (2.2), we can show that
Equation (2.3) means that the negation of a proposition is equivalent to its dual in which every
variable (primary proposition) is replaced by its negation. From Eq. (2.3), it follows that
is also a tautology.
Using (2.4) in (2.5), we get
A∗ (p1 , p2 , · · · , pn ) ↔ B∗ (p1 , p2 , · · · , pn )
is a tautology.
∴ A∗ ↔ B∗ is a tautology.
∴ A ≡ B∗
∗ ■
p q p∨q p → (p ∨ q)
T T T T
T F T T
F T T T
F F F T
Table 2.12
Similarly we note that (p → q) ⇒ (¬q → ¬p) from the following truth Table 2.13.
Table 2.13
Some important implications which can be proved by truth tables are given in Table 2.14.
Note 2.5.4 We can easily verify that if A ⇒ B and B ≡ A, then A ≡ B. Hence to prove the
equivalence of two propositions, it is enough to prove that each implies the other.
Problem 2.1 Construct a truth table for each of the following compound propositions: (p ∨ q) →
(p ∧ q);
p q p∨q p∧q (p ∨ q) → (p ∧ q)
T T T T T
T F T F F
F T T F F
F F F F T
Problem 2.2 Construct a truth table for each of the following compound propositions: (p → q) →
(q → p);
p q p→q q→ p (p → q) → (q → p)
T T T T T
T F F T T
F T T F F
F F T T T
Problem 2.3 Construct a truth table for each of the following compound propositions: (q →
¬p) ↔ (p ↔ q);
p q ¬p q → ¬q p↔q (q → ¬p) ↔ (p ↔ q)
T T F F T F
T F F T F F
F T T T F F
F F T T T T
Problem 2.4 Construct a truth table for each of the following compound propositions: (p ↔ q) ↔
((p ∧ q) ∨ (¬p ∧ ¬q));
Problem 2.5 Construct a truth table for each of the following compound propositions: (¬p ↔
¬q) ↔ (p ↔ q).
Problem 2.7 Construct the truth table for each of the compound propositions given as follows:
¬(p ∨ (q ∧ r)) ↔ ((p ∨ q) ∧ (p → r))
Problem 2.8 Construct the truth table for each of the compound propositions given as follows:
(¬p ↔ ¬q) ↔ (q ↔ r)
p q r ¬p ¬q ¬p ↔ ¬q ≡ a q↔r≡b a↔b
T T T F F T T T
T T F F F T F F
T F T F T F F T
T F F F T F T F
F T T T F F T F
F T F T F F F T
F F T T T T F F
F F F T T T T T
Problem 2.9 Construct the truth table for each of the compound propositions given as follows:
p q r s p→q (p → q) → r ((p → q) → r) → s
T T T T T T T
T T T F T T F
T T F T T F T
T T F F T F T
T F T T F T T
T F T F F T F
T F F T F T T
T F F F F T F
F T T T T T T
F T T F T T F
F T F T T F T
F T F F T F T
F F T T T T T
F F T F T T F
F F F T T F T
F F F F T F T
Proof. ■
112 Chapter 2. Predicate Calculus
Problem 2.10 Determine which of the following compound propositions are tautologies and which
of them are contradictions, using truth tables:
(i) ¬q ∧ (p → q) → p
(ii) ((p → q) ∧ (q → r)) → (p → r)
(iii) ¬(q ∨ r) ∧ r ∧ (p → q)
(iv) ((p ∨ q) ∧ (p → r) ∧ (q → r)) → r.
Proof. From Table 2.25, since the truth value of the given compound proposition is T for all
combinations of p and q, it is a tautology.
From Table 2.26, since the truth value of the given statement is T for all combinations of truth
values of p, q and r, it is a tautology.
From Table 2.27, the last column contains only F as the truth values of the given statement.
Hence it is a contradiction.
2.5 Conditional and Biconditional Propositions 113
From Table 2.28, since all the entries in the last column are T ’s, the given statement is a
tautology. ■
Proof. (i)
(ii)
(iii)
¬(p ↔ q) ≡ ¬((p → q) ∧ (q → p)), from Table 2.11
≡ ¬((¬p ∨ q) ∧ (¬q ∨ q)), from Table 2.10
≡ ¬[((¬p ∨ q) ∧ ¬q) ∨ ((¬p ∨ q) ∧ p], Distributive Law
≡ ¬[((¬p ∧ ¬q) ∨ (q ∧ ¬q)) ∨ ((¬p ∧ p)) ∨ (q ∧ p))], Distributive Law
≡ ¬[((¬p ∧ ¬q) ∨ F) ∨ ((F ∨ (q ∧ p))], Complement Law
≡ ¬[(¬p ∧ ¬q) ∨ (q ∧ p)], Identity Law
≡ ¬[(¬p ∨ q) ∨ (q ∧ p)], De Morgan’s Law
≡ (p ∨ q) ∧ ¬(q ∧ p), De Morgan’s Law (2.8)
Problem 2.13 Prove the following equivalences by proving the equivalences of the duals:
(i) ¬((¬p ∧ q) ∨ (¬p ∧ ¬q)) ∨ (p ∧ q) ≡ p
(ii) (p ∨ q) → r ≡ (p → r) ∧ (q ∧ r)
(iii) (p ∧ (p ↔ q)) → q ≡ T
(ii)
(p ∨ q) → r ≡ (p → r) ∧ (q → r)
i.e., ¬(p ∨ q) ∨ r ≡ (¬p ∨ r) ∧ (¬q ∨ r)
(iii)
(p ∧ (p ↔ q)) → q ≡ T
i.e. p ∧ ((p → q) ∧ (q → p)) → q ≡ T, from Table 2.11
i.e. p ∧ ((¬p ∨ q) ∧ (¬q ∨ p)) → q ≡ T
i.e. ¬(p ∧ ((¬p ∨ q) ∧ (¬q ∨ p))) ∨ q ≡ T
Problem 2.14 Prove the following implications by using truth tables: p → ((q → r) ⇒ (p → q) →
(p → r)
Table 2.29
Solution.
2.5 Conditional and Biconditional Propositions 117
Since e → f is a tautology, e ⇒ f . ■
Problem 2.16 Prove the following implications without using truth tables:
(i) (p ∨ q) ∧ (p → r) ∧ (q → r) ⇒ r
(ii) ((p ∨ ¬p) → q) → ((p ∨ ¬p) → r) ⇒ q → r
Proof.
■
118 Chapter 2. Predicate Calculus
Definition 2.6.2 — Disjunctive and Conjunctive Normal Forms. A product of the variables
and their negations (a conjunction of primary statements and their negations) is called an
elementary product. Similarly, a sum of the variables and their negations is called an elementary
sum.
For example, p, ¬p, p ∧ ¬p, ¬p ∧ q, p ∧ ¬q and ¬p ∧ ¬q are some elementary products in 2
variables q, ¬q, p ∨ q, p ∨ ¬q and ¬p ∨ ¬q are some elementary sums is 2 variables.
A compound proposition (or a formula) which consists of a sum of elementary products
and which is equivalent to a given proposition is called a disjunctive normal form (DNF) of the
given proposition.
A formula which consists of a product of elementary sums and which is equivalent to a
given formula is called a conjunctive normal form (CNF) of the given formula.
p → q ≡ ¬p ∨ q
p ↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q)
≡ (¬p ∨ q) ∧ (¬q ∨ p)
Step II If the negation is present before the given formula or a part of the given formula (not a
variable), De Morgan’s laws are applied so that the negation is brought before the variables
only.
Step II If necessary, the distributive law and the idempotent law are applied.
Step IV If there is an elementary product which is equivalent to the truth value F in the DNF, it is
omitted. Similarly if there is an elementary sum which is equivalent to the truth value T in
the CNF, it is omitted.
For example, the DNF of q → (q → p) is given by
q → (q → p) ≡ ¬q ∨ (q → p)
≡ ¬q ∨ (¬q ∨ p)
≡ (¬q ∨ ¬q) ∨ p [Associative Law]
≡ ¬q ∨ p ≡ p ∨ ¬q [Idempotent Law]
2.6 Normal Forms 119
∴ PCNF of p ↔ q ≡ ¬¬(p ↔ q)
≡ ¬((¬p ∧ q) ∨ (p ∧ ¬q), Form (2.10)
≡ ¬(¬p ∧ q) ∧ ¬(p ∧ ¬q), De Morgan’s law
≡ (p ∨ ¬q) ∧ (¬p ∨ q), De Morgan’s law,
Problem 2.17 Find the disjunctive normal forms of the following statements:
(i) ¬(¬(p ↔ q) ∧ r)
(ii) p ∨ (¬p → (q ∨ (q → ¬r)))
(iii) p ∧ ¬(q ∧ r) ∨ (p → q)
(iv) (p ∧ ¬(q ∨ r)) ∨ (((p ∧ q) ∨ ¬r) ∧ p)
(i)
(ii)
(iii)
(iv)
Problem 2.18 Find the conjunction normal forms of the following statements:
(i) (p ∧ ¬(q ∧ r)) ∨ (p → q)
(ii) (q ∨ (p ∧ q)) ∧ ¬((p ∨ r) ∧ q)
(iii) (p ∧ ¬(q ∨ r)) ∨ (((p ∧ q) ∨ ¬r) ∧ p
2.6 Normal Forms 121
(i)
(p ∧ ¬(q ∧ r)) ∨ (p → q)
≡ (p ∧ (¬q ∨ ¬r)) ∨ (¬p ∨ q)
≡ {(p ∧ ¬q) ∨ (p ∧ ¬r)} ∨ (¬p ∨ q) Distributive Law
≡ {(p ∨ p) ∧ (p ∨ ¬r) ∧ (¬q ∨ p) ∧ (¬q ∨ ¬r)} ∨ (¬p ∨ q) Extended Distributive Law
≡ {(p ∨ p) ∧ (p ∨ ¬r) ∧ (p ∨ ¬q)} ∧ {(¬p ∨ q ∨ ¬q ∨ ¬r)} Associative Law
≡ (p ∨ p) ∧ (p ∨ ¬r) ∧ (p ∨ ¬q) ∧ (¬p ∨ T ∨ ¬r) (p ∨ T ≡ T )
≡ (p ∨ p) ∧ (p ∨ ¬r) ∧ (p ∨ ¬q) ∧ T (p ∨ T ≡ T )
≡ p ∧ (p ∨ ¬r) ∧ (p ∨ ¬q) (p ∧ T ≡ p)
(ii)
[q ∨ (p ∧ q)] ∧ ¬[(p ∨ r) ∧ q]
≡ q ∧ ¬[(p ∨ r) ∧ q], by absorption law
≡ q ∧ [¬(p ∨ r) ∨ ¬q]
≡ q ∧ [(¬p ∧ ¬r) ∨ ¬q]
≡ q ∧ (¬p ∨ ¬q) ∧ (¬q ∨ ¬r)
(iii)
Problem 2.19 Obtain the principal disjunctive normal forms and the principal conjunctive normal
forms of the following statements using truth tables:
(i) (¬p ∨ ¬q) → (p ↔ q)
(ii) p ∨ (¬p → (q ∨ (¬q → r)))
(iii) (p → (q ∧ r)) ∧ (¬p → (¬q ∧ ¬r))
Procedure If the given statement is not a contradiction, then the disjunction (sum) of the
minterms corresponding to the rows of the truth table having truth value T is the required PDNF, as
it is equivalent to the given statement.
For example, if the truth value T of the statement corresponds to the truth values T , T and F
for the variables p, q and r respectively, then the corresponding minterm is taken as (p ∧ q ∧ ¬r).
If the given statement A is not a tautology, we can find the equivalent PCNF as follows:
We write down the PDNF of ¬A, which is the disjunction of the minterms corresponding to
the rows of the truth table having the truth value F. Then if we find ¬¬A(= A), we will get the
required PCNF of A. Equivalently the PCNF is the conjunction of maxterms corresponding to the
F values of A. But the maxterm corresponding to T, T, F value of p, q, r is [(¬p ∨ ¬q ∨ r)]
(i)
122 Chapter 2. Predicate Calculus
p q ¬p ¬q ¬p ∨ ¬q ≡ a p↔q≡b a→b
T T F F F F T
T F F T T T T
F T T F T T T
F F T T T F F
Table 2.30
PDNF of (¬p ∨ ¬q) → (p ↔ q) ≡ (p ∧ q) ∨ (p ∧ ¬q) ∨ (¬p ∧ q), since the minterms correpond-
ing to the 3 T values of the last column are p ∧ q, p ∧ ¬q, ¬p ∧ q.
Now PDNF of ¬(a → b) ≡ ¬p ∧ ¬q
∴ PCNF of (a → b) ≡ ¬(¬p ∧ ¬q) = p ∨ q
2.6 Normal Forms 123
(ii)
p q r ¬p ¬q ¬q → r ≡ a q∨a ≡ b ¬p → b ≡ c p∨c
T T T F F T T T T
T T F F F T T T T
T F T F T T T T T
T F F F T F F T T
F T T T F T T T T
F T F T F T T T T
F F T T T T T T T
F F F T T F F F F
Table 2.31
= (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r)
∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ r).
(iii)
Table 2.32
Problem 2.20 Without constructing the truth tables, find the principal disjunctive normal forms of
the following statements:
(i) (¬p → q) ∧ (q ↔ p)
(ii) (p ∧ q) ∨ (¬p ∧ q) ∨ (q ∧ r)
(iii) p ∧ ¬(q ∧ r) ∨ (p → q)
(iv) (q ∨ (p ∧ r)) ∧ ¬((p ∨ r) ∧ q)
124 Chapter 2. Predicate Calculus
(i)
(ii)
(p ∧ q) ∨ (¬p ∧ q) ∨ (q ∧ r)
≡ ((p ∧ q) ∧ (r ∨ ¬r)) ∨ ((¬p ∧ q) ∧ (r ∨ ¬r)) ∨ ((q ∧ r) ∧ (p ∨ ¬p))
≡ (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ r)
∨ (¬p ∧ q ∧ ¬r) ∨ (p ∧ q ∧ r) ∨ (¬p ∧ q ∧ r) Distributive Law
≡ (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ q ∧ ¬r) Deleting repetition
(iii)
p ∧ ¬(q ∧ r) ∨ (p → q)
≡ (p ∧ (¬q ∨ ¬r)) ∨ (¬p ∨ q)
≡ (p ∧ ¬q) ∨ (p ∧ ¬r) ∨ ¬p ∨ q
≡ (p ∧ ¬q) ∨ (p ∧ ¬r) ∨ (¬p ∧ (q ∨ ¬q)) ∨ (q ∧ (p ∨ ¬p))
≡ (p ∧ ¬q) ∨ (p ∧ ¬r) ∨ (¬p ∧ q) ∨ (¬p ∧ ¬q) ∨ (p ∧ q) ∨ (¬p ∧ q)
≡ (p ∧ ¬q) ∨ (p ∧ ¬r) ∨ (¬p ∧ q) ∨ (¬p ∧ ¬q) ∨ (p ∧ q)
[Omitting the repletion of(p ∧ q)]
≡ ((p ∧ ¬q) ∧ (r ∨ ¬r)) ∨ ((p ∧ ¬r) ∧ (q ∨ ¬q)) ∨ ((¬p ∧ q)
∧ (r ∨ ¬r)) ∨ ((¬p ∧ ¬q) ∧ (r ∨ ¬r)) ∨ ((p ∧ q) ∧ (r ∨ ¬r))
≡ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ ¬r)
∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ r) ∨ (¬p ∧ ¬q ∧ ¬r)
∨ (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r)
≡ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ r)
∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ r) ∨ (¬p ∧ ¬q ∧ ¬r) ∨ (p ∧ q ∧ r)
Since all possible minterms are present in the PDNF, we infer that the given statement is a
tautology.
(iv)
(q ∨ (p ∧ r)) ∧ ¬((p ∨ r) ∧ q)
≡ (q ∨ (p ∧ r)) ∧ (¬(p ∨ r) ∨ ¬q)
≡ (q ∨ (p ∧ r)) ∧ ((¬p ∧ ¬r) ∨ ¬q)
≡ (q ∧ ¬p ∧ ¬r) ∨ (q ∧ ¬q) ∨ (p ∧ r ∧ ¬p ∧ ¬r) ∨ (p ∧ r ∧ ¬q)
≡ (¬p ∧ q ∧ ¬r) ∨ F ∨ F ∨ (p ∧ ¬q ∧ r)
≡ (¬p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ r),
2.6 Normal Forms 125
Problem 2.21 Without constructing the truth tables, find the principal conjunctive normal forms of
the following statements:
(i) (p ∧ q) ∨ (¬p ∧ q ∧ r)
(ii) (p ∨ q) ∧ (r ∨ ¬p) ∧ (q ∨ ¬r)
(iii) (p ∨ ¬(q ∨ r)) ∨ (((p ∧ q) ∧ ¬r) ∧ p)
(iv) (p → (q ∧ r)) ∧ (¬p ∧ (¬q ∧ ¬r))
(i)
(p ∧ q) ∨ (¬p ∧ q ∧ r)
≡ ((p ∧ q) ∨ ¬p) ∧ ((p ∧ q) ∨ q) ∧ ((p ∧ q) ∨ r)
≡ (p ∨ ¬p) ∧ (q ∨ ¬p) ∧ (p ∨ q) ∧ (q ∨ q) ∧ (p ∨ r) ∧ (q ∨ r)
≡ T ∧ (¬p ∨ q) ∧ (p ∨ q) ∧ q ∧ (p ∧ r) ∧ (q ∨ r)
≡ ((¬p ∨ q) ∨ (r ∧ ¬r)) ∧ ((p ∨ q) ∨ (r ∧ ¬r)) ∧ q ∨ (p ∧ ¬p)
∧ (p ∨ r) ∨ (q ∧ ¬q) ∧ (q ∨ r) ∨ (p ∧ ¬p) (∵ A ∨ F = A)
≡ (¬p ∨ q ∨ r) ∧ (¬p ∨ q ∨ ¬r) ∧ (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r)
∧ (q ∨ p) ∧ (q ∨ ¬p) ∧ (p ∨ r ∨ q) ∧ (p ∨ r ∨ ¬q) ∧ (q ∨ r ∨ p)
∧ (q ∨ r ∨ ¬p)
≡ (¬p ∨ q ∨ r) ∧ (¬p ∨ q ∨ ¬r) ∧ (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r)
∧ (p ∨ ¬q ∨ r) ∧ ((q ∨ p) ∨ (r ∧ ¬r)) ∧ ((q ∨ ¬p) ∨ (r ∧ ¬r))
(Omitting repetitions)
≡ (¬p ∨ q ∨ r) ∧ (¬p ∨ q ∨ ¬r) ∧ (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r)
∧ (p ∨ ¬q ∨ r)(Deleting repetitions)
(ii) Let
S ≡ (p ∨ q) ∧ (r ∨ ¬p) ∧ (q ∨ ¬r)
S ≡ ((p ∨ q) ∨ (r ∧ ¬r) ∧ ((¬p ∨ r) ∨ (q ∧ ¬q)) ∧ ((q ∨ ¬r) ∨ (p ∧ ¬p))
≡ (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r) ∧ (¬p ∨ q ∨ r) ∧ (¬p ∨ ¬q ∨ r)
∧ (p ∨ q ∨ ¬r) ∧ (¬p ∨ q ∨ ¬r)
≡ (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r) ∧ (¬p ∨ q ∨ r) ∧ (¬p ∨ ¬q ∨ r)
∧ (¬p ∨ q ∨ ¬r)
(iii) Let
≡ (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r)
∨ (p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ ¬r) ∨ (p ∧ q ∧ ¬r)
126 Chapter 2. Predicate Calculus
S ≡ (p ∧ q ∧ r) ∨ (p ∧ q ∧ ¬r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r)
∨ (¬p ∧ ¬q ∧ ¬r) (2.11)
2. H1 and H2 are true in the first and third rows, but C is not true in the third row. Hence 2 is
not a valid conclusion.
p q ¬p p∨q p→q
T T F T T
T F F T F
F T T T T
F F T F T
Table 2.33
Before we give the frequently used rules of inference in the form of tautologies in a table, we state
two basic rules of inference called rules P and T.
1. Rule P A premise may be introduced at any step in the derivation.
2. Rule T A formula S may be introduced in the derivation, if S is tautologically implied by
one or more preceding formulas in the derivation.
When a set of given statements constitute a valid argument, the argument form will be presented as
in the following example: “If it rains heavily, then travel- ling will be difficult. If students arrive on
time, then travelling was not difficult. They arrived on time. Therefore, it did not rain heavily.”
Let the statements be defined as follows:
p: It rains heavily
q: Travelling is difficult
r: Students arrived on time
Now we have to show that the premises p → q, r → ¬q and r lead to the conclusion ¬p. The
form of argument given as follows shows that the premises lead to the conclusion.
128 Chapter 2. Predicate Calculus
p → (r → s) ≡ (p ∧ r) → s
Note 2.7.1 If the conclusion is of the form r → s, we will take r as an additional premise and
derive s using the given premises and r.
If H1 , H2 , H3 , . . . , Hn ⇒ C1 → C2 , using CP rule, it is enough to prove H1 , H2 , H3 , . . . , Hn ,C1 ⇒
C2 . That is, to prove ∼ P ∨ Q, ∼ Q ∨ R, R → S ⇒ P → S, it is enough to prove ∼ P ∨ Q, ∼ Q ∨ R, R →
S, P ⇒ S.
2.7.8 Example
Problem 2.22 Find whether the conclusion C follows from the premises H1 , H2 , H3 in the following
cases, using truth table technique:
1. H1 : ¬p, H2 : p ∨ q,C : p ∧ q
2. H1 : p ∨ q, H2 : p → r, H3 : q → r,C : r
Proof.
p q H1 ≡ ¬p H2 ≡ p ∨ q H1 ∧ H2 C ≡ p∧q
T T F T F T
T F F T F F
F T T T T F
F F T F F F
Table 2.35
From table 2.35 H1 and H2 and hence H1 ∧ H2 are true in the third row, in which C is false.
Hence C does no follow from H1 and H2 .
p q r H1 (p ∨ q) H2 (p → r) H3 (q → r) H1 ∧ H2 ∧ H3
T T T T T T T
T T F T F F F
T F T T T T T
T F F T F T F
F T T T T T T
F T F T T F F
F F T F T T F
F F F F T T F
Table 2.36
From table 2.36 H1 , H2 , H3 and hence H1 ∧ H2 ∧ H3 are true in the first, third and fifth rows in
which r is also true.
Hence C follows from H1 , H2 and H3 . ■
Problem 2.23 Show that (t ∧ s) can be derived from the premises p → q, q → ¬r, r, p ∨ (t ∧ s).
Proof.
Problem 2.24 Show that (a ∨ b) follows logically from the premises p ∨ q, (p ∨ q) → ¬r, ¬r →
(s ∧ ¬t) and (s ∧ ¬t) → (a ∨ b).
Proof.
Proof. ■
Proof. ■
Problem 2.27 Give a direct proof for the implication p → (q → s), (¬r ∨ p), q ⇒ (r → s).
Proof. ■
Problem 2.28 Derive p → (q → s) using the CP-rule (if necessary) from the premises p → (q → r)
and q → (r → s).
Proof. We shall assume p as an additional premise. Using p and the two given premises, we will
derive (q → s). Then, by CP-rule, p → (q → s) is deemed to have been derived from the two given
premises.
132 Chapter 2. Predicate Calculus
Problem 2.29 Use the indirect method to show that r → ¬q, r ∨ s, s → ¬q, p → q ⇒ p.
Proof. To use the indirect method, we will include ¬¬p ≡ p as an additional premise and prove a
contradiction.
Step No. Statement Rule Steps Involved Reason
1. p P (additional)
2. p→q P
3. q T 1, 2 Modus Ponens
4. r → ¬q P
5. s → ¬q P
6. (r ∨ s) → ¬q T 4, 5 Equivalence
7. r∨s P
8. ¬q T 6, 7 Modus Ponens
9. q ∧ ¬q T 3, 8 Conjunction
10. F T 9 Negation Law
Problem 2.30 Show that b can be derived from the premises a → b, c → b, d → (a ∨ c), d, by the
indirect method.
Let us include ¬b as an additional premise and prove a contradiction.
Proof. ■
2.7 Theory of Inference 133
Problem 2.31 Using indirect method of proof, derive p → ¬s from the premises p → (q ∨ r),
q → ¬p, s → ¬r, p.
Proof. Let us include ¬(p → ¬s) as an additional premise and prove a contradiction.
Now ¬(p → ¬s) = ¬(¬p ∨ ¬s) = p ∧ s
Hence the additional premise to be introduced may be taken as p ∧ s.
Proof. If we derive a contradiction by using the given premises, it means that they are inconsistent.
Problem 2.33 Prove that the premises a → (b → c), d → (b ∧ ¬c) and (a ∧ d) are inconsistent.
Problem 2.34 Construct an argument to show that the following premises imply the conclusion “it
rained”.
“If it does not rain or if there is no traffic dislocation, then the sports day will be held and the
cultural programme will go on”; “If the sports day is held, the trophy will be awarded" and “the
trophy was not awarded”.
■
2.8 Predicate Calculus or Predicate Logic 135
Problem 2.35 Show that the following set of premises is inconsistent: If Ravi gets his degree, he
will go for a job. If he goes for a job, he will get married soon. If he goes for higher study, he will
not get married. Ravi gets his degree and goes for higher study.
2.8.1 Quantifiers
Many mathematical statements assert that a property is true for all values of a variable in a
particular domain, called the universe of discourse. Such a statement is expressed using a universal
quantification. The universal quantification of P(x) is the statement.
“P(x) is true for all values of x in the universe of discourse” and is denoted by the notation
(x)P(x) or ∀ xP(x). The proposition (x)P(x) or ∀xP(x) is read as “for all x, P(x)” or “for every x,
P(x)”. The symbol ∀ is called the universal quantifier.
136 Chapter 2. Predicate Calculus
(2.13) is a proposition and not a propositional function, even though a variable x appears in it. We
need not replace x by a number to obtain a statement. The truth value of ∀xP(x) is T .
Examples
1. If P(x) ≡ {(−x)2 = x2 }, where the universe consists of all integers, then the truth value of
∀x((−x)2 = x2 ) is T .
2. If Q(x) ≡ “2x > x′′ , where the universe consists of all real numbers, then the truth value of
∀xQ(x) is F. For x = 0 the truth value is F.
3. If P(x) ≡ “x2 < 10′′ , where the universe consists of the positive integers 1, 2, 3 and 4, then
∀xP(x) = P(1) ∧ P(2) ∧ P(3) ∧ P(4) and so the truth value of ∀xP(x) = T ∧ T ∧ T ∧ F = F.
Note 2.8.2 We have so far applied universal quantification to propositional functions of
a single variable only. Universal quantification (and also existential quantification, that is
discussed below) can be applied to compound propositional functions such as P(x) ∧ Q(x),
P(x) → Q(x), ¬P(x), P(x) ∨ ¬Q(x) etc. and to propositional functions of many variables, as
given in the following examples.
4. Let P(x) ≡ x is an integer and Q(x) ≡ x is either positive or negative. Then P(x) → Q(x)
is a compound propositional function. Obviously ∀x(P(x) → Q(x)), where the universe of
discourse consists of integers.
5. Let P(x, y) : x is taller than y.
If x is taller than y, then y is not taller than x. viz. P(x, y) → ¬P(y, x)
As this assertion is true for all x and y, it can be symbolically represented as
Examples
1. When P(x) denotes the propositional function “x > 3”, the truth value of ∃xP(x) is T , where
the universe of discourse consists of all real numbers, since “x > 3” is true for x = 4.
Note 2.8.3 When the elements of the universe of discourse is finitely many, viz., consists
of x1 , x2 , · · · , xn , then ∃xP(x) is the same as the disjunction P(x1 ) ∨ P(x2 ) ∨ · · · ∨ P(xn ), since
this disjunction is true if and only if at least one of P(x1 ), P(x2 ), · · · , P(xn ) is true.
2. When P(x) denotes “x2 > 10”, where the universe of discourse consists of the positive
integers not exceeding 4, then the truth value of ∃xP(x) is T , since P(1) ∨ P(2) ∨ P(3) ∨ P(4)
is true as P(4) [viz., 42 > 10] is true.
Similarly, ∃xP(x) means that “there is a student in the class who has studied computer pro-
gramming “The negation of this statement is “Every student in this class has not studied computer
programming”, which is denoted by ∀x¬P(x). Thus we get
¬∃xP(x) ≡ ∀x¬P(x)
Further we note that ¬∀xP(x) is true, when there is an x for which P(x) is false and false when P(x)
is true for every x, since
¬∀xP(x) ≡ ∃x¬P(x)
≡ ¬P(x1 ) ∨ ¬P(x2 ) · · · ∨ ¬P(xn )
¬∃xP(x) is true, when P(x) is false for every x and false when there is an x for which P(x) is true,
since
¬∃xP(x) ≡ ∀x¬P(x)
≡ ¬P(x1 ) ∧ ¬P(x2 ) · · · ∧ ¬P(xn )
From the meaning of quantifiers and by (2.14) and (2.15) the following simplifications hold good:
Note 2.8.4 The negation of multiply quantified predicate formulas may be obtained by applying
the rules for negation (given earlier) from left to right. Thus
Examples
Table 2.37
(∀xR(x)) ∨ (¬∀xR(x)) ≡ T
(∀xR(x) → ∃xS(x)) ↔ ((¬∀xR(x)) ∨ ∃xS(x)) ≡ T
More generally, all the implications and equivalences of the statement calculus can also be consid-
ered as implications and equivalences of the predicate calculus if we replace elementary statements
by primary predicate formulas. For example,
(2.16), (2.17) and (2.18) are some examples for valid formulas in predicate calculus.
Apart from the types of valid formulas given above, there are other valid formulas also which
involve quantifiers. Such valid formulas are obtained by using the inference theory of predicate
logic, discussed below:
of derivation, we require two rules of specification, called US and ES rules. Once the quantifiers
are eliminated, the derivation is similar to that in statement calculus. If it becomes necessary to
quantify the desired conclusion, we require two rules of generalisation, called UG and EG rules.
Rule US Universal Specification is the rule of inference which states that one can conclude that
P(c) is true, if ∀xP(x) is true, where c is an arbitrary member of the universe of discourse. This
rule is also called the universal instantiation.
Rule ES Existential Specification is the rule which allows us to conclude that P(c) is true, if
∃xP(x) is true, where c is not an arbitrary member of the universe, but one for which P(c) is true.
Usually we will not know what c is but know that it exists. Since it exists, we may call it c. This
rule is also called the existential instantiation.
Rule UG Universal Generalisation is the rule which states that ∀xP(x) is true, if P(c) is true,
where c is an arbitrary member (not a specific member) of the universe of discourse.
Rule EG Existential Generalisation is the rule that is used to conclude that ∃xP(x) is true when
P(c) is true, where c is a particular member of the universe of discourse.
■ Example 2.1 Let us consider the following “Famous Socrates argument” which is given by:
H(x): x is a man
M(x): x is a mortal
s: Socrates
■ Example 2.2 Application of any of US, ES, UG and EG rules wrongly may lead to a false
conclusion from a true premise as in the following example.
Let D(u, v) : u is divisible by v, where the universe of discourse is (5, 6, 10, 11).
Then ∃uD(u, 5) is true, since D(5, 5) and D(10, 5) are true.
But ∀uD(u, 5) is false, since D(6, 5) and D(11, 5) are false.
We now give the following derivation:
■
140 Chapter 2. Predicate Calculus
Note 2.8.5 In step (3), UG has been applied wrongly, since c is not an arbitrary member in step
(2), as c(= 5 or 10) is only a specific member of the given universe of discourse.
2.8.5 Examples
Problem 2.36 If L(x, y) symbolises the statement “x loves y”, where the universe of discourse
for both x and y consists of all people in the world, translate the following English sentences into
logical expressions:
(a) Every body loves z.
(b) Every body loves somebody.
(c) There is somebody whom everybody loves.
(d) Nobody loves everybody.
(e) There is somebody whom no one loves.
¬∃x∀yL(x, y) ≡ ∀x¬∀yL(x, y)
≡ ∀x∃y¬L(x, y)
(e) The sentence means that there is somebody whom every one does not love. Hence
¬∀x∃yL(x, y) ≡ ∃x¬∃yL(x, y)
≡ ∃x∀y¬L(x, y)
Problem 2.37 Express each of the following statements using mathematical and logical opera-
tions, predicates and quantifiers, where the universe of discourse consists of all computer science
students/mathematics courses.
(a) Every computer science student needs a course in mathematics.
(b) There is a student in this class who owns a personal computer.
(c) Every student in this class has taken at least one mathematics course.
(d) There is a student in this class who has taken at least one mathematics course.
Proof. (a) Let M(x) ≡ ‘x needs a course in mathematics’, where the universe of discourse consists
of all computer science students. Then ∀xM(x).
(b) Let P(x) ≡ ‘x owns a personal computer’, where the universe consists of all students in this
class. Then ∃xP(x)
(c) Let Q(x, y) ≡ ‘x has taken y’, where the universe of x consists of all students in this class and
that of y consists of all mathematics courses. Then ∀x∃yQ(x, y)
(d) Using the same assumptions as in (c), we have ∃x∃yQ(x, y). ■
Problem 2.38 Express the negations of the following statements using quantifiers and in English:
(a) If the teacher is absent, then some students do not keep quiet.
(b) All the students keep quiet and the teacher is present.
(c) Some of the students do not keep quiet or the teacher is absent.
2.8 Predicate Calculus or Predicate Logic 141
Proof. (a) Let T represent the presence of the teacher and Q(x) represent “x keeps quiet”. Then the
given statement is:
i.e., the teacher is absent and all the students keep quiet.
(b) The given statement is:
∀xQ(x) ∧ T
¬(∀xQ(x) ∧ T ) ≡ ¬∀xQ(x) ∨ ¬T
≡ ∃xQ(x) ∨ ¬T
∃x¬Q(x) ∨ ¬T ≡ ¬∀xQ(x) ∨ ¬T
¬(¬∀xQ(x) ∨ ¬T ) ≡ ∀xQ(x) ∧ T
i.e., All the students keep quiet and the teacher is present.
(d) Let D(x, y) represent “x has done problem y”. The given statement is
Problem 2.39 Show that the premises “one student in this class knows how to write programs in
JAVA” and “Everyone who knows how to write programs in JAVA can get a high-paying job” imply
the conclusion “Someone in this class can get a high-paying job”.
Proof. Let C(x) represent “x is in this class” J(x) represent “x knows JAVA programming” and
H(x) represent “x can get a high paying job”.
Then the given premises are ∃x(C(x)∧J(x)) and ∀x(J(x) → H(x)). The conclusion is ∃x(C(x)∧
H(x)).
142 Chapter 2. Predicate Calculus
Problem 2.40 Show, by indirect method of proof, that ∀x(p(x) ∨ q(x)) ⇒ (∀xp(x)) ∨ (∃xq(x)).
Proof. Let us assume that [(∀xp(x)) ∨ (∃xq(x))] as an additional premise and prove a contradiction.
Problem 2.41 Prove that ∀x(P(x) → (Q(y) ∧ R(x))), ∃xP(x) ⇒ Q(y) ∧ ∃x(P(x) ∧ R(x)).
Proof. ■
2.8 Predicate Calculus or Predicate Logic 143
Problem 2.42 Show that the conclusion ∀x(P(x) → ¬Q(x)) follows from the premises ∃x(P(x) ∧
Q(x)) → ∀y(R(y) → S(y)) and ∃y(R(y) ∧ ¬S(y)).
Proof. ■
Problem 2.43 Prove the derivation ∃xP(x) → ∀x((P(x) ∨ Q(x)) → R(x)), ∃xP(x), ∃xQ(x) ⇒
∃x∃y(R(x) ∧ R(y))
Proof. ■
Problem 2.44 Prove the implication ∀x(P(x) → Q(x)), ∀x(R(x) → ¬Q(x)) ⇒ ∀x(R(x) → ¬P(x)).
144 Chapter 2. Predicate Calculus
Proof. ■
Problem 2.45 Use the indirect method to prove that the conclusion ∃zQ(z) follows from the
premises ∀x(P(x) → Q(x)) and ∃yP(y).
Proof. Let us assume the additional premise ¬(∃zQ(z)) and prove a contradiction
Problem 2.46 Show that ∀x(P(x) ∨ Q(x)) ⇒ ∀xP(x) ∨ ∃xQ(x), using the indirect method.