Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
Logic
1
In the beginning
Aristotle +/- 350 B.C.
Organon
19 syllogisms
2
In the beginning
Aristotle +/- 350 B.C.
Organon
19 syllogisms
Logic = study of correct reasoning
2
Barbara syllogism
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
3
Barbara syllogismonly later called so,in the Middle Ages
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
3
Barbara syllogismonly later called so,in the Middle Ages
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
from the two premises
3
Barbara syllogismonly later called so,in the Middle Ages
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
from the two premises
one can always conclude the
conclusion
3
Barbara syllogismonly later called so,in the Middle Ages
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
from the two premises
one can always conclude the
conclusion
independent of what the parameters K,L,M are
3
Barbara syllogismonly later called so,in the Middle Ages
All K’s are L’sAll L’s are M’s
———————All K’s are M’s
from the two premises
one can always conclude the
conclusion
independent of what the parameters K,L,M are
Logic (Logos, Greek for word, understanding, reason) deals with general reasoning laws in the form of formulas with parameters.
3
Propositions
4
Propositions
Def. A proposition (Aussage) is a grammatically correct sentence that is either true or false.
4
Propositions
Def. A proposition (Aussage) is a grammatically correct sentence that is either true or false.
logic deals with patterns! what matters are not particular
propositions but the way in which (abstract) propositions
are combined and what follows from them
4
Propositions
Def. A proposition (Aussage) is a grammatically correct sentence that is either true or false.
logic deals with patterns! what matters are not particular
propositions but the way in which (abstract) propositions
are combined and what follows from them
Connectives
∧ for “and”∨ for “or”¬ for “not”⇒ for “if .. then” or “implies”
⇔ for “if and only if”
4
Abstract propositions
5
Abstract propositions
Definition
Basis Propositional variables are abstract propositions.
Step (Case 1) If P is an abstract proposition, then so is (¬P).
Step (Case 2) If P and Q are abstract propositions, then so are (P ∧ Q), (P ∨ Q), (P ⇒ Q), and (P ⇔ Q).
5
Abstract propositions
a recursive/inductivedefinition
Definition
Basis Propositional variables are abstract propositions.
Step (Case 1) If P is an abstract proposition, then so is (¬P).
Step (Case 2) If P and Q are abstract propositions, then so are (P ∧ Q), (P ∨ Q), (P ⇒ Q), and (P ⇔ Q).
5
…and their structure
⇒
∧¬
a b c
6
…and their structure
the tree of((a ∧ b) ⇒ (¬c))
⇒
∧¬
a b c
6
…and their structure
the tree of((a ∧ b) ⇒ (¬c))
⇒
∧¬
a b c
building
6
…and their structure
the tree of((a ∧ b) ⇒ (¬c))
⇒
∧¬
a b c
building
decomposing
6
…and their structure
tree representation(no need of parenthesis)
the tree of((a ∧ b) ⇒ (¬c))
⇒
∧¬
a b c
building
decomposing
6
Dropping parenthesis
¬∧ ∨⇒⇔
7
Dropping parenthesis
priority schema(top binds the most)
¬∧ ∨⇒⇔
7
Dropping parenthesis
priority schema(top binds the most)
increasing priority
¬∧ ∨⇒⇔
7
Dropping parenthesis
priority schema(top binds the most)
increasing priority
decreasing priority¬∧ ∨⇒⇔
7
Dropping parenthesis
Example: ((a ∧ b) ⇒ (¬c))
becomes a ∧ b ⇒ ¬cpriority schema
(top binds the most)
increasing priority
decreasing priority¬∧ ∨⇒⇔
7
Truth tables
Conjunction
P Q P∧Q
0 0 0
0 1 0
1 0 0
1 1 1
8
Truth tables
Conjunction
P Q P∧Q
0 0 0
0 1 0
1 0 0
1 1 1
8
Truth tables
Conjunction
P Q P∧Q
0 0 0
0 1 0
1 0 0
1 1 1 only true when both P and Q are true
8
Truth tables
Disjunction
P Q P∨Q
0 0 0
0 1 1
1 0 1
1 1 1
9
Truth tables
Disjunction
P Q P∨Q
0 0 0
0 1 1
1 0 1
1 1 1
9
Truth tables
Disjunction
P Q P∨Q
0 0 0
0 1 1
1 0 1
1 1 1
true when either P or Q or both are
true
9
Truth tables
Negation
10
Truth tables
Negationunary connective
10
Truth tables
Negation
P ¬P
0 1
1 0
unary connective
10
Truth tables
Negation
P ¬P
0 1
1 0
unary connective
10
Truth tables
Negation
P ¬P
0 1
1 0
true when P is false
unary connective
10
Truth tables
Implication
11
Truth tables
Implicationneeds more attention
11
Truth tables
Implication
P Q P ⇒ Q
0 0 1
0 1 1
1 0 0
1 1 1
needs more attention
11
Truth tables
Implication
P Q P ⇒ Q
0 0 1
0 1 1
1 0 0
1 1 1
needs more attention
11
Truth tables
Implication
P Q P ⇒ Q
0 0 1
0 1 1
1 0 0
1 1 1
only false when P is true and Q is false
needs more attention
11
Truth tables
Bi-implication
12
Truth tables
Bi-implication
P⇔Q
is (P ⇒ Q)∧(Q ⇒ P)
12
Truth tables
Bi-implication
P Q P ⇒ Q Q ⇒ P P ⇔ Q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
P⇔Q
is (P ⇒ Q)∧(Q ⇒ P)
12
Truth tables
Bi-implication
P Q P ⇒ Q Q ⇒ P P ⇔ Q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
P⇔Q
is (P ⇒ Q)∧(Q ⇒ P)
12
Truth tables
Bi-implication
P Q P ⇒ Q Q ⇒ P P ⇔ Q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
P⇔Q
is (P ⇒ Q)∧(Q ⇒ P)
12
Truth tables
Bi-implication
P Q P ⇒ Q Q ⇒ P P ⇔ Q
0 0 1 1 1
0 1 1 0 0
1 0 0 1 0
1 1 1 1 1
P⇔Q
is (P ⇒ Q)∧(Q ⇒ P)
true when P and Q have the same truth
value
12
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
13
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
Property: Every abstract proposition P(a1,..,an) induces a truth-function.
13
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
Property: Every abstract proposition P(a1,..,an) induces a truth-function.
by its inductive structure, using the
truth tables
13
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
Property: Every abstract proposition P(a1,..,an) induces a truth-function.
by its inductive structure, using the
truth tables
{Notation in the book… a, b(0,0) ⟼ 0
(0,1) ⟼ 1
(1,0) ⟼ 0
(1,1) ⟼ 1 13
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
Property: Every abstract proposition P(a1,..,an) induces a truth-function.
by its inductive structure, using the
truth tables
P(a,b): (a ∧ b) ∨ b{Notation in the book… a, b(0,0) ⟼ 0
(0,1) ⟼ 1
(1,0) ⟼ 0
(1,1) ⟼ 1 13
Truth-functionsDef. A truth-function or Boolean function is a function f: {0,1}n ⟶ {0,1}
Property: Every abstract proposition P(a1,..,an) induces a truth-function.
by its inductive structure, using the
truth tables
a1, .. an are the variables in P (and more) ordered in a sequence
P(a,b): (a ∧ b) ∨ b{Notation in the book… a, b(0,0) ⟼ 0
(0,1) ⟼ 1
(1,0) ⟼ 0
(1,1) ⟼ 1 13
Truth-functions
Property: Every abstract proposition P(a1,..,an) with ordered and specified variables induces a truth-function.
a1, .. an are the variables in P (and more) ordered in a sequence
P(a,b,c):
induces
(a ∧ b) ∨ b
The sequence of specified variables matters!
Note: a, b, c(0,0,0) ⟼ 0
(0,0,1) ⟼ 0
(0,1,0) ⟼ 1
(0,1,1) ⟼ 1
(1,0,0) ⟼ 0
(1,0,1) ⟼ 0
(1,1,0) ⟼ 1
(1,1,1) ⟼ 1
14
Equivalence of propositions
15
Equivalence of propositions
Definition: Two abstract propositions P and Q are equivalent, notation P = Q, iff they induce the same truth-functionval
on any sequence containing their common variables
15
Equivalence of propositions
Property: The relation = is an equivalence on the set of all abstract propositions
val
Definition: Two abstract propositions P and Q are equivalent, notation P = Q, iff they induce the same truth-functionval
on any sequence containing their common variables
15
Equivalence of propositions
Property: The relation = is an equivalence on the set of all abstract propositions
val
i.e., for all abstract propositions P, Q, R, (1) P = P; (2) if P = Q, then Q = P; and
(3) if P = Q and Q = R, then P = Rval val val
valvalval
Definition: Two abstract propositions P and Q are equivalent, notation P = Q, iff they induce the same truth-functionval
on any sequence containing their common variables
15
Exampleb b c cAre the following equivalent? and
0 0
0 1
1 0
1 1
b b c ccb b c
16
Exampleb b c cAre the following equivalent? and
0 0 1
0 1 1
1 0 0
1 1 0
b b c ccb b c
17
Exampleb b c cAre the following equivalent? and
0 0 1 1
0 1 1 0
1 0 0 1
1 1 0 0
b b c ccb b c
18
Exampleb b c cAre the following equivalent? and
0 0 1 1 0
0 1 1 0 0
1 0 0 1 0
1 1 0 0 0
b b c ccb b c
19
Exampleb b c cAre the following equivalent? and
0 0 1 1 0 0
0 1 1 0 0 0
1 0 0 1 0 0
1 1 0 0 0 0
b b c ccb b c
20
Exampleb b c cAre the following equivalent? and
0 0 1 1 0 0
0 1 1 0 0 0
1 0 0 1 0 0
1 1 0 0 0 0
b b c ccb b c
Their truth values are the same, so they are equivalentb b
valc c
21
Tautologies and contradictions
22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
Def. An abstract proposition P is a contradiction iff its truth-function is constant 0.
22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
Def. An abstract proposition P is a contradiction iff its truth-function is constant 0.
Def. An abstract proposition P is a contingency iff it is neither a tautology nor a contradiction.22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
Def. An abstract proposition P is a contradiction iff its truth-function is constant 0.
Def. An abstract proposition P is a contingency iff it is neither a tautology nor a contradiction.
all tautologies areequivalent
22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
Def. An abstract proposition P is a contradiction iff its truth-function is constant 0.
Def. An abstract proposition P is a contingency iff it is neither a tautology nor a contradiction.
all tautologies areequivalent
all contradictions are equivalent
22
Tautologies and contradictions
Def. An abstract proposition P is a tautology iff its truth-function is constant 1.
Def. An abstract proposition P is a contradiction iff its truth-function is constant 0.
Def. An abstract proposition P is a contingency iff it is neither a tautology nor a contradiction.
all tautologies areequivalent
all contradictions are equivalentbut not all
contingencies!
22
Abstract propositions
a recursive/inductivedefinition
Definition
Basis (Case 1) T and F are abstract propositions.Basis (Case 2) Propositional variables are abstract propositions.
Step (Case 1) If P is an abstract proposition, then so is (¬P).Step (Case 2) If P and Q are abstract propositions, then so are (P ∧ Q), (P ∨ Q), (P ⇒ Q), and (P ⇔ Q).
23
Propositional LogicStandard Equivalences
24
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
25
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Qval
Q P
P Q P Q Q P0 1 1 0
26
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Q Rval
P Q R
P Q Rval
P Q R
P Q Rval
P Q R
Associativity
27
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Q Rval
P Q R
P Q Rval
P Q R
P Q Rval
P Q R
Associativity
P Q Rval
P Q R
28
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Q Rval
P Q R
P Q Rval
P Q R
P Q Rval
P Q R
Associativity
P Q Rval
P Q R
P Q R P Q R P Q R
29
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Q Rval
P Q R
P Q Rval
P Q R
P Q Rval
P Q R
Associativity
P Q Rval
P Q R
P Q R P Q R P Q R0 1 0
30
Commutativity and Associativity
P Qval
Q P
P Qval
Q P
P Qval
Q P
Commutativity
P Q Rval
P Q R
P Q Rval
P Q R
P Q Rval
P Q R
Associativity
P Q Rval
P Q R
P Q R P Q R P Q R0 1 0 0 1
31
Idempotence and Double Negation
Idempotence
P Pval
P
P Pval
P
P Pval
P
P Pval
P
32
Idempotence and Double Negation
Idempotence
P Pval
P
P Pval
P
P Pval
P
P Pval
P
Double negation
Pval
P
33
T and F
Inversion
Tval
F
Fval
T
34
T and F
Inversion
Tval
F
Fval
T
Negation
Pval
P F
35
T and F
Inversion
Tval
F
Fval
T
Negation
Pval
P F
Contradiction
P Pval
F
36
T and F
Inversion
Tval
F
Fval
T
Negation
Pval
P F
Contradiction
P Pval
F
Excluded Middle
P Pval
T37
T and F
Inversion
Tval
F
Fval
T
Negation
Pval
P F
Contradiction
P Pval
F
Excluded Middle
P Pval
T
T/F - elimination
P Tval
P Fval
P Tval
P Fval
38
T and F
Inversion
Tval
F
Fval
T
Negation
Pval
P F
Contradiction
P Pval
F
Excluded Middle
P Pval
T
T/F - elimination
P Tval
P
P Fval
F
P Tval
T
P Fval
P
39
Distributivity, De Morgan
Distributivity
P Q Rval
P Q P R
P Q Rval
P Q P R
40
Distributivity, De Morgan
Distributivity
P Q Rval
P Q P R
P Q Rval
P Q P R
De Morgan
P Qval
P Q
P Qval
P Q
41
Implication and Contraposition
Implication
P Qval
P Q
P Qval
P Q
42
Implication and Contraposition
Implication
P Qval
P Q
P Qval
P Q
Contraposition
P Qval
Q P
43
Implication and Contraposition
Implication
P Qval
P Q
P Qval
P Q
Contraposition
P Qval
Q P P Qval
P Q
common mistake!
44
Bi-implication and Self-equivalence
Bi-implication
P Qval
P Q Q P
45
Bi-implication and Self-equivalence
Bi-implication
Self-equivalence
P Qval
P Q Q P
P Pval
46
Bi-implication and Self-equivalence
Bi-implication
Self-equivalence
P Qval
P Q Q P
P Pval
T
47
Calculating with equivalent propositions
(the use of standard equivalences)
48
Recall…
Definition: Two abstract propositions P and Q are equivalent, notation P = Q, iff they induce the same truth-functionval
Property: The relation = is an equivalence on the set of all abstract propositions.
val
on any sequence containing their common variables
i.e., for all abstract propositions P, Q, R, (1) P = P; (2) if P = Q, then Q = P; and
(3) if P = Q and Q = R, then P = Rval val val
valvalval
49
Substitution
Simple
50
Substitution
Simple
EVERY occurrence of P is substituted!
50
Substitution
Simple Sequential
EVERY occurrence of P is substituted!
50
Substitution
Simple Sequential
Simultaneous EVERY occurrence of P is substituted!
50
Substitution
Simple Sequential
Simultaneous EVERY occurrence of P is substituted!
meta rule
50
The rule of Leibnitz
Leibnitz
51
The rule of Leibnitz
Leibnitz
single occurrence is
replaced!
51
The rule of Leibnitz
Leibnitz
single occurrence is
replaced!formula that has
as a sub formula
51
The rule of Leibnitz
Leibnitz
single occurrence is
replaced!
meta rule
formula that has as a sub formula
51
Strengthening and
weakening
52
We hadDefinition: Two abstract propositions P and Q are equivalent, notation P = Q, iff (1) Always when P has truth value 1, also Q has truth value 1, and (2) Always when Q has truth value 1, also P has truth value 1.
val
53
We hadDefinition: Two abstract propositions P and Q are equivalent, notation P = Q, iff (1) Always when P has truth value 1, also Q has truth value 1, and (2) Always when Q has truth value 1, also P has truth value 1.
val
if we relax this, we get
strengthening
53
We hadDefinition: Two abstract propositions P and Q are equivalent, notation P = Q, iff (1) Always when P has truth value 1, also Q has truth value 1, and (2) Always when Q has truth value 1, also P has truth value 1.
val
if we relax this, we get
strengthening
in an equivalentformulation
53
Strengthening
Definition: The abstract proposition P is stronger than Q, notation P = Q, iff (1) Always when P has truth value 1, also Q has truth value 1, and (2) Always when Q has truth value 1, also P has truth value 1.
val
54
Strengthening
Definition: The abstract proposition P is stronger than Q, notation P = Q, iff (1) Always when P has truth value 1, also Q has truth value 1, and (2) Always when Q has truth value 1, also P has truth value 1.
val
Q is weaker than P
54
Strengthening
Definition: The abstract proposition P is stronger than Q, notation P = Q, iff always when P has truth value 1, also Q has truth value 1.
val
55
Strengthening
Definition: The abstract proposition P is stronger than Q, notation P = Q, iff always when P has truth value 1, also Q has truth value 1.
val
always when P is true, Q is also true
55
Strengthening
Definition: The abstract proposition P is stronger than Q, notation P = Q, iff always when P has truth value 1, also Q has truth value 1.
val
Q is weaker than P
always when P is true, Q is also true
55
Properties
56
Properties
Lemma E1: iff is a tautology.
56
Properties
Lemma E1: iff is a tautology.
Lemma EW1: iff and .
56
Properties
Lemma W2: Pval
|ù P
Lemma E1: iff is a tautology.
Lemma EW1: iff and .
56
Properties
Lemma W2: Pval
|ù P
Lemma W3: If and then Pval
|ù Q Qval
|ù R Pval
|ù R
Lemma E1: iff is a tautology.
Lemma EW1: iff and .
56
Properties
Lemma W2: Pval
|ù P
Lemma W3: If and then Pval
|ù Q Qval
|ù R Pval
|ù R
Lemma E1: iff is a tautology.
Lemma EW1: iff and .
Lemma W4: iff is a tautology.
56
Standard Weakenings
and-or-weakening
Extremes
57
Calculating with weakenings(the use of standard weakenings)
58
Substitution
Sequential
Simultaneous
Simple
�r⇠{P sval
|ù r⇠{P s
59
Substitution
Sequential
Simultaneous
just holds
Simple
�r⇠{P sval
|ù r⇠{P s
59
Substitution
Sequential
Simultaneous EVERY occurrence of P is substituted!
just holds
Simple
�r⇠{P sval
|ù r⇠{P s
59
The rule of Leibnitz
Leibnitz
formula that has as a sub formula
does not hold for weakening!
60
Leibnitzdoes not hold for weakening!
Monotonicity
The rule of Leibnitz
61