03-Logic31
03-Logic31
Computer Science
3-1
Propositional Equivalences
Predicates and Quantifiers
3-2
1.2 Propositional Equivalence
A tautology is a compound proposition that is true
no matter what the truth values of its atomic
propositions are!
e.g. p p (“Today the sun will shine or today the
3-3
Logical Equivalence
Compound proposition p is logically
equivalent to compound proposition q,
written p q or p q, iff the compound
proposition p q is a tautology.
3-4
Proving Equivalence
via Truth Tables
Prove that (p q) p q. (De Morgan’s law)
p q pq p q p q (p q)
T T T F F F F
T F F F T T T
F T F T F T T
F F F T T T T
Show that Check out the solution in the textbook!
(p q) p q (De Morgan’s law)
p → q p q
p (q r) (p q) (p r) (distributive law)
3-5
Equivalence Laws
3-6
Equivalence Laws
Identity: pTp pFp
Domination: pTT pFF
Idempotent: ppp ppp
Double negation: p p
Commutative: p q q p pqqp
Associative: (p q) r p (q r)
(p q) r p (q r)
3-7
More Equivalence Laws
Distributive: p (q r) (p q) (p r)
p (q r) (p q) (p r)
De Morgan’s:
(p q) p q
(p q) p q
Absorption
p (p q) p p (p q) p
Trivial tautology/contradiction:
p p T p p F
Implies: p q p q
Biconditional: p q (p q) (q p)
p q (p q)
3-10
Another Example Problem
3-13
Topic #1 – Propositional Logic
Atomic propositions: p, q, r, …
Boolean operators:
Compound propositions: (p q) r
Equivalences: pq (p q)
Proving equivalences using:
Truth tables
equivalences) p q r
3-14
Topic #3 – Predicate Logic
Predicate Logic
Consider the sentence
“For every x, x 0”
If this were a true statement about the positive
integers, it could not be adequately symbolized
using only statement letters, parentheses and
logical connectives.
The sentence contains two new features: a
predicate and a quantifier
3-15
Topic #3 – Predicate Logic
Propositional Functions
Predicate logic generalizes the grammatical
notion of a predicate to also include
propositional functions of any number of
arguments, each of which may take any
grammatical role that a noun can take.
e.g.:
3-18
Topic #3 – Predicate Logic
Examples
Let P(x): x > 3. Then
P(4) is TRUE/FALSE 4>3
P(2) is TRUE/FALSE 2>3
Let Q(x, y): x is the capital of y. Then
Q(Washington D.C., U.S.A.) is TRUE
Q(Hilo, Hawaii) is FALSE
Q(Massachusetts, Boston) is FALSE
Q(Denver, Colorado) is TRUE
Q(New York, New York) is FALSE
Read EXAMPLE 6 (pp.33)
If x > 0 then x:= x + 1 (in a computer program)
3-19