Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
What
is
logic?
Logic is a truth-preserving system of inference
Truth-preserving: If the initial statements are true, the inferred statements will be true System: a set of mechanistic transformations, based on syntax alone Inference: the process of deriving (inferring) new statements from old statements
Proposi0onal
Logic
An
argument
is
a
sequence
of
proposi0ons:
Premises
(Axioms)
are
the
rst
n
proposi0ons
Conclusion
is
the
n+1th
(nal)
proposi0on.
An
argument
is
valid
if
(
p
1
"
p
2
"
...
"
p
n
)
#
q
is
a
tautology,
given
that
p
i
s
are
the
premises
q (axioms)
and
is
the
conclusion
!
Hello World
If the conclusion is true in the truth table whenever the premises are true, it is proved
n
Warning: when the premises are false, the conclusion my be true or false
Rules
of
Inference
n
A rule of inference is a pre-proved rela0on: any 0me the leH hand side (LHS) is true, the right hand side (RHS) is also true. Therefore, if we can match a premise to the LHS (by subs0tu0ng proposi0ons), we can assert the (subs0tuted) RHS
( p " ( p # q)) # q
p q
p p#q " q
1 1 1 1
0 0 ! ! 1 1
0 1 ! 0 1
1 0 1 ! 0 ! 0 0 1 1
Example
Given
(p)
If
it
is
raining,
then
(q)
the
grass
is
wet.
(p)
It
is
raining.
Example
rule:
A,
AB
B
n n
Read as A and AB, therefore B This rule has a name: modus ponens Subs0tute C for A, D for B Apply modus ponens Conclude D
Rules of Inference
Logical Equivalences
A
Simple
Proof
n n
1. 2. 3. 4. 5. 6. 7.
z
z ! w w
Reason Given (Premise) Given (Premise) Hypothetical Syllogism (1) & (2) Given (Premise) Modus Ponens (3) & (4) Given (Premise) Disjunctive Syllogism (5) & (6)
Axioms:
n n n
AB(CD) A C D
Conclusion:
n
Example
Given:
Conclude:
Proof
of
Example
Step 1. p " q 2. p 3. r " p 4. r 5. r " s 6. s 7. s " t 8. t Reason Premise Simplification using (1) Premise Modus Tollens (2) & (3) Premise Modus Ponens (4) & (5) Premise Modus Ponens (6) & (7)
! !
Another
Example
Given:
Conclude:
q " s
r"s
q " s
! !
n n n n n n n
By 2nd DeMorgans By 1st DeMorgans By double negation By 2nd distributive By definition of By commutative law By definition of