0% found this document useful (0 votes)
8 views

rules-of-inference

Uploaded by

kmm.malavika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

rules-of-inference

Uploaded by

kmm.malavika
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

lOMoARcPSD|48965296

1.4 Rules of inference

Bachelor of Computer Applications (Mahatma Gandhi University)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by Malavika Jayakumar ([email protected])
lOMoARcPSD|48965296

1.4 RULES OF INFERENCE


Definitions: An argument in propositional logic is a
sequence of propositions. All but the final proposition in the
argument are called premises and the final proposition is
called the conclusion . An argument is valid if the truth of all its
premises implies that the conclusion is true. An argument form
in propositional logic is a sequence of compound propositions
involving propositional variables.
From the definition of a valid argument form ,the argument
form with premises 𝑝1, 𝑝2,...., 𝑝𝑛 and conclusion q is valid , when
(𝑝1 ∧ 𝑝2 ∧...... ∧ 𝑝𝑛) → 𝑞 is a tautology.
Rules of Inference for Propositional Logic.
Rule of inference is a logical form consisting of a function
which takes premises , analyses their syntax ,and returns a
conclusion.

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

Example 1: State which rule of inference is the basis of the


following argument. “ It is below freezing now . Therefore,it is
either below freezing or raining now.”
Ans. Let p be the proposition “It is below freezing now” and q
be the proposition “It is raining now” . Then this argument is of
the form p .
∴p∨ 𝑞 This is an argument that uses the addition rule.
Example 2 : State which rule of inference is the basis of the
following argument. “ It is below freezing and raining now .
Therefore ,it is below freezing now.”
Ans. Let p be the proposition “It is below freezing now,” and let
q be the proposition “It is raining now”. This argument is of the
form p∧ 𝑞.
∴p This argument uses the simplification rule.
Example 3: Which rule of inference is used in the argument:
If it rains today,then we will not have a barbecue today. If we
do not have a barbecue today, then we will have a barbecue
tomorrow. Therefore , if it rains today, then we will have a
barbecue tomorrow.
Ans. Let p be the proposition ‘It is raining today’ , q be the
proposition ‘We will have a barbecue today’ and r be the
proposition ‘We will have a barbecue tomorrow’.Then this
argument is of the form
p →ㄱq
ㄱq → r
∴p →r
Hence this argument is a hypothetical syllogism.
Using Rules of Inference to Build Arguments
Example 1: Show that the hypothesis “ It is not sunny this
afternoon and it is colder than yesterday.” “We will go swimming
only if it is sunny.” “If we do not go swimming , then we will
take a canoe trip.” and “If we take a canoe trip ,then we will be

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

home by sunset “ lead to the conclusion “We will be home by


sunset.”
Ans. Let p be the proposition”It is sunny this afternoon”
q be the proposition “It is colder than yesterday”
r be the proposition “We will go swimming”
s be the proposition “We will take a canoe trip”
t be the proposition ‘We will be home by sunset”
Then the hypotheses become ¬𝑝 ∧ 𝑞, 𝑟 → 𝑝, ¬𝑟 → 𝑠 𝑎𝑛𝑑 𝑠 → 𝑡.
The conclusion is t.
We construct an argument to show that our hypotheses lead to
the desired conclusion as follows.
Step Reason
1. ¬𝑝 ∧ 𝑞 Hypothesis
2. r → 𝑝 Hypothesis
3. ¬𝑝 Simplification using (1)
4. ¬𝑟 Modus tollens using
(2) and (3)
5. ¬𝑟 → 𝑠 Hypothesis
6. s Modus ponens using
(4) and (5)
7. s→ 𝑡 Hypothesis
8. t Modus ponens using
(6) and (7)
Example 2: Show that the following argument is valid.If today is
Tuesday, I have a test in Mathematics or Economics.If my
Economics Professor is sick , I will not have a test in
Economics. Today is Tuesday and my Economics Professor is
sick. Therefore I have a test in Mathematics.
Ans. Let p denote “Today is Tuesday”.
q denote “I have a test in Mathematics”
r denote “I have a test in Economics”
s denote “My Economics Professor is sick”

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

Then the hypotheses become p → (𝑞 ∨ 𝑟), 𝑠 → ¬𝑟, 𝑎𝑛𝑑 𝑝 ∧ 𝑠


