proofs are programs: 19th century logic and 21st century computing cs 510: programming languages (a...
Post on 20-Dec-2015
219 views
TRANSCRIPT
Proofs are Programs:19th Century Logic
and21st Century Computing
CS 510: Programming Languages(a talk adapted from Philip Wadler)
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)
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?
The History of Logic
• George Boole– 1815-1864– inventor (discoverer?) of
Boolean algebra– conjectured the existence of
fundamental Laws of Thought
History of Logic
• Gotlob Frege (1848-1925)– the first hints of modern logic– formal diagrams to depict
mathematical inferences
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
History of Logic
• Alonzo Church– invented (discovered?) the
lambda calculus– the first programming
language researcher
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)
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
History of Logic
• Church (1932)– proof terms, bound variables and the notion of
well-formed objects
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
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
History of Logic
• Curry-Howard (intuitionistic logic)
• Note: You don’t have to omit proof terms from logical rules
2nd-order intuitionistic logic Polymorphic 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
History of Logic
• Curry-Howard (intuitionistic logic)
2nd-order intuitionistic logic Polymorphic Lambda Calculus
G |- A B ------------- (E1)G |- A
G |- e1 : A G |- e2 : B ------------------------------(Pair)G |- <e1,e2> : A * B
G |- A G |- B ------------------- ( I)G |- A B
G |- A B ------------- (E2)G |- B
G |- e : A B ----------------- (E1)G |- e.1 : A
G |- e : A B ----------------- (E2)G |- e.2 B
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
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?