Presentation is loading. Please wait.

Presentation is loading. Please wait.

Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)

Similar presentations


Presentation on theme: "Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)"— Presentation transcript:

1 Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)

2 How to Talk to Aliens

3 Basic natural phenomena Some mathematical phenomena seem so unavoidable that we must view them as “discovered” rather than “invented” –natural numbers 0 appears first in India (700 CE) –mathematical constants pi, e –geometry basic shapes (circle, triangle) geometric laws (triangle inequality, area and volume)

4 Computer Science Invented or discovered? Are there fundamental, unavoidable computational phenomena? –laws or concepts with the same unavoidable feeling as Newton’s laws of gravity? How would we know? –these concepts would appear across time and culture –but computer science is only 50 years old! Or is it?

5 The History of Logic George Boole –1815-1864 –inventor (discoverer?) of Boolean algebra –conjectured the existence of fundamental Laws of Thought

6 The History of Logic George Boole (Laws of Thought, 1854)

7 History of Logic Gotlob Frege (1848-1925) –the first hints of modern logic –formal diagrams to depict mathematical inferences

8 History of Logic Frege’s inferences (1879) Look vaguely familiar?

9 History of Logic Frege continued (1879)

10 History of Logic Frege in modern notation

11 History of Logic Gerhard Gentzen (1934) –Natural Deduction –The definition of logical connectives exclusively in terms of introduction of the connective and elimination of the connective –Prior work specified logic via axioms that related one connective to another

12 History of Logic Gentzen (1934)

13 History of Logic Gentzen (1934)

14 History of Logic Gentzen (1934) –in modern notation:

15 History of Logic Gentzen (1934) –proof simplification rules:

16 History of Logic Proof simplification

17 History of Logic Proof simplification

18 History of Logic Alonzo Church –invented (discovered?) the lambda calculus –the first programming language researcher

19 History of Logic Alonzo Church (1903-1995) –invented (discovered?) the lambda calculus –the first programming language researcher –he didn’t know it at the time (we were still lacking the computers)

20 History of Logic Church (1932) –the introduction of free and bound variables

21 History of Logic Church (1932) –the logic is defined entirely and abstractly by a system of inference rules –symbols do not have pre-conceived meanings –pure logic uninfluenced by culture

22 History of Logic Church (1932) –in case you missed the last line –I’ll say.

23 History of Logic Church (1932) –proof terms, bound variables and the notion of well-formed objects

24 History of Logic Computing with Church’s lambda calculus General evaluation rules:

25 History of Logic Sample evaluation

26 History of Logic Church’s typed lambda calculus

27 History of Logic Simplifying programs

28 History of Logic Simplifying programs

29 History of Logic Curry-Howard Isomorphism Haskell Curry (1900-1982) William Howard

30 History of Logic Curry-Howard Isomorphism –First noticed by Curry in 1960 –First published by Howard in 1980 Fundamental ideas: –Proofs are programs –Formulas are types –Proof rules are type checking rules –Proof simplification is operational semantics –Ideas and observations about logic are ideas and observations about programming languages

31 History of Logic Curry-Howard (intuitionistic logic) 2nd-order intuitionistic logic (formula variable) a (implication) A => B (conjunction) A  B (disjunction) A  B (truth) True (falsehood) False (universal quant)  a.A (existential quant)  a.A Polymorphic Lambda Calculus (PolyMinML - recursion) (type variable) a (function type) A  B (pair type) A * B (sum type) A + B (unit) unit (void) void (universal poly)  a.A (existential poly)  a.A

32 History of Logic Curry-Howard (intuitionistic logic) Note: You don’t have to omit proof terms from logical rules 2nd-order intuitionistic logicPolymorphic Lambda Calculus G |- A => B G |- A ------------------------------- (=>E) G |- B G, x:A |- e : B --------------------------(Fun) G |- x:A.e : A => B G, A |- B -------------------------- (=> I) G |- A => B G |- e1 : A => B G |- e2 : A ---------------------------------- (App) G |- e1 e2 : B

33 History of Logic Curry-Howard (intuitionistic logic) 2nd-order intuitionistic logicPolymorphic Lambda Calculus G |- A  B ------------- (  E1) G |- A G |- e1 : A G |- e2 : B ------------------------------(Pair) G |- : A * B G |- A G |- B ------------------- (  I) G |- A  B ------------- (  E2) G |- B G |- e : A  B ----------------- (  E1) G |- e.1 : A G |- e : A  B ----------------- (  E2) G |- e.2 B

34 History of Logic Other Examples –Hindley/Milner: formula reconstruction/type inference –Girard/Reynolds: System F/Polymorphic lambda calculus Linear Logic/Syntactic control of interference, linear types –Murthy: classical logic/callcc –Abramsky: multiplicative vs additive/strict vs lazy –Pfenning and Davies: modal logic/RTCG –Phil Wadler: and dual to or/CBV dual to CBN

35 History of Logic The Curry-Howard isomorphism –Coincidence? Or are aliens trying to tell us something? –Identical concepts arise across time and culture –Certain logical/computational definitions seem unavoidable –Are they inventions or discoveries? Is this talk about the history of logic or the history of computer programming? Was this course about logic or computer science?


Download ppt "Proofs are Programs: 19th Century Logic and 21st Century Computing CS 510: Programming Languages (a talk adapted from Philip Wadler)"

Similar presentations


Ads by Google