. The conclusion is q.
We construct an argument as follows.
Step Reason
1. p→ (𝑞 ∨ 𝑟) Hypothesis
2. s→ ¬𝑟 Hypothesis
3. p∧ 𝑠 Hypothesis
4. p Simplification using (3)
5. s Simplification using (3)
6. q∨ 𝑟 Modus ponens using
(1) and (4)
7. ¬𝑟 Modus ponens using
(2) and (5)
8. q Disjunctive syllogism using
(6) and (7)
H. W. Problem.
Example 3: Show that the following argument is valid. If Mohan
is a lawyer, then he is ambitious. If Mohan is an early riser,then
he does not like idlis. If Mohan is ambitious ,then he is an early
riser . Then if Mohan is a lawyer, then he does not like idlis.
Example 4: Show that the hypotheses “If you send me an
e-mail message ,then I will finish writing the program” “If you do
not send me an e-mail message ,then I will go to sleep early”
and “If I go to sleep early, then I will wake up feeling refreshed”
lead to the conclusion “If I do not finish writing the program ,
then I will wake up feeling refreshed”.
Ans. Let p be the proposition”You send me an e-mail message”
q be the proposition”I will finish writing the program”
r be the proposition”I will go to sleep early”
s be the proposition”I will wake up feeling refreshed”
The hypotheses are p→ 𝑞, ¬𝑝 → 𝑟, 𝑟 → 𝑠.The conclusion is
¬𝑞 → 𝑠

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

We construct an argument to the desired conclusion as follows.


Step Reason
1. p→ 𝑞 Hypothesis
2. ¬𝑝 → 𝑟 Hypothesis
3. r→ 𝑠 Hypothesis
4. ¬𝑝 → 𝑠 Hypothetical Syllogism
using (2) and (3)
5. ¬𝑞 → ¬𝑝 Contrapositive of (1)
6. ¬𝑞 → 𝑠 Hypothetical syllogism
using (4) and (5)
Resolution Principle
The resolution principle is one way of proving an
argument is valid or not. A variable or negation of a
variable is called a literal. A disjunction of literals is called
a sum and a conjunction of literals is called a product.A
clause is a disjunction of literals. For any two clauses
𝐶1 𝑎𝑛𝑑 𝐶2, if there is a literal
𝐿1 𝑖𝑛 𝐶1𝑡ℎ𝑎𝑡 𝑖𝑠 𝑐𝑜𝑚𝑝𝑙𝑒𝑚𝑒𝑛𝑡𝑎𝑟𝑦 𝑡𝑜 𝑎 𝑙𝑖𝑡𝑒𝑟𝑎𝑙 𝐿2 𝑖𝑛 𝐶2 ,then
delete 𝐿1𝑎𝑛𝑑 𝐿2from 𝐶1 𝑎𝑛𝑑 𝐶2 respectively and construct
the disjunction of the remaining clauses. The constructed
clause is a resolvent of 𝐶1 𝑎𝑛𝑑 𝐶2.
To use the resolution rule, we proceed as follows.
Step 1: Turn each premise and the negated conclusion
into conjunctive normal form.( ie, the formula is
written as a conjunction of clauses where each
clause is a disjunction of propositions or negated
propositions)
1. Remove ↔ 𝑎𝑛𝑑 → 𝑠𝑦𝑚𝑏𝑜𝑙𝑠 by using
A ↔ 𝐵 ≡ (𝐴 → 𝐵) ∧ (𝐵 → 𝐴)
A→ 𝐵 ≡ ¬𝐴 ∨ 𝐵
2. Multiply out negation sign by De-Morgan’s law.

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

3. Distribute A ∨ (𝐵 ∧ 𝐶) ≡ (𝐴 ∨ 𝐵) ∧ (𝐴 ∨ 𝐶)
Step 2: Each premise is now a conjunction of one or more
clauses. Write each clause on a separate line.
Step 3: Apply resolution rule by taking two clauses which
contain the same atom with opposite signs.
Step 4: We continue until we get both a proposition, and its
negation, so that we can resolve these together to
get the empty clause.
Example1: Using resolution rule prove
𝑝 ∨ 𝑞, 𝑝 → 𝑟, 𝑎𝑛𝑑 𝑞 → 𝑠 ∴ r∨ 𝑠
Ans. I.Convert the premises to normal form and write them on
separate lines.
𝐶1: p∨ 𝑞
𝐶2: ¬𝑝 ∨ 𝑟
𝐶3 : ¬𝑞 ∨ 𝑠
II. Negate the conclusion and convert it to the normal form
¬(𝑟 ∨ 𝑠) ≡ ¬𝑟 ∧ ¬𝑠
𝐶4: ¬𝑟∧ ¬𝑠
𝐶5: ¬𝑟
𝐶6: ¬𝑠
III. Deduce the clause by resolution
𝐶7: ¬𝑃 𝑓𝑟𝑜𝑚 𝐶2 𝑎𝑛𝑑 𝐶5
𝐶8: 𝑞 𝑓𝑟𝑜𝑚 𝐶1 𝑎𝑛𝑑 𝐶7
𝐶9: ¬𝑞 𝑓𝑟𝑜𝑚 𝐶3 𝑎𝑛𝑑 𝐶6
𝐶10: ◻ 𝑓𝑟𝑜𝑚 𝐶8 𝑎𝑛𝑑 𝐶9
Hence the argument is correct.
Example 2: By resolution rule prove
~ (p∧~q), (~q∨r), ~r ⊢ ~p

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

