Presentation is loading. Please wait.

Presentation is loading. Please wait.

Logic in Computer Science - Overview Sep 1, 2009 박성우.

Similar presentations


Presentation on theme: "Logic in Computer Science - Overview Sep 1, 2009 박성우."— Presentation transcript:

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

2 Introduction to Logic

3 3 Logic Study of propositions and their use in argumentation –Encyclopædia Britannica Propositions (A Æ B) ¾ (B Æ A) (A ¾ (B ¾ C)) ¾ ((A Æ B) ¾ C) A Ç : A ((A ¾ B) ¾ A) ¾ A Argumentation (A Æ B) ¾ (B Æ A) is true or false? (A Æ B) ¾ (B Æ A) is provable or not provable?

4 4 Different Logics Propositional logic A ::= P | A ¾ A | A Æ A | A Ç A | : A | T | ? First-order logicA ::=... | P(x) | 8 x.A | 9 x.A Higher-order logicA ::=... | X | 8 X.A | 9 X.A Modal logicA ::=... | ¤ A | } A –necessity ¤ and possibility } –temporal logic, lax logic,... Substructural logic –linear logic, affine logic, logic of Bunched Implications,...

5 5 Outline Methodology –Model theory ( 모델이론 ) –Proof theory ( 증명이론 ) Philosophy –Classical logic –Constructive logic

6 6 Model Theory vs. Proof Theory Model theory Model I ¼ assignment of truth values I ² A Semantic consequence A 1, ¢¢¢, A n ² I C A 1, ¢¢¢, A n ² C Proof theory Inference rules –use premises to obtain the conclusion Logical entailment A 1, ¢¢¢, A n ` C

7 7 Disjunction & Implication

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

9 9

10 10 Proof Theory Formal systems characterizing logical consequences Called 'Proof Theory' –concerned with 'provability' –not concerned with 'satisfiability', for example. Key notions –inference rules –axioms –proofs

11 11 A i are premises ( 1 · i · n ). A is a conclusion. R is the name of the inference rule. –"If A 1 through A n (premises) hold, then A (conclusion) holds." If n = 0 (no premise), the inference rule is an axiom. A proof consists of applications of inference rules and axioms. Inference Rules, Axioms, Proofs

12 12 Examples Inference rules Axioms

13 13 Three Types of Systems 1.Hilbert-type system (Axiomatic system) 2.Natural deduction system 3.Sequent calculus

14 14 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

15 15 2. Natural Deduction System Introduced by Gentzen, 1934 For each connective Æ, Ç, ¾,... –introduction rule(s) –elimination rule(s)

16 16 Implication

17 17 3. Sequent Calculus Also introduced by Gentzen, 1934 Sequent

18 18 Sequent Calculus for Æ, ¾

19 19 Outline Methodology –Model theory –Proof theory Philosophy –Classical logic ( 고전 논리 ) –Constructive logic ( 건설적 논리, 직관 논리 ) ( ¼ intuitionistic logic)

20 20 Tautology Intuitive interpretation of ) Truth of A is not affected by truth of B.

21 21 Tautology But what is an intuitive interpretation of

22 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

23 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

24 24 Example Theorem: There are two irrational numbers a and b such that a b is rational. Proof in classical logic: –Let c = p 2 p 2 If c is rational, we take a = b = p 2. If c is not rational, we take a = c and b = p 2. Proof in constructive logic: –a lot more involved, but presents a procedure for computing a and b.

25 This course is about Constructive Proof Theory. Natural deduction Curry-Howard isomorphism First-order logic Sequent calculus Classical logic Automated theorem proving

26 26 사기성 고전논리 P: 달나라에 계수나무가 있다. Q: 페르마의 마지막 정리는 참이다. P 가 Q 를 의미하거나 Q 가 P 를 의미한다. (P ¾ Q) Ç (Q ¾ P) 따라서 고전논리는 사기다.

27 27 Coq Proof assistant + theorem prover –Calculus of (Co)inductive construction type theory with dependent types –Natural deduction –Constructive logic Application –Formalizing mathematics –Formalizing programming language metatheory –Program verification

28 28 Formalizing Mathematics Ex. Formalizing 100 theorems –http://www.cs.ru.nl/~freek/100/ –Ex. pythagorean theorem Theorem main_thm: forall (n p : nat), n * n = double (p * p) -> p = 0. Four color theorem –Proposed in 1852 –Proof formalized in Coq in 2005 54

29 29 Programming Language Metatheory Ex. POPLmark Challenge –type safety of System F with subtyping Type safety Lemma preservation : forall E e e' T, typing E e T -> eval e e' -> typing E e' T. Lemma progress : forall e T, typing nil e T -> value e \/ exists e', eval e e'. Theorem interp_reduces_sol : forall t, eval_many t (interp t).

30 30 Can you trust your compiler? Critical software requires the correctness of compilers. –Compilers are far from perfect, producing unintended, erroneous code. –Unfortunately the verification of compiler is not trivial at all. Formal verification of CompCert (Xavier Leroy, 2006) –Clight to PowerPC assembly code –Verification in Coq

31 Most of the assignments are Coq Programming. (+ ML programming assignments)

32 Welcome to the best class in Postech! Assignment 1 will be out tonight.


Download ppt "Logic in Computer Science - Overview Sep 1, 2009 박성우."

Similar presentations


Ads by Google