26
Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박박박

Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

Embed Size (px)

Citation preview

Page 1: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

Logic in Computer Science - Overview

Sep 1, 2011

POSTECH

박성우

Page 2: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

Introduction to Logic[ inspired by The Universal Computer, Martin Davis]

Page 3: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

3

Logic• Study of propositions and their use in argumentation

(Encyclopædia Britannica)– Propositions

(A Æ B) ¾ (B Æ A)

A Ç : A– Argumentation

(A Æ B) ¾ (B Æ A) is true or false?

(A Æ B) ¾ (B Æ A) is provable or not provable?

• Use of a system of symbols for reasoning or deduction

Page 4: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

4

Aristotle [384 BC - 322 BC]

• Syllogisms– inferences from premises to a conclusion– sentences

• All X are Y. No X are Y.• Some X are Y. Some X are not Y.

– valid:All X are YAll Y are Z--------------All X are Z

All students are humansAll humans are animals

--------------------------------------All students are animals

Page 5: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

5

Gottfried Leibniz [1646 - 1716]

• Inventor of differential and integral calculus– mathematics reduces to manipulating symbols

• Dream: Calculus ratiocinator– bring human reasoning under mathematical laws– use symbols

Page 6: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

6

George Boole [1815 - 1864] • Turns logic into (Boolean) algebra

• L = Joe left his checkbook at the supermarket

• F = Joe's checkbook was found at the supermarket

• W = Joe wrote a check at the restaurant last night

• P = After writing the check last night, Joe put his checkbook in his jacket pocket

• H = Joe hasn't used his checkbook since last night

• S = Joe's checkbook is still in his jacket pocket

• Premises:

- If L, then F. - Not F.

- W and P. - If W and P and H, then S.

- H.

• Conclusions:

- Not L. - S.

Page 7: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

7

Gottlob Frege [1848 - 1925]

• Breakthrough: first-order logic– formal syntax– universal (for all) and existential (some) quantifiers

A ::= P(x) | A ¾ A | A Æ A | A Ç A | :A | 8x.A | 9x.A

• ... shown to be self-contradictory by Russell

Page 8: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

8

Bertrand Russell [1872 - 1970] • Coauthored Principia Mathematica• Russell's paradox

– shows that the set theory by Georg Cantor is inconsistent

"a set containing all sets that are not members of themselves"

• Proposes type theory

Page 9: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

9

Further Story• Georg Cantor [1845 - 1918]

– set theory, diagonal argument• David Hilbert [1862 - 1943]

– Hilbert's program• Kurt Gödel [1906 - 1978]

– incompleteness theorem, undecidability• Alan Turing [1912 - 1954]

– Turing machine, algorithmic unsolvability• John von Neumann [1903 - 1957]

– von Neumann architecture

Page 10: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

10

Outline• Methodology

– Model theory ( 모델이론 )– Proof theory ( 증명이론 )

• Philosophy– Classical logic– Constructive logic

Page 11: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

11

Model Theory vs. Proof TheoryModel theory

• Model ¼ assignment of

truth values

• Semantic consequenceA1, ¢¢¢, An ² C

Proof theory• Inference rules

– use premisesto obtain the conclusion

• Syntactic entailment A1, ¢¢¢, An ` C

Page 12: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

12

Disjunction & Implication

Page 13: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

13

) Truth of A is not affected by truth of B.

Page 14: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

14

Inference Rules in Proof Theory• With premises

• Axioms

Page 15: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

15

Three Types of Systems

1. Hilbert-type system (Axiomatic system)

2. Natural deduction system

3. Sequent calculus

Page 16: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

16

1. Hilbert-type System• Consists of axioms and Modus Ponens

• Axioms

I : A ¾ A

K : A ¾ (B ¾ A)

S : (A ¾ (B ¾ C)) ¾ ((A ¾ B) ¾ (A ¾ C))

• Inference rule

Page 17: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

17

2. Natural Deduction System• Introduced by Gentzen, 1934• For each connective Æ, Ç, ¾, ...

– introduction rule(s)– elimination rule(s)

Page 18: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

18

Implication

Page 19: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

19

Outline• Methodology

– Model theory– Proof theory

• Philosophy– Classical logic ( 고전 논리 )– Constructive logic ( 건설적 논리 , 직관 논리 )

(¼ intuitionistic logic)

Page 20: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

20

Tautology

Intuitive interpretation of

) Truth of A is not affected by truth of B.

Page 21: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

21

Tautology

But what is an intuitive interpretation of

Page 22: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

22

Classical Logic• Concerned with:

– "whether a given proposition is true or not."

• Logic from God's point of view– Every proposition is either true or false.

• Tautologies in classical logic

¼ Logic for mathematics

Page 23: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

23

Constructive Logic• Concerned with:

– "how a given proposition becomes true."

• Logic from a human's point of view– we know only what we can prove.

• Not true in constructive logic (for all A and B)

¼ Logic for computer science

Page 24: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

24

Example• Theorem:

There are two irrational numbers a and b such that ab is rational.

• Proof in classical logic:– Let c = p2p2

If c is rational, we take a = b = p2.If c is not rational, we take a = c and b = p2.

• Proof in constructive logic:– a lot more involved, but presents a procedure for

computing a and b.

Page 25: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

This course is aboutConstructive Proof Theory.

Natural deduction

Curry-Howard isomorphism

First-order logic

Sequent calculus

Classical logic

Automated theorem proving

Page 26: Logic in Computer Science - Overview Sep 1, 2011 POSTECH 박성우

Welcome tothe world of logic!