Logic review
wff: well-formed formulas (way to represent facts)
(e.g. * P U Q is not a wff)
It is raining RAINING
It is sunny SUNNY
If it is raining then it is not sunny
RAINING -> NOT(SUNNY)
Represent as P and Q: Truth Tables
| AND | OR | Implication
|
| P * Q | P U Q | P ==> Q
|
Do table for ((P * Q) -> R) -> (P -> (Q -> R))
Tautologies (same values in truth tables) = (equivalent - prove it with truth tables) The statements below are equivalent (deMorgan's)
~ ( P U Q) = ~P * ~Q ~( P * Q) = ~P U ~Q
Distributive Law
P U ( Q * S) = (P U Q) * (P U S)
P * (Q U S) = (P * Q) U (P * S)
Associative Law
P U Q U S (order is irrelevant)
deMorgans
~ (P U Q) = ~P * ~Q
~ (P * Q) = ~P U ~Q
Modes Ponens Modes Tolens
P -> Q P --> Q
P ~Q
Q ~P
~ (~P) <-> P
Very useful
Disjunctive Syllogism
P U Q
~P
Q
Constructive Dilemma
P --> Q ~P --> Q
R --> S P --> R
P U R Q U R
Q U S
statements written as wff
but variables are used to represent objects (only)
Man (Plato)
Man ( x )
Quantifiers
For all
~
~
examples of representing statements in logic
All A are B =>
Second Order Predicate Calculus
variables are used to represent ??
Computable Predicates (augmentation)
gt(1,0) ... do not want to write all truths
Theorem Proving
* represent statements in predicate logic - not always easy!
(note the difference between p -> q and p * q
p -> q is still a true statement is p if False)
p -> q = ~p U q (show tautology)
It is not true that for all x Px --> Qx means
There exists an x such that ~ (Px --> Qx) means
There exists an x such that ~ (~ Px U Qx)
DeMorgans says this is Px * ~Qx
Notice this is NOT equivalent to: For all x Px -->~Qx
or There exists x where Px -->~Qx
So "Gentlemen are not always rich" can be said as
"It is not true that gentlemen are always rich"
Which reduces to "There exists someone who is a gentleman and who
is not rich"
Resolution Theorem Proving
pre: logical representation of facts
1. convert to clause form
2. negate S (statement to prove) and convert to clause form
3. resolve
Remember Constructive Dilemma
~P --> Q
P --> R
Q U R
(proof by contradiction)