1 / 32

Logic in Computer Science - Overview

Logic in Computer Science - Overview. 박성우. Sep 1, 2009. Introduction to Logic. 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

Download Presentation

Logic in Computer Science - Overview

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

  2. Introduction to Logic

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

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

  6. Model theory ModelI¼ assignment of truth values I² A Semantic consequenceA1, ¢¢¢, An²I CA1, ¢¢¢, An² C Proof theory Inference rules use premisesto obtain the conclusion Logical entailment A1, ¢¢¢, An` C Model Theory vs. Proof Theory

  7. Disjunction & Implication

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

  9. 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

  10. Inference Rules, Axioms, Proofs • Ai are premises (1 · i · n). • A is a conclusion. • R is the name of the inference rule. • "If A1 through An (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.

  11. Examples • Inference rules • Axioms

  12. Three Types of Systems • Hilbert-type system (Axiomatic system) • Natural deduction system • Sequent calculus

  13. 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

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

  15. Implication

  16. 3. Sequent Calculus • Also introduced by Gentzen, 1934 • Sequent

  17. Sequent Calculus for Æ, ¾

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

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

  20. Tautology But what is an intuitive interpretation of

  21. 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

  22. 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

  23. Example • Theorem:There are two irrational numbers a and b such that ab is rational. • Proof in classical logic: • Let c = p2p2If 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.

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

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

  26. 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

  27. 5 4 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

  28. 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).

  29. 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

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

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

More Related