cse-321 programming languages curry-howard isomorphism postech june 4, 2009 박성우
DESCRIPTION
3 Tautology The computational meaning of ) Truth of A is not affected by truth of B.TRANSCRIPT
![Page 1: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/1.jpg)
CSE-321 Programming Languages
Curry-Howard Isomorphism
POSTECHJune 4, 2009
박성우
![Page 2: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/2.jpg)
2
Truth Table• T = True, F = False
????
![Page 3: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/3.jpg)
3
Tautology
The computational meaning of
) Truth of A is not affected by truth of B.
![Page 4: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/4.jpg)
4
Tautology
But what is the computational meaning of
![Page 5: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/5.jpg)
5
Classical Logic• Concerned with:
– "whether a given proposition is true or not."• Every proposition is either true or false.
– Logic from omniscient God's point of view
• Logic for mathematics
• Tautologies in classical logic
law of double-negation
Peirce's law
law of excluded middle
![Page 6: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/6.jpg)
6
Constructive Logic• Logic from a human's point of view
– we know only what we can prove.• Eg. P = NP
• Logic for computer science
• Not provable in constructive logic
![Page 7: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/7.jpg)
7
Classical vs. Constructive• Proposition: there exists a rational number ab
such that a and b are both irrational numbers.• Proof in classical logic
– let c = p2p2
• if c = p2p2 is rational,let a = b = p2 = irrational.
then ab = p2p2 = rational.• if c = p2p2 is irrational,
let a = c = p2p2 = irrational, b = p2 = irrational.then ab = (p2p2)p2 = p22 = 2 = rational.
– But what are a and b at all?• Proof in constructive logic
– more involved, but provides a and b.
![Page 8: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/8.jpg)
8
Constructive Conjunction
![Page 9: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/9.jpg)
9
Constructive Implication
![Page 10: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/10.jpg)
10
Disjunction
?
![Page 11: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/11.jpg)
11
Outline• Classical logic vs Constructive logic V• Curry-Howard isomorphism• Summary
![Page 12: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/12.jpg)
12
Curry-Howard Isomorphism
Logic Type System
proposition type
proof proof term (expression)
![Page 13: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/13.jpg)
13
Conjunction vs. Product Type
![Page 14: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/14.jpg)
14
Logic vs. Type System
![Page 15: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/15.jpg)
15
Reduction
![Page 16: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/16.jpg)
16
Reduction
![Page 17: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/17.jpg)
17
Curry-Howard Isomorphism
Logic Type System
propositional logic simply-type -calculus
first-order logic dependent types
second-order logic polymorphism
modal logic modal type system
classical logic continuations?
![Page 18: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/18.jpg)
18
Four Color Problem• "Every map can be colored with no more than 4 colors."
• Proposed in 1852• Computer-based solution published in 1976• Formalization of the proof in 1994
– theorem prover Coq
5 4
to be taught in LICS Fall 2009!
![Page 19: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/19.jpg)
19
Final Assignment in LICS 2009• Proof of the Pythagoras' theorem
Theorem even_is_even_times_even: forall (n : nat), even (n * n) -> even n.
Theorem main_thm: forall (n p : nat), n * n = double (p * p) -> p = 0.
Definition irrational (x : R) : Prop := forall (p : Z) (q : nat), q <> 0 -> x <> (p / q)%R.
Theorem irrational_sqrt_2: irrational (sqrt 2%nat).
![Page 20: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/20.jpg)
20
Outline• Classical logic vs Constructive logic V• Curry-Howard isomorphism V• Summary
![Page 21: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/21.jpg)
21
Curry
![Page 22: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/22.jpg)
22
Howard
![Page 23: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/23.jpg)
23
Curry-Howard Isomorphism
=
![Page 24: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/24.jpg)
Finally we will have ...
![Page 25: CSE-321 Programming Languages Curry-Howard Isomorphism POSTECH June 4, 2009 박성우](https://reader035.vdocuments.net/reader035/viewer/2022062317/5a4d1b6f7f8b9ab0599b4b7c/html5/thumbnails/25.jpg)
25
Final Exam• 1.5 hours• Closed book• Covers all chapters.
June 2009Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 1314 15 16 17 18 19 2021 22 23 24 25 26 2728 29 30