Ans. Convert each premise into normal form and write on


separate lines.
𝐶1 : ~p ∨ q
𝐶2: ~q ∨ r
𝐶3: ~r
Negate the conclusion and convert it into normal form
𝐶4: 𝑝
Deduce the empty clause by resolution
𝐶5: 𝑞 from 𝐶1𝑎𝑛𝑑 𝐶4
𝐶6: 𝑟 from 𝐶2 𝑎𝑛𝑑 𝐶5
𝐶7: ⬜ from 𝐶3𝑎𝑛𝑑 𝐶6
Hence the argument is valid.
Example 3: Prove by resolution rule (p∧ 𝑞) → 𝑟 , ¬𝑟 ∨ ¬𝑠 , s
∴ ¬𝑝 ∨ ¬𝑞
Ans. Convert each premise into normal form and write on
separate lines.
(𝑝 ∧ 𝑞) → 𝑟 ≡ ¬(𝑝 ∧ 𝑞) ∨ 𝑟
≡ ¬𝑝 ∨ ¬𝑞 ∨ 𝑟
𝐶1: ¬𝑝 ∨ ¬𝑞 ∨ 𝑟
𝐶2: ¬𝑟 ∨ ¬𝑠
𝐶3: 𝑠
Negate the conclusion and convert it into normal form
¬(¬𝑝 ∨ ¬𝑞) ≡ 𝑝 ∧ 𝑞
𝐶4: 𝑝∧ 𝑞
𝐶5: 𝑝
𝐶6: 𝑞
𝐶7: ¬𝑟 from 𝐶2 𝑎𝑛𝑑 𝐶3

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

𝐶8: ¬𝑞 ∨ 𝑟 from 𝐶1 𝑎𝑛𝑑 𝐶5


𝐶8: 𝑟 from 𝐶6 𝑎𝑛𝑑 𝐶8
𝐶9: ⬜ from 𝐶7 𝑎𝑛𝑑 𝐶8
Hence the argument is valid .
Example 4: Prove by resolution rule
¬𝑝 ∨ 𝑞 , ¬𝑞 ∨ 𝑟, 𝑟 → 𝑠. ∴ 𝑝→𝑠
Ans. Convert each premise into normal form and write on
separate line
𝐶1: ¬𝑝 ∨ 𝑞
𝐶2: ¬𝑞 ∨ 𝑟
r→ 𝑠 ≡ ¬𝑟 ∨ 𝑠
𝐶3: ¬𝑟 ∨ 𝑠
¬(𝑝 → 𝑠) ≡ ¬(¬𝑝 ∨ 𝑠) ≡ 𝑝 ∧ ¬𝑠
𝐶4: 𝑝 ∧ ¬𝑠
𝐶5: 𝑝
𝐶6: ¬𝑠
𝐶7: 𝑞 𝑓𝑟𝑜𝑚 𝐶1 𝑎𝑛𝑑 𝐶5
𝐶8: 𝑟 𝑓𝑟𝑜𝑚 𝐶2 𝑎𝑛𝑑 𝐶7
𝐶9: 𝑠 𝑓𝑟𝑜𝑚 𝐶3 𝑎𝑛𝑑 𝐶8
𝐶10: 🀰 𝑓𝑟𝑜𝑚 𝐶6 𝑎𝑛𝑑 𝐶9
Hence the argument is valid.
Rules of Inference for Quantified Statements

Rule of inference Name


∀𝑥 𝑃(𝑥)
Universal instantiation
∴ P(c)

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

P(c) for an arbitrary c


Universal generalization
∴ ∀𝑥 𝑃(𝑥)
∃𝑥 𝑃(𝑥)
Existential instantiation
∴ P(c) for some element c
P(c) for some element c
Existential generalization
∴∃𝑥 𝑃(𝑥)

Example : Show that the premises “Everyone in this discrete


