Académique Documents
Professionnel Documents
Culture Documents
DISCRETE STRUCTURES
WonSook Lee
wslee@uottawa.ca
EECS, Univ. of Ottawa
The lecture note is collaborative work, and
large contribution is from Prof. Nejib Zaguia
1/10/18 1
Propositional logic
• (§1.1-1.2-1.3)
• Review from Mat 1348
2
Propositional logic: Review
4
Topic #1 – Propositional Logic
Proposition?
• “It is raining.”
• “Who’s there?”
• “Beijing is the capital of China.”
• “La la la la la.”
• “Just do it!”
• “1 + 2 = 3”
• “1 + 2”
• “Yeah, I sorta dunno, whatever...”
5
Topic #1 – Propositional Logic
6
Topic #1.0 – Propositional Logic: Operators
Operators /
Connectives
An operator or connective combines one or more operand
expressions into a larger expression. (E.g., “+” in numeric exprs.)
7
Topic #1.0 – Propositional Logic: Operators
Ù F
T
T
F
F
F
T T T
¬ and Ù operations together are sufficient to
express any Boolean truth table!
8
Topic #1.0 – Propositional Logic: Operators
Nested Propositional
Expressions
• Use parentheses to group sub-expressions:
“I just saw my old friend, and either he’s
grown or I’ve shrunk.” = f Ù (g Ú s)
– (f Ù g) Ú s would mean something
different
– f Ù g Ú s would be ambiguous
• By convention, “¬” takes precedence over
both “Ù” and “Ú”.
– ¬s Ù f means (¬s) Ù f , not ¬ (s Ù f)
10
Topic #1.0 – Propositional Logic: Operators
A Simple Exercise
p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
Translate each of the following into English:
¬p = “It didn’t rain last night.”
r Ù ¬p = “The lawn was wet this morning, and
it didn’t rain last night.”
¬rÚpÚq =
“Either the lawn wasn’t wet this
morning, or it rained last night, or
the sprinklers came on last night.”
11
Topic #1.0 – Propositional Logic: Operators
13
Topic #1.0 – Propositional Logic: Operators
Natural Language is
Ambiguous
Note that English “or” can be ambiguous
regarding the “both” case!
p q p "or" q
“Pat is a singer or
Pat is a writer.” - Ú F F F
“Pat is a man or F T T
Pat is a woman.” - Å T F T
T T ?
Need context to disambiguate the meaning!
For this class, assume “or” means inclusive.
14
Topic #1.0 – Propositional Logic: Operators
16
Topic #1.0 – Propositional Logic: Operators
17
Topic #1.0 – Propositional Logic: Operators
19
Topic #1.0 – Propositional Logic: Operators
Some Alternative
Notations
20
Topic #1.1 – Propositional Logic: Equivalences
Propositional Equivalence
(§1.2)
Two syntactically (i.e., textually) different
compound propositions may be the
semantically identical (i.e., have the same
meaning). We call them equivalent.
Learn:
• Various equivalence rules or laws.
• How to prove equivalences using
symbolic derivations.
21
Topic #1.1 – Propositional Logic: Equivalences
Tautologies and
Contradictions
A tautology is a compound proposition
that is true no matter what the truth
values of its atomic propositions are!
Ex. p Ú ¬p [What is its truth table?]
A contradiction is a compound proposition
that is false no matter what!
Ex. p Ù ¬p [Truth table?]
Logical Equivalence
Compound proposition p is logically equivalent
to compound proposition q, written pÛq,
IFF
the compound proposition p«q is a tautology.
Proving Equivalence
via Truth Tables
24
Topic #1.1 – Propositional Logic: Equivalences
Equivalence Laws
• These are similar to the arithmetic
identities you may have learned in
algebra, but it is for propositional
equivalences instead.
• They provide a pattern or template
that can be used to match all or part of
a much more complicated proposition
and to find an equivalence for it.
25
Topic #1.1 – Propositional Logic: Equivalences
26
Topic #1.1 – Propositional Logic: Equivalences
More Equivalence pÚ(qÚr) (pÚq)Úr
Laws pÚ(qÙr) ?
• Distributive:
pÚ(qÙr) Û (pÚq)Ù(pÚr)
pÙ(qÚr) Û (pÙq)Ú(pÙr)
• De Morgan’s:
Augustus
¬(pÙq) Û ¬p Ú ¬q De Morgan
¬(pÚq) Û ¬p Ù ¬q (1806-1871)
• Trivial tautology/contradiction:
p Ú ¬p Û T p Ù ¬p Û F
27
Topic #1.1 – Propositional Logic: Equivalences
An Example Problem
• Check using a symbolic derivation whether
(p Ù ¬q) ® (p Å r) Û ¬p Ú q Ú ¬r.
(p Ù ¬q) ® (p Å r) [Expand definition of ®]
Û ¬(p Ù ¬q) Ú (p Å r) [Expand defn. of Å]
Û ¬(p Ù ¬q) Ú ((p Ú r) Ù ¬(p Ù r))
[DeMorgan’s Law]
Û (¬p Ú q) Ú ((p Ú r) Ù ¬(p Ù r))
cont.
29
Topic #1.1 – Propositional Logic: Equivalences
Example Continued...
(¬p Ú q) Ú ((p Ú r) Ù ¬(p Ù r)) Û [Ú commutes]
Û (q Ú ¬p) Ú ((p Ú r) Ù ¬(p Ù r)) [Ú associative]
Û q Ú (¬p Ú ((p Ú r) Ù ¬(p Ù r))) [distrib. Ú over Ù]
Û q Ú (((¬p Ú (p Ú r)) Ù (¬p Ú ¬(p Ù r))) [assoc.]
Û q Ú (((¬p Ú p) Ú r) Ù (¬p Ú ¬(p Ù r))) [trivail taut.]
Û q Ú ((T Ú r) Ù (¬p Ú ¬(p Ù r))) [domination]
Û q Ú (T Ù (¬p Ú ¬(p Ù r))) [identity]
Û q Ú (¬p Ú ¬(p Ù r)) Û cont.
30
Topic #1.1 – Propositional Logic: Equivalences
33
Topic #1 – Propositional Logic
• Atomic propositions: p, q, r, …
• Boolean operators: ¬ Ù Ú Å ® «
• Compound propositions:s :º (p Ù ¬q)Ú r
• Equivalences: pÙ¬q Û ¬(p ® q)
• Proving equivalences using:
– Truth tables.
– Symbolic derivations. p Û q Û r …
34
1/10/18 35