Lambda-Calculus by John Lång, 20 February 2020 “Yön Maku, Kun Linnut Syöksyy Mustina Siipinä Tähtiä Päin; Vaan Mikä on Nimesi Nimi, Tähtesi Salainen Luku Ja Numero?”

Total Page:16

File Type:pdf, Size:1020Kb

Lambda-Calculus by John Lång, 20 February 2020 “Yön Maku, Kun Linnut Syöksyy Mustina Siipinä Tähtiä Päin; Vaan Mikä on Nimesi Nimi, Tähtesi Salainen Luku Ja Numero?” Introduction to Lambda-Calculus By John Lång, 20 February 2020 “Yön maku, kun linnut syöksyy mustina siipinä tähtiä päin; vaan mikä on nimesi nimi, tähtesi salainen luku ja numero?” – Arcana by CMX, from their album Discopolis 2 / 252 An Appetizer: The MIU-System ● Douglas Hofstadter presented the following puzzle in his famous book “Gödel, Escher, Bach: an Eternal Golden Braid”: ● The MIU-system has the letters M, I, and U in its alphabet ● It has four production rules: 1) αI αIU; 2) Mα Mαα; 3) αIIIβ → αUβ; and 4) αUUβ → αβ; ● The question→ is: Is MU derivable from MI→? 3 / 252 ● This slide was inspired by the West Metro, that connects Espoo and Helsinki (most of the time). The stops are the concepts worth learning. Page number is written beneath the stops Subway Map Philosophy 5 Strings and λ-terms 30 Renaming Variables 54 Reducing λ-terms 75 de Bruijn Indexing 95 Equality 104 Encodings 125 Undecidability 149 Combinatory Logic 160 Types 176 Further Topics 217 Conclusion 247 4 / 252 Map of the Uni erse We are here Computer Mathematics Science 5 / 252 !hat Is a "unction? Formula Interpretation ● f(x) 2x ● f(x) yields 2x ● g(x,y=) 5 ● g is a constant function ● h : X =Y ● h maps every X to a Y ● x 3→ ● x is mapped to 3 ● (a↦b)(x) a(b(x)) ● composition of a and b ∘ = 6 / 252 First-Order s. &igher-$rder First-Order Higher-Order A×B f C A A×B (a1, b1) c 1 f×1 f (a1, b2) f B c2 (a , b ) 1 3 c ⋮ 3 CB CB×B C ⋮ ϵ f ϵ ∘ f×1 f {((a1,b1),c1), ((a1,b2),c2), ...} B = = 7 / 252 First-Order s. &igher-$rder First-Order Higher-Order A×B f C A A×B (a1, b1) c 1 f×1 f (a1, b2) f B c2 (a , b ) 1 3 c ⋮ 3 CB CB×B C ⋮ ϵ f ϵ ∘ f×1 f {((a1,b1),c1), ((a1,b2),c2), ...} B = = 8 / 252 Extensional s% Intensional Extensional Intensional x≤y y GCD(x,y) f()+ false true x = 0 ) (x,y) ← (y%x,x) return y 9 / 252 Extensional s% Intensional Extensional Intensional x≤y y GCD(x,y) f()+ false true x = 0 ) (x,y) ← (y%x,x) return y 10 / 252 My ,oint of -iew ● According to Wiktionary (viewed some time in 2017): – The word “function” comes from a Latin word that means performance or execution – The Latin word “calculus” means “a pebble or stone used for counting” ● Does set theoretical mathematics do justice to these concepts? – Do you see pebbles in the real line? ● I think of functions as a primitive rather than a derived notion 11 / 252 Some Terminology ● Functions are abstract dependencies between objects ● Algorithms are representations of functions in a formal system. Several algorithms per function; one function per algorithm ● Strings can represent functions as well as their arguments ● Computation is the art of algorithmic string manipulation ● A model of computation is a formal system that defines effectively computable functions in terms of algorithms 12 / 252 Some Models of Computation Industrial Legend: TT FC LC CA Cellular Automata CL = Combinatory Logic URM µRF PN FC = Flow Charts M FT = FRACTRAN x e i l LC Lambda-Calculus PA CL n p = i m µRF Mu Recursive Functions m a = o l PA = Peano Arithmetic C PN = Petri Nets TM PCS CA PCS = Post Canonical Systems TM = Turing Machines TT = Type Theory FT URM = Unlimited Register Machines = Academic 13 / 252 Some Models of Computation Industrial Legend: TT FC LC CA Cellular Automata CL = Combinatory Logic URM µRF PN FC = Flow Charts M FT = FRACTRAN x e i l LC Lambda-Calculus PA CL n p = i m µRF Mu Recursive Functions m a = o l PA = Peano Arithmetic C PN = Petri Nets TM PCS CA PCS = Post Canonical Systems TM = Turing Machines TT = Type Theory FT URM = Unlimited Register Machines = Academic 14 / 252 The Computational Uni erse ● Lambda-Calculus, Combinatory Logic, Mu Recursive Functions, Turing Machines, and others, represent the strongest class of models of computation. (Church-Turing Thesis) ● They’re powerful enough to feature undecidability, i.e. the incompleteness of computational universe. (Thanks, Gödel!) – There are strange loops between object and meta languages – On the bright side, we can extend every formal system infinitely! – We’ll see later how undecidability emerges in LC 15 / 252 Lambda-Calculus? ● Lambda-Calculus (LC) is the model (or language) of computation (i.e. programming) discussed in this presentation. – It is a system that expresses functions as strings of symbols ● A few common misconceptions need to be addressed: – It’s lambda (the Greek letter Λ, λ), not “lambada” (the dance) – “Calculus” referes to proof calculus, not the differential/integral one – “Barendregt convention” was actually initiated by Thomas Ottmann – “Curry transformation” was actually discovered by Gottlob Frege 16 / 252 The .ou'h Idea ● Lambda-Calculus is about anonymous functions, called lambda expressions (λ-exprs) ● There are conversion and reduction rules that allow us to reason about (in)equality of λ-exprs. Reducing λ-exprs is like – running a computer program; – performing a series of algebraic simplifications; or – transforming graphs ● We’ll see how this works in due time 17 / 252 Teaser: Buildin' "unctions ● f(x) 2x + c translates into f λx.+ ((λt.⋅ 2 t)x) c in LC – 2=x can be seen as a function≝ of t, t 2 ⋅ t, applied to x – In LC, we write 2 ⋅ t in prefix notation↦ as ⋅ 2 t – c is constant (or free variable); it stays fixed as x varies – We bind x as the formal parameter: λx.+ ((λt.⋅ 2 t)x) c ● (λt.⋅ 2 t)x means evaluating t (⋅ 2 t) with the argument x ● We can simplify: f λx.+ ((λt↦.⋅ 2 t)x) c λx.+ (⋅ 2 x) c = = 18 / 252 The /lack /ox Analogy .evisited ● Traditionally, functions are ● In LC, functions are the stars seen as black boxes of the show input1 # output1 # function1 # input2 # output2 # function2 # input3 19 / 252 The /lack /ox Analogy .evisited ● Traditionally, functions are ● In LC, functions are the stars seen as black boxes of the show input1 # output1 # function1 # input2 # output2 # function2 # input3 20 / 252 Two ,rogramming Paradi'ms ● Imperative paradigm operates ● Declarative paradigm defines algorithms like cooking algorithms as compositions of recipes, on step-by-step basis: computational primitives: 0: IN R1, =KBD select name, email 1: LOAD R2, =1 from students join staff 2: JZER R1, 6 where email like ’%.fi’ 3: MUL R2, R1 ● 4: SUB R1, =1 LC is declarative 5: JUMP 2 ● 6: OUT R2, =CRT LC doesn’t have implicit state 7: SVC R0, =HALT or side effects 21 / 252 Two ,rogramming Paradi'ms ● Imperative paradigm operates ● Declarative paradigm defines algorithms like cooking algorithms as compositions of recipes, on step-by-step basis: computational primitives: 0: IN R1, =KBD select name, email 1: LOAD R2, =1 from students join staff 2: JZER R1, 6 where email like ’%.fi’ 3: MUL R2, R1 ● 4: SUB R1, =1 LC is declarative 5: JUMP 2 ● 6: OUT R2, =CRT LC doesn’t have implicit state 7: SVC R0, =HALT or side effects 22 / 252 Side-(4ects Make ,rogram Analysis &ard ● A “function” in C: int c = 0; int f(int i) { return i + c++; } f(3); // Returns 3 f(3); // Returns 4 ● Thus, f(3) f(3)! ≠ 23 / 252 Lambda-Calculus Makes (4ects Explicit ● A “function” in C: ● Consider the following: int g(int c, int i) int c = 0; {return i + (c + 1);} int f(int i) int h(int i) {return g(0);} { return i + c++; ● The state of c is now explicit } f(3); // Returns 3 ● In pseudo-LC, we’d declare f(3); // Returns 4 int g(int c)(int i); int h(int i){return g(0)(i);} ● Thus, f(3) f(3)! ● ≠ Now, h(3) h(3) = 24 / 252 Traditional Notation is Imprecise ● Take “f(x) y” for instance – What does= ‘ ’ mean? – Definition or= assertion? – Did we apply f to x? – Perhaps we multiplied f by x? – Do we need the graph of f ? ● Is ‘ ’ in (f g) a function? ∘ ∘ 25 / 252 Lambda-Calculus is Unambi'uous ● Take “f(x) y” for instance ● In LC, f(x) y means – What does= ‘ ’ mean? “f applied to= x equals y” – Definition or= assertion? – It is an assertion (“==”), not a definition (“=”) – Did we apply f to x? – No other interpretations – Perhaps we multiplied f by x? – ‘ ’ always has a direct proof – Do we need the graph of f ? ● is =just another function: ● Is ‘ ’ in (f g) a function? ∘– f g (λvwx.v(wx))fg ∘ ∘ ∘ ≡ 26 / 252 Why Lambda-Calculus? ● Lambda-Calculus is capable of describing computable functions using a referentially transparent (i.e. compositional) language ● LC has an unambiguous syntax with very few special cases ● The computer of LC doesn’t need soul, intuition, or magic ● LC doesn’t burden us with boring and error-prone technical details, such as memory management or instruction sequencing ● LC gives the best of both mathematics and computer science 27 / 252 My -ery Small !orld Map encode express construct are Logic Sets Types Categories p e e e o q x z p pr i u u ov p s l e l e n a i s v t inspire g p a ri a e d e s i g n r n s e s o r e models builds a n Computability LC Functions l fi i z e e e d xp uses extends loi composes ed t ne Complexity Programs Algebra create helps 28 / 252 ● You’re probably very eager to get started already, so let’s get to business! Subway Map Philosophy 5 Strings and λ-terms 30 Renaming Variables 54 Reducing λ-terms 75 de Bruijn Indexing 95 Equality 104 Encodings 125 Undecidability 149 Combinatory Logic 160 Types 176 Further Topics 217 Conclusion 247 29 / 252 Before !e Start ● Our object language is the language of lambda expressions – Words in the object language consist of variable and other symbols ● Our meta language (e.g.
Recommended publications
  • Russell's 1903 – 1905 Anticipation of the Lambda Calculus
    HISTORY AND PHILOSOPHY OF LOGIC, 24 (2003), 15–37 Russell’s 1903 – 1905 Anticipation of the Lambda Calculus KEVIN C. KLEMENT Philosophy Dept, Univ. of Massachusetts, 352 Bartlett Hall, 130 Hicks Way, Amherst, MA 01003, USA Received 22 July 2002 It is well known that the circumflex notation used by Russell and Whitehead to form complex function names in Principia Mathematica played a role in inspiring Alonzo Church’s ‘Lambda Calculus’ for functional logic developed in the 1920s and 1930s. Interestingly, earlier unpublished manuscripts written by Russell between 1903 and 1905—surely unknown to Church—contain a more extensive anticipation of the essential details of the Lambda Calculus. Russell also anticipated Scho¨ nfinkel’s Combinatory Logic approach of treating multi- argument functions as functions having other functions as value. Russell’s work in this regard seems to have been largely inspired by Frege’s theory of functions and ‘value-ranges’. This system was discarded by Russell due to his abandonment of propositional functions as genuine entities as part of a new tack for solving Rus- sell’s paradox. In this article, I explore the genesis and demise of Russell’s early anticipation of the Lambda Calculus. 1. Introduction The Lambda Calculus, as we know it today, was initially developed by Alonzo Church in the late 1920s and 1930s (see, e.g. Church 1932, 1940, 1941, Church and Rosser 1936), although it built heavily on work done by others, perhaps most notably, the early works on Combinatory Logic by Moses Scho¨ nfinkel (see, e.g. his 1924) and Haskell Curry (see, e.g.
    [Show full text]
  • Haskell Before Haskell. an Alternative Lesson in Practical Logics of the ENIAC.∗
    Haskell before Haskell. An alternative lesson in practical logics of the ENIAC.∗ Liesbeth De Mol† Martin Carl´e‡ Maarten Bullynck§ January 21, 2011 Abstract This article expands on Curry’s work on how to implement the prob- lem of inverse interpolation on the ENIAC (1946) and his subsequent work on developing a theory of program composition (1948-1950). It is shown that Curry’s hands-on experience with the ENIAC on the one side and his acquaintance with systems of formal logic on the other, were conduc- tive to conceive a compact “notation for program construction” which in turn would be instrumental to a mechanical synthesis of programs. Since Curry’s systematic programming technique pronounces a critique of the Goldstine-von Neumann style of coding, his “calculus of program com- position”not only anticipates automatic programming but also proposes explicit hardware optimisations largely unperceived by computer history until Backus famous ACM Turing Award lecture (1977). This article frames Haskell B. Curry’s development of a general approach to programming. Curry’s work grew out of his experience with the ENIAC in 1946, took shape by his background as a logician and finally materialised into two lengthy reports (1948 and 1949) that describe what Curry called the ‘composition of programs’. Following up to the concise exposition of Curry’s approach that we gave in [28], we now elaborate on technical details, such as diagrams, tables and compiler-like procedures described in Curry’s reports. We also give a more in-depth discussion of the transition from Curry’s concrete, ‘hands-on’ experience with the ENIAC to a general theory of combining pro- grams in contrast to the Goldstine-von Neumann method of tackling the “coding and planning of problems” [18] for computers with the help of ‘flow-charts’.
    [Show full text]
  • Strategic Maneuvering in Mathematical Proofs
    CORE Metadata, citation and similar papers at core.ac.uk Provided by Springer - Publisher Connector Argumentation (2008) 22:453–468 DOI 10.1007/s10503-008-9098-7 Strategic Maneuvering in Mathematical Proofs Erik C. W. Krabbe Published online: 6 May 2008 Ó The Author(s) 2008 Abstract This paper explores applications of concepts from argumentation theory to mathematical proofs. Note is taken of the various contexts in which proofs occur and of the various objectives they may serve. Examples of strategic maneuvering are discussed when surveying, in proofs, the four stages of argumentation distin- guished by pragma-dialectics. Derailments of strategies (fallacies) are seen to encompass more than logical fallacies and to occur both in alleged proofs that are completely out of bounds and in alleged proofs that are at least mathematical arguments. These considerations lead to a dialectical and rhetorical view of proofs. Keywords Argumentation Á Blunder Á Fallacy Á False proof Á Mathematics Á Meno Á Pragma-dialectics Á Proof Á Saccheri Á Strategic maneuvering Á Tarski 1 Introduction The purport of this paper1 is to show that concepts from argumentation theory can be fruitfully applied to contexts of mathematical proof. As a source for concepts to be tested I turn to pragma-dialectics: both to the Standard Theory and to the Integrated Theory. The Standard Theory has been around for a long time and achieved its final formulation in 2004 (Van Eemeren and Grootendorst 1984, 1992, 2004). According to the Standard Theory argumentation is a communication process aiming at 1 The paper was first presented at the NWO-conference on ‘‘Strategic Manoeuvring in Institutionalised Contexts’’, University of Amsterdam, 26 October 2007.
    [Show full text]
  • Formalizing the Curry-Howard Correspondence
    Formalizing the Curry-Howard Correspondence Juan F. Meleiro Hugo L. Mariano [email protected] [email protected] 2019 Abstract The Curry-Howard Correspondence has a long history, and still is a topic of active research. Though there are extensive investigations into the subject, there doesn’t seem to be a definitive formulation of this result in the level of generality that it deserves. In the current work, we intro- duce the formalism of p-institutions that could unify previous aproaches. We restate the tradicional correspondence between typed λ-calculi and propositional logics inside this formalism, and indicate possible directions in which it could foster new and more structured generalizations. Furthermore, we indicate part of a formalization of the subject in the programming-language Idris, as a demonstration of how such theorem- proving enviroments could serve mathematical research. Keywords. Curry-Howard Correspondence, p-Institutions, Proof The- ory. Contents 1 Some things to note 2 1.1 Whatwearetalkingabout ..................... 2 1.2 Notesonmethodology ........................ 4 1.3 Takeamap.............................. 4 arXiv:1912.10961v1 [math.LO] 23 Dec 2019 2 What is a logic? 5 2.1 Asfortheliterature ......................... 5 2.1.1 DeductiveSystems ...................... 7 2.2 Relations ............................... 8 2.2.1 p-institutions . 10 2.2.2 Deductive systems as p-institutions . 12 3 WhatistheCurry-HowardCorrespondence? 12 3.1 PropositionalLogic.......................... 12 3.2 λ-calculus ............................... 17 3.3 The traditional correspondece, revisited . 19 1 4 Future developments 23 4.1 Polarity ................................ 23 4.2 Universalformulation ........................ 24 4.3 Otherproofsystems ......................... 25 4.4 Otherconstructions ......................... 25 1 Some things to note This work is the conclusion of two years of research, the first of them informal, and the second regularly enrolled in the course MAT0148 Introdu¸c˜ao ao Trabalho Cient´ıfico.
    [Show full text]
  • Proofs Are Programs: 19Th Century Logic and 21St Century Computing
    Proofs are Programs: 19th Century Logic and 21st Century Computing Philip Wadler Avaya Labs June 2000, updated November 2000 As the 19th century drew to a close, logicians formalized an ideal notion of proof. They were driven by nothing other than an abiding interest in truth, and their proofs were as ethereal as the mind of God. Yet within decades these mathematical abstractions were realized by the hand of man, in the digital stored-program computer. How it came to be recognized that proofs and programs are the same thing is a story that spans a century, a chase with as many twists and turns as a thriller. At the end of the story is a new principle for designing programming languages that will guide computers into the 21st century. For my money, Gentzen's natural deduction and Church's lambda calculus are on a par with Einstein's relativity and Dirac's quantum physics for elegance and insight. And the maths are a lot simpler. I want to show you the essence of these ideas. I'll need a few symbols, but not too many, and I'll explain as I go along. To simplify, I'll present the story as we understand it now, with some asides to fill in the history. First, I'll introduce Gentzen's natural deduction, a formalism for proofs. Next, I'll introduce Church's lambda calculus, a formalism for programs. Then I'll explain why proofs and programs are really the same thing, and how simplifying a proof corresponds to executing a program.
    [Show full text]
  • The Theory of Parametricity in Lambda Cube
    数理解析研究所講究録 1217 巻 2001 年 143-157 143 The Theory of Parametricity in Lambda Cube Takeuti Izumi 竹内泉 Graduate School of Informatics, Kyoto Univ., 606-8501, JAPAN [email protected] 京都大学情報学研究科 Abstract. This paper defines the theories ofparametricity for all system of lambda cube, and shows its consistency. These theories are defined by the axiom sets in the formal theories. These theories prove various important semantical properties in the formal systems. Especially, the theory for asystem of lambda cube proves some kind of adjoint functor theorem internally. 1Introduction 1.1 Basic Motivation In the studies of informatics, it is important to construct new data types and find out the properties of such data types. For example, let $T$ and $T’$ be data types which is already known. Then we can construct anew data tyPe $T\mathrm{x}T'$ which is the direct product of $T$ and $T’$ . We have functions left, right and pair which satisfy the following equations: left(pair $xy$) $=x$ , right(pair $xy$) $=y$ for any $x:T$ and $y:T’$ , $T\mathrm{x}T'$ pair(left $z$ ) right $z$ ) $=z$ for any $z$ : . As for another example, we can construct Lit(T) which is atype of lists whose components are elements of $T$ . We have the empty list 0as the elements of List(T), the functions (-,-), which is so called sons-pair, and listrec. These element and functions satisfy the following equations: $listrec()fe=e$, listrec(s,l) $fe=fx(listrec lfe)$ for any $x:T$, $l$ :List(T), $e:D$ and $f$ : $Tarrow Darrow D$, where $D$ is another type.
    [Show full text]
  • Hunting the Story of Moses Schönfinkel
    Where Did Combinators Come From? Hunting the Story of Moses Schönfinkel Stephen Wolfram* Combinators were a key idea in the development of mathematical logic and the emergence of the concept of universal computation. They were introduced on December 7, 1920, by Moses Schönfinkel. This is an exploration of the personal story and intellectual context of Moses Schönfinkel, including extensive new research based on primary sources. December 7, 1920 On Tuesday, December 7, 1920, the Göttingen Mathematics Society held its regular weekly meeting—at which a 32-year-old local mathematician named Moses Schönfinkel with no known previous mathematical publications gave a talk entitled “Elemente der Logik” (“Elements of Logic”). This piece is included in S. Wolfram (2021), Combinators: A Centennial View, Wolfram Media. (wolframmedia.com/products/combinators-a-centennial-view.html) and accompanies arXiv:2103.12811 and arXiv:2102.09658. Originally published December 7, 2020 *Email: [email protected] 2 | Stephen Wolfram A hundred years later what was presented in that talk still seems in many ways alien and futuristic—and for most people almost irreducibly abstract. But we now realize that that talk gave the first complete formalism for what is probably the single most important idea of this past century: the idea of universal computation. Sixteen years later would come Turing machines (and lambda calculus). But in 1920 Moses Schönfinkel presented what he called “building blocks of logic”—or what we now call “combinators”—and then proceeded to show that by appropriately combining them one could effectively define any function, or, in modern terms, that they could be used to do universal computation.
    [Show full text]
  • CURRY, Haskell Brooks (1900–1982) Haskell Brooks Curry Was Born On
    CURRY, Haskell Brooks (1900–1982) Haskell Brooks Curry was born on 12 September 1900 at Millis, Massachusetts and died on 1 September 1982 at State College, Pennsylvania. His parents were Samuel Silas Curry and Anna Baright Curry, founders of the School for Expression in Boston, now known as Curry College. He graduated from high school in 1916 and entered Harvard College with the intention of going into medicine. When the USA entered World War I in 1917, he changed his major to mathematics because he thought it might be useful for military purposes in the artillery. He also joined the Student Army Training Corps on 18 October 1918, but the war ended before he saw action. He received his B.A. in mathematics from Harvard University in 1920. From 1920 until 1922, he studied electrical engineering at MIT in a program that involved working half-time at the General Electric Company. From 1922 until 1924, he studied physics at Harvard; during the first of those two years he was a half-time research assistant to P. W. Bridgman, and in 1924 he received an A. M. in physics. He then studied mathematics, still at Harvard, until 1927; during the first semester of 1926–27 he was a half-time instructor. During 1927–28 he was an instructor at Princeton University. During 1928–29, he studied at the University of Göttingen, where he wrote his doctoral dissertation; his oral defense under David Hilbert was on 24 July 1929, although the published version carries the date of 1930. In the fall of 1929, Haskell Curry joined the faculty of The Pennsylvania State College (now The Pennsylvania State University), where he spent most of the rest of his career.
    [Show full text]
  • Polymorphism All the Way Up! from System F to the Calculus of Constructions
    Programming = proving? The Curry-Howard correspondence today Second lecture Polymorphism all the way up! From System F to the Calculus of Constructions Xavier Leroy College` de France 2018-11-21 Curry-Howard in 1970 An isomorphism between simply-typed λ-calculus and intuitionistic logic that connects types and propositions; terms and proofs; reductions and cut elimination. This second lecture shows how: This correspondence extends to more expressive type systems and to more powerful logics. This correspondence inspired formal systems that are simultaneously a logic and a programming language (Martin-Lof¨ type theory, Calculus of Constructions, Pure Type Systems). 2 I Polymorphism and second-order logic Static typing vs. genericity Static typing with simple types (as in simply-typed λ-calculus but also as in Algol, Pascal, etc) sometimes forces us to duplicate code. Example A sorting algorithm applies to any list list(t) of elements of type t, provided it also receives then function t ! t ! bool that compares two elements of type t. With simple types, to sort lists of integers and lists of strings, we need two functions with dierent types, even if they implement the same algorithm: sort list int :(int ! int ! bool) ! list(int) ! list(int) sort list string :(string ! string ! bool) ! list(string) ! list(string) 4 Static typing vs. genericity There is a tension between static typing on the one hand and reusable implementations of generic algorithms on the other hand. Some languages elect to weaken static typing, e.g. by introducing a universal type “any” or “?” with run-time type checking, or even by turning typing o: void qsort(void * base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); Instead, polymorphic typing extends the algebra of types and the typing rules so as to give a precise type to a generic function.
    [Show full text]
  • The Girard–Reynolds Isomorphism
    View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by Elsevier - Publisher Connector Information and Computation 186 (2003) 260–284 www.elsevier.com/locate/ic The Girard–Reynolds isomorphism Philip Wadler ∗ Avaya Laboratories, 233 Mount Airy Road, Room 2C05, Basking Ridge, NJ 07920-2311, USA Received 8 February 2002; revised 30 August 2002 Abstract The second-order polymorphic lambda calculus, F2, was independently discovered by Girard and Reynolds. Girard additionally proved a Representation Theorem: every function on natural numbers that can be proved total in second-order intuitionistic predicate logic, P2, can be represented in F2. Reynolds additionally proved an Abstrac- tion Theorem: for a suitable notion of logical relation, every term in F2 takes related arguments into related results. We observe that the essence of Girard’s result is a projection from P2 into F2, and that the essence of Reynolds’s result is an embedding of F2 into P2, and that the Reynolds embedding followed by the Girard projection is the identity. The Girard projection discards all first-order quantifiers, so it seems unreasonable to expect that the Girard projection followed by the Reynolds embedding should also be the identity. However, we show that in the presence of Reynolds’s parametricity property that this is indeed the case, for propositions corresponding to inductive definitions of naturals or other algebraic types. © 2003 Elsevier Science (USA). All rights reserved. 1. Introduction Double-barrelled names in science may be special for two reasons: some belong to ideas so subtle that they required two collaborators to develop; and some belong to ideas so sublime that they possess two independent discoverers.
    [Show full text]
  • A Language for Playing with Formal Systems
    University of Pennsylvania ScholarlyCommons Departmental Papers (CIS) Department of Computer & Information Science March 2003 TinkerType: a language for playing with formal systems Michael Y. Levin University of Pennsylvania Benjamin C. Pierce University of Pennsylvania, [email protected] Follow this and additional works at: https://repository.upenn.edu/cis_papers Recommended Citation Michael Y. Levin and Benjamin C. Pierce, "TinkerType: a language for playing with formal systems", . March 2003. Copyright Cambridge University Press. Reprinted from Journal of Functional Programming, Volume 13, Issue 2, March 2003, pages 295-316. This paper is posted at ScholarlyCommons. https://repository.upenn.edu/cis_papers/152 For more information, please contact [email protected]. TinkerType: a language for playing with formal systems Abstract TinkerType is a pragmatic framework for compact and modular description of formal systems (type systems, operational semantics, logics, etc.). A family of related systems is broken down into a set of clauses –- individual inference rules -– and a set of features controlling the inclusion of clauses in particular systems. Simple static checks are used to help maintain consistency of the generated systems. We present TinkerType and its implementation and describe its application to two substantial repositories of typed λ-calculi. The first epositr ory covers a broad range of typing features, including subtyping, polymorphism, type operators and kinding, computational effects, and dependent types. It describes both declarative and algorithmic aspects of the systems, and can be used with our tool, the TinkerType Assembler, to generate calculi either in the form of typeset collections of inference rules or as executable ML typecheckers. The second repository addresses a smaller collection of systems, and provides modularized proofs of basic safety properties.
    [Show full text]
  • On Diagonal Argument. Russell Absurdities and an Uncountable Notion of Lingua Characterica
    ON DIAGONAL ARGUMENT. RUSSELL ABSURDITIES AND AN UNCOUNTABLE NOTION OF LINGUA CHARACTERICA JAMES DOUGLASS KING Bachelor of Arts, University of Lethbridge, 1996 A Thesis Submitted to the School of Graduate Studies of the University of Lethbridge in Partial Fulfillment of the Requirements for the Degree MASTER OF ARTS Department of Philosophy University of Lethbridge LETHBRIDGE, ALBERTA, CANADA © James Douglass King, 2004 ABSTRACT There is an interesting connection between cardinality of language and the distinction of lingua characterica from calculus rationator. Calculus-type languages have only a countable number of sentences, and only a single semantic valuation per sentence. By contrast, some of the sentences of a lingua have available an uncountable number of semantic valuations. Thus, the lingua-type of language appears to have a greater degree of semantic universality than that of a calculus. It is suggested that the present notion of lingua provides a platform for a theory of ambiguity, whereby single sentences may have multiply - indeed, uncountably - many semantic valuations. It is further suggested that this might lead to a pacification of paradox. This thesis involves Peter Aczel's notion of a universal syntax, Russell's question, Keith Simmons* theory of diagonal argument, Curry's paradox, and a 'Leibnizian' notion of language. iii ACKNOWLEDGEMENTS The following people are due great thanks and gratitude for their constant support and understanding over the considerable time that it took to develop this thesis. They are each sine qua non of my success. Bryson Brown has supported my efforts from beginning to end, since my undergraduate studies when I first found my love of logic and philosophy; he also brought me to understand much that I have otherwise found obscure and/or irrelevant, and he provided important moral support.
    [Show full text]