mathematics class has taken a course in computer science “
and “Maria is a student in this class” imply the conclusion
“Maria has taken a course in computer science”.
Ans. Let D(x) denote “x is in this discrete mathematics class”
and let C(x) denote “x has taken a course in computer science”
Then the premises are ∀𝑥 (𝐷(𝑥) → 𝐶(𝑥))𝑎𝑛𝑑 𝐷(𝑀𝑎𝑟𝑖𝑎) .
The conclusion is C(Maria).
Step Reason
1. ∀𝑥(𝐷(𝑥) → 𝐶(𝑥)) Premise
2. D(Maria)→ 𝐶(𝑀𝑎𝑟𝑖𝑎) Universal instantiation
from (1)
3. D(Maria) Premise
4. C(Maria) Modus ponens from
(2) and (3)
Example : Show that the premises “ A student in this class has
not read the book” and “Everyone in this class passed the first
exam” imply the conclusion “ Someone who passed the first
exam has not read the book”
Ans . Let C(x) be “x is in this class” B(x) be “x has read the
book” and P(x) be “x passed the first exam”. The premises are
∃𝑥(𝐶(𝑥) ∧ ¬𝐵(𝑥)) 𝑎𝑛𝑑 ∀𝑥(𝐶(𝑥) → 𝑃(𝑥)). The conclusion is

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

∃𝑥(𝑃(𝑥) ∧ ¬𝐵(𝑥))
Step Reason
∃𝑥(𝐶(𝑥) ∧ ¬𝐵(𝑥)) Premise
C(a) ∧ ¬𝐵(𝑎) Existential instantiation from1
3.C(a) Simplification from 2
4¬𝐵(𝑎) Simplification from 2
5∀𝑥(𝐶(𝑥) → 𝑃(𝑥)) Premise
6C(a) → 𝑃(𝑎) Universal instantiation from 5
7P(a) Modus ponens from 3and 6
8P(a)∧ ¬𝐵(𝑎) Conjunction from 7and 4
9∃𝑥(𝑃(𝑥) ∧ ¬𝐵(𝑥)) Existential generalization
from 8
Example : Show that the premises “All fish can swim” and
“Eel is a fish” imply the conclusion “Eel can swim”
Ans. Let F(x) denote ‘x is a fish’,S(x) denote ‘x can swim’. ∴the
premises are ∀𝑥(𝐹(𝑥) → 𝑆(𝑥)) and F(Eel). The conclusion is
S(Eel).
Step Reason
1. ∀𝑥(𝐹(𝑥) → 𝑆(𝑥)) 𝑃𝑟𝑒𝑚𝑖𝑠𝑒
2. F(Eel)→ 𝑆(𝐸𝑒𝑙) 𝑈𝑛𝑖𝑣𝑒𝑟𝑠𝑎𝑙 𝑖𝑛𝑠𝑡𝑎𝑛𝑡𝑖𝑎𝑡𝑖𝑜𝑛 𝑓𝑟𝑜𝑚
1
3 F(Eel) Premise
4. S(Eel) Modus ponens from 2and 3
Example : Express A ↔ 𝐵 𝑖𝑛 disjunctive normal form
Ans. 𝐴 ↔ 𝐵 ≡ (𝐴 → 𝐵) ∧ (𝐵 → 𝐴)
≡ (¬𝐴 ∨ 𝐵) ∧ (¬𝐵 ∨ 𝐴)
≡ ((¬𝐴 ∨ 𝐵) ∧ ¬𝐵) ∨ ((¬𝐴 ∨ 𝐵) ∧ 𝐴)
≡ (¬𝐴 ∧ ¬𝐵) ∨ (𝐵 ∧ ¬𝐵) ∨ (¬𝐴 ∧ 𝐴) ∨ (𝐵 ∧ 𝐴)
≡ (¬𝐴 ∧ ¬𝐵) ∨ 𝐹𝑎𝑙𝑠𝑒 ∨ 𝐹𝑎𝑙𝑠𝑒 ∨ (𝐵 ∧ 𝐴)
≡ (¬𝐴 ∧ ¬𝐵) ∨ (𝐵 ∧ 𝐴)
Example : Obtain the disjunctive normal form of
(𝑝 → 𝑞) ∧ ¬𝑞 ≡ (¬𝑝 ∨ 𝑞) ∧ ¬𝑞

Downloaded by Malavika Jayakumar ([email protected])


lOMoARcPSD|48965296

≡ (¬𝑝 ∧ ¬𝑞) ∨ (𝑞 ∧ ¬𝑞)

Downloaded by Malavika Jayakumar ([email protected])

You might also like