SEHH2241 Lecture 2
SEHH2241 Lecture 2
SEHH2241 Lecture 2
1 Logical Connectives
Let p and q be some propositions. Then the
(1) Negation of p is the statement not p, denoted by ¬p. The truth table is
p ¬p p q p∨q p q p↔q
(1) T F , T T T T T T
F T (3) T F T , (5) T F F
F T T F T F
F F F F F T
p q p∧q p q p→q
T T T T T T
(2) T F F , (4) T F F
F T F F T T
F F F F F T
1
Let p → q. Then
2 Tautologies
• A proposition is called a tautology if it always has the true value no matter what truth
values of its propositional variables are.
p p→p
Example. p → p is a tautology as its truth table T T has T value in all cases.
F T
Example. p → q, ¬(p ∧ ¬q) and ¬q → ¬p are logically equivalent as they have the same truth table
2
For statement p, q and r, we have
Identity: p ∧ T ⇐⇒ p p ∨ F ⇐⇒ p
Domination: p ∨ T ⇐⇒ T p ∧ F ⇐⇒ F
Idempotent: p ∨ p ⇐⇒ p p ∧ p ⇐⇒ p
Double negation: ¬¬p ⇐⇒ p
Commutative: p ∨ q ⇐⇒ q ∨ p p ∧ q ⇐⇒ q ∧ p
Associative: (p ∨ q) ∨ r ⇐⇒ p ∨ (q ∨ r) (p ∧ q) ∧ r ⇐⇒ p ∧ (q ∧ r)
Distributive: p ∨ (q ∧ r) ⇐⇒ (p ∨ q)∧ p ∧ (q ∨ r) ⇐⇒ (p ∧ q)∨
(p ∨ r) (p ∧ r)
De Morgan’s: ¬(p ∧ q) ⇐⇒ ¬p ∨ ¬q ¬(p ∨ q) ⇐⇒ ¬p ∧ ¬q
tautology/contradiction: p ∨ ¬p ⇐⇒ T p ∧ ¬p ⇐⇒ F
Exercise 2. Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent by (i) truth table
and (ii) developing a series of logical equivalences.
3
3 Rules of Inference
Let p1 , p2 , · · · , pn , q be statements. Then
p1
p2
..
.
pn
∴ q
p→q
p
p
q
∴ q
∴ p∧q
(2) Modus tollens (MT):
¬q
p→q
∴ ¬p
q→r
(3) Addition (Add): ∴ p→r
p
∴ p∨q (7) Disjunction (Disj):
4
Example. We want to show that the following argument is valid.
p→q
q→r
¬r
∴ ¬p
Solution.
Step Reason
1. p→q premise
2. q→r premise
3. ¬r premise / ∴ ¬p
4. p→r 1,2 HS
5. ¬p 3,4 MT
"
p→q
r→s
(q ∨ s) → t
¬t
∴ ¬(p ∨ r)
Solution. Let
p : You send me an e-mail message.
5
Then we have
Step Reason
1. p→q premise
2. ¬p → r premise
3. r→s premise / ∴ ¬q → s
4. ¬q → ¬p contrapositive of 1
5. ¬q → r 2,4 HS
6. ¬q → s 3,5 HS
"
4 Resolution
• A clause is a compound statement with terms separated by “or”, and each term is a
single variable or the negation of a single variable.
p∨q
¬p ∨ r
∴ q∨r
Solution. Let
p : Jasmine is skiing.
q : It is snowing.
6
Then we have
Step Reason
1. p ∨ ¬q premise
2. q∨r premise / ∴ p ∨ r
3. ¬q ∨ p 1 commutative
4. p∨r 2,3 resolution
"
(p ∧ q) ∨ r
r→s
∴ p∨s