Title: CS1502 Formal Methods in Computer Science
1CS1502 Formal Methods in Computer Science
- Lecture Notes 2
- Introduction to Logic
- Part 2
2What is an argument?
- A series of statements in which one (called the
conclusion) is meant to follow from the others
(called the premises). - Not talking about the type of argument
3Fitch-style Argument
premises
conclusion
4Valid Argument
- A valid argument is one that guarantees the truth
of its conclusion on the assumption that the
premises are true. - A valid argument ensures the conclusion is true
provided the premises are true. - Often written premises conclusion
5Valid Argument - Example
- Large(b) v Cube(b) ?Cube(b) Large(b)
?
6Sound Argument
- If an argument is valid and its premises are
true, then the argument is said to be sound.
7Sound Argument
8Argument is not sound
9ExamplesWhich are valid? Sound?
- (worked out in lecture)
- All men are mortal. Socrates is a man. So,
Socrates is Mortal. - Bill is a man. After all, Bill is mortal and all
men are mortal. - All women are taller than all men. Ralph is a
woman and Bill is a man. Therefore, Ralph is
taller than Bill.
10ExamplesWhich are valid? Sound?
- Since this class meets Tuesday after 1245pm, it
is January. - Tom Hanks is a good actor. After all, all rich
actors are good actors, and Tom Hanks is a rich
actor.
11Methods of Proof
- Formal We will use a Fitch-style proof employed
in the software. - Informal This style of proof, used by
mathematicians, is just as rigorous. It consists
of sentences describing the situation at hand,
the inferences being made, and the justification
of each inference. - Difference? The amount of explicit detail.
12What constitutes a proof?
- Proof that P1,P2,,Pn Q is
- a step-by-step demonstration showing that Q must
be true in any circumstances in which all of
P1,P2,,Pn are true.
13Fitch-style Proof
14Proof Rules
- Proof rules are used to construct proofs (both
formal and informal) - That is, each step but the premises has to be
justified by a proof rule - As we introduce more pieces of FOL, we will
introduce more proof rules - Well start now with proof rules involving
identity
15Rules
- EliminationIf b c and P(b) then P(c).
- Introductiona a
- Symmetry of IdentityIf a b then b a.
- Transitivity of IdentityIf a b and b c then
a c
16 Elimination
17 Introduction
18Symmetry of Identity
1)2)3)
a a
Introduction
b a
Elimination 1, 2
19(No Transcript)
20Example Formal Proof
1)2)3)4) 5)6)
Smaller(b,a)
Ana Con 1
Introduction
c c
b c
Elim 2, 4
Smaller(c,a)
Elim 5, 3
21Explicit Proof of Ana Con step
This is a look ahead we havent seen these
proof rules before.
Note As this is displaying, the line is in the
wrong place. It should be between lines 2 and 3.
22Example Informal Proof
Prove If a is smaller than b and c is identical
to b then c is larger than a.
Since we are given that a is smaller than b, it
follows that b must be larger than a. Moreover,
since c is identical to b, it follows that c must
be larger than a.
QED