natural deduction cs 270 math foundations of cs jeremy johnson

Post on 04-Jan-2016

224 Views

Category:

Documents

6 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Natural Deduction

CS 270 Math Foundations of CSJeremy Johnson

Outline

1. An example1. Validity by truth table2. Validity by proof

2. What’s a proof1. Proof checker

3. Rules of natural deduction4. Provable equivalence5. Soundness and Completeness

An Example

• If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station.

• If it is raining and Jane does not have here umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her.

An Example

• If the train arrives late and there are no taxis at the station, then John is late for his meeting. John is not late for his meeting. The train did arrive late. Therefore, there were taxis at the station.

• p = the train arrives late• q = there are taxis at the station• r = John is late for his meeting.• [a sequent]

An Example

• p = it is raining• q = Jane has her umbrella• r = Jane gets wet.

• If it is raining and Jane does not have here umbrella with her, then she will get wet. Jane is not wet. It is raining. Therefore, Jane has her umbrella with her.

Validity by Truth Table

p q r q r pq (pq)r

F F F T T F T

F F T T F F T

F T F F T F T

F T T F F F T

T F F T T T F

T F T T F T T

T T F F T F T

T T T F F F T

Proof

• By applying rules of inference to a set of formulas, called premises, we derive additional formulas and may infer a conclusion from the premises

• A sequent is 1,…,n • Premises 1,…,n

• Conclusion • The sequent is valid if a proof for it can be

found

Proof

• A proof is a sequence of formulas that are either premises or follow from the application of a rule to previous formulas

• Each formula must be labeled by it’s justification, i.e. the rule that was applied along with pointers to the formulas that the rule was applied to

• It is relatively straightforward to check to see if a proof is valid

Validity by Deduction

1 premise

2 premise

3 premise

4 assumption

5 ,4

6 r e 1,5

7 e 6,2

8 q 4-7

9 q e 8

Rules of Natural Deduction

• Natural deduction uses a set of rules formally introduced by Gentzen in 1934

• The rules follow a “natural” way of reasoning about

• Introduction rules• Introduce logical operators from premises

• Elimination rules• Eliminate logical operators from premise

producing a conclusion without the operator

Conjunction Rules

• Introduction Rule

• Elimination Rule

i

e1

e2

Implication Rules

• Introduction Rule

Assume and show

• Elimination Rule (Modus Ponens)

e

… i

Disjunction Rules

• Introduction Rule

• Elimination Rule (proof by case analysis)

i1

e

i2

Negation Rules

• Introduce the symbol ( to encode a contradiction

• Bottom elimination can prove anything

• Elimination Rule

e

e.

Negation Rules

• Introduction Rule

leads to a contradiction

• Double negation

e

… i

Proof by Contradiction

• Derived Rule

Assume and derive a a contradiction • Derived rules can be used like the basic

rules and serve as a short cut (macro)• Sometimes used as a negation elimination

rule instead of double negation

… PBC

Law of the Excluded Middle

• [derived rule LEM]

1 (p p) assumption

2 Assumption

3 (p p) ,4

4 e 3,15 p 2-4

6 p p ,4

7 e 6,1

8 (p p) 1-7

9 p p e 8

ProofLab

• The ProofLab tool from the Logic and Proofs course from the CMU online learning initiative allows you to experiment with natural deduction proofs

ProofLab

Provable Equivalence

• and are provably equivalent, , iff the sequents and are both valid

• Alternatively iff the sequent is valid

• A valid sequent with no premises is a tautology

De Morgan’s Law

(P Q) P Q

1 (P Q) premise

2 assumption

3 P Q i1 2

4 e 1,3

5 P 2-4

6 Q

7 P Q i2 6

8 e 1,7

9 -8

10 P Q i 5,9

De Morgan’s Law

(P Q) P Q

1 P Q premise

2 e1 1

3 e2 1

4 assumption

5 P assumption

6 e 2,5

7 Q i2 6

8 e 3,7

9 e 4,5-6, 7-8

10 (P Q) i 4-9

Semantic Entailment

• If for all valuations (assignments of variables to truth values) for which all 1,…,n evaluate to true, also evaluates to true then the semantic entailment relation 1,…,n holds

Soundness and Completeness

• 1,…,n holds iff 1,…,n is valid

• In particular, , a tautology, is valid. I.E. is a tautology iff is provable

• Soundness – you can not prove things that are not true in the truth table sense

• Completeness – you can prove anything that is true in the truth table sense

top related