Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT
|
|
- Samson Atkinson
- 5 years ago
- Views:
Transcription
1 Lambda Calculus Andrés Sicard-Ramírez Universidad EAFIT Semester
2 Bibliography Textbook: Hindley, J. R. and Seldin, J. (2008). Lambda-Calculus and Combinators. An Introduction. Cambridge University Press. Barendregt, Henk and Barendsen, Erik (2000). Introduction to Lambda Calculus. Revisited edition, Mar Barendregt, H. P. (2004). The Lambda Calculus. Its Syntax and Semantics. Revised edition, 6th impression. Vol Studies in Logic and the Foundations of Mathematics. Elsevier. Paulson, Lawrence C. (2000). Foundations of Functional Programming. Lecture notes. url: (visited on 09/12/2016). Introduction 2/49
3 What is the Lambda Calculus? Invented by Alonzo Church (around 1930s). The goal was to use it in the foundation of mathematics. Intended for studying functions and recursion. Computability model. Model of untyped functional programming languages. Lambda Calculus 3/49
4 Introduction λ-calculus is a collection of several formal systems λ-notation Anonymous functions Currying Lambda Calculus 4/49
5 Introduction Definition (λ-terms) The set of λ-terms is inductively defined by v V v λ-terms (atom) c C c λ-terms (atom) M, N λ-terms (MN) λ-terms (application) M λ-terms, x V (λx.m) λ-terms (abstraction) where V/C is a set of variables/constants. Lambda Calculus 5/49
6 Introduction Conventions and syntactic sugar Example M N means the syntactic identity Application associates to the left MN 1... N k means (...((MN 1 )N 2 )...N k ) Application has higher precedence λx.p Q means (λx.(p Q)) λx 1 x 2... x n.m means (λx 1.(λx 2.(... (λx n.m)... ))) (λxyz.xz(yz))uvw ((((λx.(λy.(λz.((xz)(yz)))))u)v)w). Lambda Calculus 6/49
7 Term-Structure and Substitution Substitution ([N/x]M) The result of substituting N for every free occurrence of x in M, and changing bound variables to avoid clashes. [N/x]x N (1) [N/x]a a for all atoms a x (2) [N/x](P Q) ([N/x]P [N/x]Q) (3) [N/x](λx.P ) λx.p [N/x](λy.P ) λy.p y x, x F V (P ) (5) [N/x](λy.P ) λy.[n/x]p y x, x F V (P ), (6) y F V (N) [N/x](λy.P ) λz.[n/x][z/y]p y x, x F V (P ), (7) y F V (N) where in the last equation, z is chosen to be a variable F V (NP ). Lambda Calculus 7/49 (4)
8 Term-Structure and Substitution Example [(λy.vy)/x](y(λv.xv)) y(λz.(λy.vy)z) (with z v, y, x). Lambda Calculus 8/49
9 Term-Structure and Substitution α-conversion or changed of bound variables Replace λx.m by λy.[y/x]m (y F V (M)). α-congruence (P α Q) P is changed to Q by a finite (perhaps empty) series of α-conversions. Example Whiteboard. Theorem The relation α is an equivalence relation. Lambda Calculus 9/49
10 Beta-Reduction β-contraction ( 1β ) (λx.m)n: β-redex [N/x]M: contractum (λx.m)n 1β [N/x]M P 1β Q: Replace an occurrence of (λx.m)n in P by [N/x]M. Example Whiteboard. β-reduction (P β Q) P is changed to Q by a finite (perhaps empty) series of β-contractions and α-conversions. Example (λx.(λy.yx)z)v β zv. Lambda Calculus 10/49
11 Beta-Reduction β-normal form A term which contains no β-redex. β-nf: The set of all β-normal forms. Example Whiteboard. Lambda Calculus 11/49
12 Beta-Reduction Theorem (The Church-Rosser theorem for β (the diamond property)) P P β M P β N T.M β T N β T M T N Corollary If P has a β-normal form, it is unique modulo α ; that is, if P has β-normal forms M and N, then M α N. Proof Whiteboard. Lambda Calculus 12/49
13 Beta-Equality β-equality or β-convertibility (P = β Q) Exist P 0,..., P n such that P 0 P P n Q ( i n 1)(P i 1β P i+1 P i+1 1β P i P i α P i+1 ) Theorem (Church-Rosser theorem for = β ) Proof Whiteboard. P = β Q T.P β T Q β T Lambda Calculus 13/49
14 Beta-Equality Corollary If P, Q β-nf and P = β Q, then P α Q. Corollary The relation = β is non-trivial (not all terms are β-convertible to each other). Proof Whiteboard. Lambda Calculus 14/49
15 What is the Combinatory Logic? Invented by Moses Schönfinkel (1920) and Haskell Curry (1927). Intended for clarify the role of quantified variables. Idea: To do logic and mathematics without use bound variables. Combinators: Operators which manipulate expressions by cancellation, duplication, bracketing and permutation. Combinatory Logic 15/49
16 Introduction Example (Informally) The commutative law for addition xy.x + y = y + x, can be written as A = CA, where Axy represents x + y and C is a combinator with the property Cfxy = fyx. Combinatory Logic 16/49
17 Introduction Example (Combinators) B f g x = f (g x) B f g x = g (f x) I x = x K x y = x S f g x = f x (g x) W f x = f x x A composition operator A reversed composition operator The identity operator A projection operator A stronger composition operator A doubling operator Combinatory Logic 17/49
18 Introduction Definition (CL-terms) The set of CL-terms is inductively defined by v V v CL-terms c C c CL-terms X, Y CL-terms (XY ) CL-terms where V : Set of variables C = {I, K, S,... } : Set of atomic constants Combinatory Logic 18/49
19 Introduction F V (X): The set of variables occurring in X. Atoms, basic combinators and combinator A atom is a variable or atomic constant. The basic combinators are I, K and S. A combinator is a CL-term whose only atoms are basic combinators. Substitution ([U/x]Y ) The result of substituting U for every occurrence of x in Y : [U/x]x U [U/x]a a [U/x](V W ) ([U/x]V [U/x]W ) for all atoms a x Combinatory Logic 19/49
20 Weak Reduction Weak redex The CL-terms I X, K X Y and S X Y Z. Weak contraction (U 1w V ) Replace an occurrence of a weak redex in U using: Weak reduction (U w V ) I X by X, K X Y by X, S X Y Z by X Z (Y Z). U is changed to V by a finite (perhaps empty) series of weak contractions. Weak normal form A CL-term which contains no weak redex. Combinatory Logic 20/49
21 Weak Reduction Example (whiteboard) B S(KS)K. Then BXY Z w X(Y Z). W SS(KI). Then WXY w XY Y. WWW w WWW w Theorem (Church-Rosser theorem for w ) P w M P w N T.M w T N w T Corollary (Uniqueness of nf) A CL-term can have at most one weak normal form. Combinatory Logic 21/49
22 Weak Equality Weak equality or weak convertibility (X = w Y ) Exist X 0,..., X n such that X 0 X X n Y ( i n 1)(X i 1w X i+1 X i+1 1w X i ) Theorem (Church-Rosser theorem for = w ) Corollary X = w Y T.X w T Y w T If X and Y are distinct weak normal forms, them X w Y ; in particular S w K. Hence = w is non-trivial in the sense that not all terms are weakly equal. Combinatory Logic 22/49
23 Fixed-Point Combinators Idea For every term F there is a term X such F X = β X. The term X is called a fixed-point of F. Theorem F X.F X = β X. Proof. Let W λx.f (xx), and let X W W. Then X (λx.f (xx))w = β F (W W ) F X Combinatory Logic 23/49
24 Fixed-Point Combinators Fixed-point combinator A fixed-point combinator is any combinator Y such YF = β F (YF ), for all terms F. Theorem (Turing) The term Y UU, where U λux.x(uux) is a fixed-point combinator. Proof Whiteboard. Theorem (Curry and Rosenbloom) The term Y λf.v V, where V λx.f(xx) is a fixed-point combinator. Proof Whiteboard. Combinatory Logic 24/49
25 Fixed-Point Combinators Corollary For every term Z and n 0, the equation xy 1... y n = Z can be solved for x. That is, there is a term X such that Xy 1... y n = β [X/x]Z. Proof X Y(λxy 1... y n.z) (whiteboard). Combinatory Logic 25/49
26 Reduction Strategies Idea Proving that a given term has no normal form. Contraction (X R Y ) X R Y : R is an redex in X and Y is the result of contracting R in X. Example (λx.(λy.yx)z)v (λy.yx)z (λx.zx)v. Combinatory Logic 26/49
27 Reduction Strategies Reduction A reduction ρ is a finite or infinite sequence of contractions separated by α-conversions X 1 R1 Y 1 α X 2 R2... Question Given an initial term X, there is some way of choosing a reduction that will terminate if X has a normal form? Combinatory Logic 27/49
28 Reduction Strategies Outermost (maximal) redex A redex is called outermost iff it is not contained in any other redex. Normal-order evaluation (left-most reduction) (call-by-name) In every contraction, the contracted redex is the leftmost outermost. Eager evaluation (call-by-value) A redex is reduced only when its right hand side has reduced to a canonical form (variable, constant or lambda abstraction). Example (Whiteboard). 1. (λy.a)ω, where Ω (λx.xx)(λx.xx) 2. (λx.xx)((λy.yy)(λz.zz)) Combinatory Logic 28/49
29 Reduction Strategies Theorem (Standardization theorem (left-most reduction theorem)) If a term X has a normal form X, then the normal-order evaluation of X is finite and ends at X. Combinatory Logic 29/49
30 Lambda Calculus and Inconsistencies Curry paradox (λ-calculus + logic) Rosser (1984, p. 340) descriptions of the paradox: Suppose we have two familiar logical principles: Φ Φ Applying (10) to the second Φ gives P P (8) (P (P Q)) (P Q) (9) together with modus ponens (if P and P Q, then Q). We undertake to prove an arbitrary proposition A. We construct a Φ such that Φ = Φ A (10) To do this, we take F = λx(x A) in the fixed-point theorem. By (8), we get Φ (Φ A) By (9) and modus ponens, we get Φ A By (10) reversed, we get By modus ponens and the last two formulas, we get A Lambda Calculus and Inconsistencies 30/49 Φ
31 Lambda Calculus and Inconsistencies Rusell paradox (λ-calculus + set theory) See (Paulson 2000, 4.6). Lambda Calculus and Inconsistencies 31/49
32 Encoding Data in the Lambda Calculus (From (Paulson 2000, Ch. 3)) Booleans true λxy.x false λxy.y if λpxy.pxy where if true M N = β M if false M N = β N Encoding Data in the Lambda Calculus 32/49
33 Encoding Data in the Lambda Calculus Ordered pairs pair λxyf.fxy fst λp.p true snd = λp.p false where fst (pair M N) = β M snd (pair M N) = β N Encoding Data in the Lambda Calculus 33/49
34 Encoding Data in the Lambda Calculus Natural numbers Notation: X n Y X(X(... (X Y )... )) if n 1, }{{} n X s X 0 Y Y. The Church numerals: n λfx.f n x Encoding Data in the Lambda Calculus 34/49
35 Encoding Data in the Lambda Calculus Some operations: add λmnfx.mf(nfx) mult λmnfx.m(nf)x iszero λn.n(λx.false) true where add m n = β m + n mult m n = β m n iszero 0 = β true iszero n + 1 = β false Encoding Data in the Lambda Calculus 35/49
36 Recursion Using Fixed-Points Example (Informally (Peyton Jones 1987)) fac λn.if n = 0 then 1 else n fac (n 1) fac λn.(... fac... ) fac (λfn.(... f... )) fac h λfn.(... f... ) - - not recursive! fac h fac - - fac is a fixed-point of h! fac Yh Encoding Data in the Lambda Calculus 36/49
37 Recursion Using Fixed-Points Example (cont.) fac 1 Yh 1 = β h(yh) 1 (λfn.(... f... ))(Yh) 1 β if 1 = 0 then 1 else 1 (Yh 0) β 1 (Yh 0) = β 1 (h(yh) 0) 1 ((λfn.(... f... ))(Yh)0) β 1 (if 0 = 0 then 1 else 1 (Yh ( 1))) β 1 1 β 1 Encoding Data in the Lambda Calculus 37/49
38 Representing the Computable Functions Representability Let ϕ a partial function ϕ : N n N. A term X represents ϕ iff Example ϕ(m 1,..., m n ) = p Xm 1... m n = β p, ϕ(m 1,..., m n ) does not exits Xm 1... m n has no nf. The successor function succ(n) = n + 1 is represented by succ λnfx.f(nfx) Theorem (Representation of Turing-computable functions) In λ-calculus every Turing-computable function can be represented by a combinator. Encoding Data in the Lambda Calculus 38/49
39 Undecidability Gödel number #M #x i = 2 i #(λx i.m) = 3 i 5 #M #(MN) = 7 #M 11 #N Notation: M = #M Theorem (Double fixed-point theorem) F X.F X = β X Proof Whiteboard. Encoding Data in the Lambda Calculus 39/49
40 Undecidability Theorem (Rice s theorem for the λ-calculus) Let A λ-terms such as A is non-trivial (i.e. A, A λ-terms). Suppose that A is closed under = β (i.e. M A, M = β N N A). Then A is no recursive, that is #A = {#M M A} is not recursive. Proof Whiteboard (see (H. Barendregt 1990)). Theorem The set NF = {M M has a normal form} is not recursive. Proof. The set NF is not trivial and it is closed under = β. Encoding Data in the Lambda Calculus 40/49
41 ISWIM: Lambda Calculus as a Programming Language ISWIM: If you See What I Mean Landin (1966) ISWIM 41/49
42 ISWIM Features (From (Paulson 2000, Ch. 3)) Simple declaration let x = M in N (λx.n)m Example let n = 0 in succ n let m = 0 in (let n = 1 in add m n) Function declaration let fx 1... x k = M in N (λf.n)(λx 1... x k.m) Example let succ n = λfx.f(nfx) in succ 0 ISWIM 42/49
43 ISWIM Features Recursive declaration letrec fx 1... x k = M in N (λf.n)(y(λfx 1... x k.m)) Example letrec fac n = if (n == 0) 1 (n fac(n 1)) in fac 0 Pairs (M, N) : pair constructor fst, snd : projections let λ(x, y).e λz.(λxy.e)(fst z)(snd z) Example let (x, y) = (2, 3) in add x y ISWIM 43/49
44 The Formal Theory λβ of β-equality Formulas M = N, where M, N λ-terms. Axiom-schemes (α) λx.m = λy.[y/x]m if y F V (M), (β) (λx.m)n = [N/x]M, (ρ) M = M. Rules of inference M = M (µ) NM = NM M = M λx.m = λx.m (ξ) M = N (σ) N = M M = M (ν) MN = M N M = N N = P (τ) M = P Formal Theory 44/49
45 The Formal Theory λβ of β-equality Deductions If there is a deduction of B from the assumptions A 1,..., A n in λβ) is denoted by λβ, A 1,..., A n B. Theorems If the formula B is probable in λβ) is denoted by Remark λβ B. λβ is a equational theory and it is a logic-free theory (there are not logical connectives or quantifiers in its formulae). Formal Theory 45/49
46 The Formal Theory λβ of β-equality Example Let M and N two closed terms (λx.(λy.x))m = [M/x]λy.x λy.m (ν) (λx.(λy.x))mn = (λy.m)n (λy.m)n = [N/y]M M (τ) (λx.(λy.x))mn = M That is to say, λβ (λxy.x)mn = M. Theorem M = β N λβ M = N. Formal Theory 46/49
47 The Formal Theory λβ of β-reduction Similar to the formal theory of β-equality, but: 1. Formulas: M β N. 2. To change = by β. 3. Remove the rule (σ). Theorem M β N λβ M β N. Remark Formal theories for combinatory logic. Remark λβ is not a first-order theory. Formal Theory 47/49
48 References Barendregt, H. P. (2004). The Lambda Calculus. Its Syntax and Semantics. Revised edition, 6th impression. Vol Studies in Logic and the Foundations of Mathematics. Elsevier (cit. on p. 2). Barendregt, Henk (1990). Functional Programming and Lambda Calculus. In: Handbook of Theoretical Computer Science. Ed. by van Leeuwen, J. Vol. B. Formal Models and Semantics. MIT Press. Chap. 7. doi: /B (cit. on p. 40). Barendregt, Henk and Barendsen, Erik (2000). Introduction to Lambda Calculus. Revisited edition, Mar (cit. on p. 2). Hindley, J. R. and Seldin, J. (2008). Lambda-Calculus and Combinators. An Introduction. Cambridge University Press (cit. on p. 2). Landin, P. J. (1966). The Next 700 Programming Languages. In: Communications of the ACM 9.3, pp (cit. on p. 41). Paulson, Lawrence C. (2000). Foundations of Functional Programming. Lecture notes. url: (visited on 09/12/2016) (cit. on pp. 2, 31, 32, 42).
49 References Peyton Jones, Simon L. (1987). The Implementation of Functional Programming Languages. Prentice-Hall International (cit. on p. 36). Rosser, J. Barkley (1984). Highlights of the History of Lambda-Calculus. In: Annals of the History of Computing 6.4, pp doi: /MAHC (cit. on p. 30).
l-calculus and Decidability
U.U.D.M. Project Report 2017:34 l-calculus and Decidability Erik Larsson Examensarbete i matematik, 15 hp Handledare: Vera Koponen Examinator: Jörgen Östensson Augusti 2017 Department of Mathematics Uppsala
More informationOrigin in Mathematical Logic
Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF Origin
More informationOrigin in Mathematical Logic
Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF The Combinatory
More informationThe Lambda Calculus. Stephen A. Edwards. Fall Columbia University
The Lambda Calculus Stephen A. Edwards Columbia University Fall 2014 Lambda Expressions Function application written in prefix form. Add four and five is (+ 4 5) Evaluation: select a redex and evaluate
More informationLecture 2. Lambda calculus. Iztok Savnik, FAMNIT. March, 2018.
Lecture 2 Lambda calculus Iztok Savnik, FAMNIT March, 2018. 1 Literature Henk Barendregt, Erik Barendsen, Introduction to Lambda Calculus, March 2000. Lambda calculus Leibniz had as ideal the following
More informationLambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010
Lambda-Calculus (I) jean-jacques.levy@inria.fr 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010 Plan computation models lambda-notation bound variables conversion
More informationλ Slide 1 Content Exercises from last time λ-calculus COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification
Content COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification Toby Murray, June Andronick, Gerwin Klein λ Slide 1 Intro & motivation, getting started [1] Foundations & Principles Lambda
More informationThe Lambda-Calculus Reduction System
2 The Lambda-Calculus Reduction System 2.1 Reduction Systems In this section we present basic notions on reduction systems. For a more detailed study see [Klop, 1992, Dershowitz and Jouannaud, 1990]. Definition
More informationModels of computation
Lambda-Calculus (I) jean-jacques.levy@inria.fr 2nd Asian-Pacific Summer School on Formal ethods Tsinghua University, August 23, 2010 Plan computation models lambda-notation bound variables odels of computation
More informationLecture 3. Lambda calculus. Iztok Savnik, FAMNIT. October, 2015.
Lecture 3 Lambda calculus Iztok Savnik, FAMNIT October, 2015. 1 Literature Henk Barendregt, Erik Barendsen, Introduction to Lambda Calculus, March 2000. Lambda calculus Leibniz had as ideal the following
More informationSimply Typed λ-calculus
Simply Typed λ-calculus Lecture 1 Jeremy Dawson The Australian National University Semester 2, 2017 Jeremy Dawson (ANU) COMP4630,Lecture 1 Semester 2, 2017 1 / 23 A Brief History of Type Theory First developed
More informationIntroduction to λ-calculus
p.1/65 Introduction to λ-calculus Ken-etsu FUJITA fujita@cs.gunma-u.ac.jp http://www.comp.cs.gunma-u.ac.jp/ fujita/ Department of Computer Science Gunma University :Church 32, 36, 40; Curry 34 1. Universal
More informationMathematical Logic IV
1 Introduction Mathematical Logic IV The Lambda Calculus; by H.P. Barendregt(1984) Part One: Chapters 1-5 The λ-calculus (a theory denoted λ) is a type free theory about functions as rules, rather that
More informationComputability via the Lambda Calculus with Patterns
Computability via the Lambda Calculus with Patterns Bodin Skulkiat (Corresponding author) Department of Mathematics, Faculty of Science Chulalongkorn University, Bangkok, Thailand Tel: 66-89-666-5804 E-mail:
More informationTyping λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus
Course 2D1453, 200607 Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Some material from B. Pierce: TAPL + some from G. Klein, NICTA Typing λterms The uptyped λcalculus
More informationFunctional Programming with Coq. Yuxin Deng East China Normal University
Functional Programming with Coq Yuxin Deng East China Normal University http://basics.sjtu.edu.cn/ yuxin/ September 10, 2017 Functional Programming Y. Deng@ECNU 1 Reading materials 1. The Coq proof assistant.
More informationReview. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007
CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation
More informationLazy Strong Normalization
Lazy Strong Normalization Luca Paolini 1,2 Dipartimento di Informatica Università di Torino (ITALIA) Elaine Pimentel 1,2 Departamento de Matemática Universidade Federal de Minas Gerais (BRASIL) Dipartimento
More informationHenk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012
1 λ Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky Radboud University Nijmegen March 5, 2012 2 reading Femke van Raamsdonk Logical Verification Course Notes Herman Geuvers Introduction to
More informationKomponenten- und Service-orientierte Softwarekonstruktion
Komponenten- und Service-orientierte Softwarekonstruktion Vorlesung 5: Combinatory Logic Synthesis Jakob Rehof LS XIV Software Engineering TU Dortmund Sommersemester 2015 SS 2015 J. Rehof (TU Dortmund)
More informationProgramming Language Concepts: Lecture 18
Programming Language Concepts: Lecture 18 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 18, 30 March 2009 One step reduction
More informationAdvanced Lambda Calculus. Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands
Advanced Lambda Calculus Henk Barendregt & Giulio Manzonetto ICIS Faculty of Science Radboud University Nijmegen, The Netherlands Form of the course Ordinary lecture Seminar form Exam: working out an exercise
More informationThe λ-calculus and Curry s Paradox Drew McDermott , revised
The λ-calculus and Curry s Paradox Drew McDermott drew.mcdermott@yale.edu 2015-09-23, revised 2015-10-24 The λ-calculus was invented by Alonzo Church, building on earlier work by Gottlob Frege and Moses
More informationCOMP6463: λ-calculus
COMP6463: λ-calculus 1. Basics Michael Norrish Michael.Norrish@nicta.com.au Canberra Research Lab., NICTA Semester 2, 2015 Outline Introduction Lambda Calculus Terms Alpha Equivalence Substitution Dynamics
More informationCS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus
CS 4110 Programming Languages & Logics Lecture 16 Programming in the λ-calculus 30 September 2016 Review: Church Booleans 2 We can encode TRUE, FALSE, and IF, as: TRUE λx. λy. x FALSE λx. λy. y IF λb.
More informationProgramming Language Concepts: Lecture 16
Programming Language Concepts: Lecture 16 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 16, 23 March 2009 λ-calculus:
More informationProgramming Languages
CSE 230: Winter 2010 Principles of Programming Languages Lecture 10: Programming in λ-calculusc l l Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2
More informationConsistency of a Programming Logic for a Version of PCF Using Domain Theory
Consistency of a Programming Logic for a Version of PCF Using Domain Theory Andrés Sicard-Ramírez EAFIT University Logic and Computation Seminar EAFIT University 5 April, 3 May 2013 A Core Functional Programming
More informationCombinators & Lambda Calculus
Combinators & Lambda Calculus Abstracting 1/16 three apples plus two pears = five fruits concrete 3+2 = 5 abstract objects a+b = b+a a (b c) = (a b) c abstract quantities abstract operations a, b[r(a,
More informationLambda-Calculus (cont): Fixpoints, Naming. Lecture 10 CS 565 2/10/08
Lambda-Calculus (cont): Fixpoints, Naming Lecture 10 CS 565 2/10/08 Recursion and Divergence Consider the application: Ω ((λ x. (x x)) (λ x. (x x))) Ω evaluates to itself in one step. It has no normal
More informationFORMAL SYSTEMS: COMBINATORY LOGIC
FORMAL SYSTEMS: COMBINATORY LOGIC AND λ-calculus Andrew R. Plummer Department of Linguistics The Ohio State University 30 Sept., 2009 OUTLINE 1 INTRODUCTION 2 APPLICATIVE SYSTEMS 3 USEFUL INFORMATION COMBINATORY
More informationNICTA Advanced Course. Theorem Proving Principles, Techniques, Applications
NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural
More informationAn Introduction to the Lambda Calculus
An Introduction to the Lambda Calculus Mayer Goldberg February 20, 2000 1 Notation and Conventions It is surprising that despite the simplicity of its syntax, the λ-calculus hosts a large body of notation,
More informationReducibility proofs in λ-calculi with intersection types
Reducibility proofs in λ-calculi with intersection types Fairouz Kamareddine, Vincent Rahli, and J. B. Wells ULTRA group, Heriot-Watt University, http://www.macs.hw.ac.uk/ultra/ March 14, 2008 Abstract
More informationLogic and Probability Lecture 3: Beyond Boolean Logic
Logic and Probability Lecture 3: Beyond Boolean Logic Wesley Holliday & Thomas Icard UC Berkeley & Stanford August 13, 2014 ESSLLI, Tübingen Wesley Holliday & Thomas Icard: Logic and Probability, Lecture
More informationType Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.
Type Systems Lecture 2 Oct. 27th, 2004 Sebastian Maneth http://lampwww.epfl.ch/teaching/typesystems/2004 Today 1. What is the Lambda Calculus? 2. Its Syntax and Semantics 3. Church Booleans and Church
More informationAdvanced Lambda Calculus Lecture 5
Advanced Lambda Calculus Lecture 5 The fathers Alonzo Church (1903-1995) as mathematics student at Princeton University (1922 or 1924) Haskell B. Curry (1900-1982) as BA in mathematics at Harvard (1920)
More informationCharles Wells 1. February 25, 1999
NOTES ON THE λ-calculus Charles Wells 1 February 25, 1999 Department of Mathematics Case Western Reserve University 10900 Euclid Ave. Cleveland, OH 44106-7058 USA charles@freude.com http://www.cwru.edu/artsci/math/wells/home.html
More informationIntroduction to lambda calculus Part 2
Introduction to lambda calculus Part 2 Antti-Juhani Kaijanaho 2017-01-24... 1 Untyped lambda calculus 1.1 Syntax... x, y, z Var t, u Term t, u ::= x t u λx t... In this document, I will be using the following
More informationSHARING IN THE WEAK LAMBDA-CALCULUS REVISITED
SHARING IN THE WEAK LAMBDA-CALCULUS REVISITED TOMASZ BLANC, JEAN-JACQUES LÉVY, AND LUC MARANGET INRIA e-mail address: tomasz.blanc@inria.fr INRIA, Microsoft Research-INRIA Joint Centre e-mail address:
More informationNotes on Logical Frameworks
Notes on Logical Frameworks Robert Harper IAS November 29, 2012 1 Introduction This is a brief summary of a lecture on logical frameworks given at the IAS on November 26, 2012. See the references for technical
More informationTyped Lambda Calculi. Nikos Tzeveλekos Queen Mary, University of London 1 / 23
Typed Lambda Calculi Nikos Tzeveλekos Queen Mary, University of London 1 / 23 What is the Lambda Calculus A minimal formalism expressing computation with functionals s ::= x λx.s ss All you need is lambda.
More informationsummer school Logic and Computation Goettingen, July 24-30, 2016
Università degli Studi di Torino summer school Logic and Computation Goettingen, July 24-30, 2016 A bit of history Alonzo Church (1936) The as formal account of computation. Proof of the undecidability
More information3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.
32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,
More informationTYPED LAMBDA CALCULI. Andrzej S. Murawski University of λeicester.
TYPED LAMBDA CALCULI Andrzej S. Murawski University of λeicester http://www.cs.le.ac.uk/people/amurawski/mgs2011-tlc.pdf THE COURSE The aim of the course is to provide an introduction to the lambda calculus
More informationLambda Calculus with Types. Henk Barendregt ICIS Radboud University Nijmegen The Netherlands
Lambda Calculus with Types Henk Barendregt ICIS Radboud University Nijmegen The Netherlands New book Cambridge University Press / ASL Perspectives in Logic, 2011 Lambda Calculus with Types (698 pp) Authors:
More informationIntersection and Singleton Type Assignment Characterizing Finite Böhm-Trees
Information and Computation 178, 1 11 (2002) doi:101006/inco20022907 Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees Toshihiko Kurata 1 Department of Mathematics, Tokyo Metropolitan
More informationConstructive approach to relevant and affine term calculi
Constructive approach to relevant and affine term calculi Jelena Ivetić, University of Novi Sad, Serbia Silvia Ghilezan,University of Novi Sad, Serbia Pierre Lescanne, University of Lyon, France Silvia
More informationThis page intentionally left blank
This page intentionally left blank Lambda-Calculus and Combinators, an Introduction Combinatory logic and λ-calculus were originally devised in the 1920s for investigating the foundations of mathematics
More information3.2 Equivalence, Evaluation and Reduction Strategies
3.2 Equivalence, Evaluation and Reduction Strategies The λ-calculus can be seen as an equational theory. More precisely, we have rules i.e., α and reductions, for proving that two terms are intensionally
More informationRewriting, Explicit Substitutions and Normalisation
Rewriting, Explicit Substitutions and Normalisation XXXVI Escola de Verão do MAT Universidade de Brasilia Part 1/3 Eduardo Bonelli LIFIA (Fac. de Informática, UNLP, Arg.) and CONICET eduardo@lifia.info.unlp.edu.ar
More informationType Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth
Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,
More informationApplied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw
Applied Logic Lecture 1 - Propositional logic Marcin Szczuka Institute of Informatics, The University of Warsaw Monographic lecture, Spring semester 2017/2018 Marcin Szczuka (MIMUW) Applied Logic 2018
More informationAlonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms
Alonzo Church (1903-1995) Lambda Calculus 2 λ-calculus : syntax Grammar for terms : t, u ::= x (variable) t u (application) λx.t (abstraction) Notation : Application is left-associative so that t 1 t 2...
More informationCS522 - Programming Language Semantics
1 CS522 - Programming Language Semantics Simply Typed Lambda Calculus Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 We now discuss a non-trivial extension of
More informationProvably Total Functions of Arithmetic with Basic Terms
Provably Total Functions of Arithmetic with Basic Terms Evgeny Makarov INRIA Orsay, France emakarov@gmail.com A new characterization of provably recursive functions of first-order arithmetic is described.
More informationLogical Preliminaries
Logical Preliminaries Johannes C. Flieger Scheme UK March 2003 Abstract Survey of intuitionistic and classical propositional logic; introduction to the computational interpretation of intuitionistic logic
More informationSimply Typed Lambda-Calculi (II)
THEORY AND PRACTICE OF FUNCTIONAL PROGRAMMING Simply Typed Lambda-Calculi (II) Dr. ZHANG Yu Institute of Software, Chinese Academy of Sciences Fall term, 2011 GUCAS, Beijing Introduction PCF Programming
More informationPredicate Logic - Undecidability
CS402, Spring 2016 Undecidable Problems Does the following program halts? (1) N : n, total, x, y, z (2) n GetUserInput() (3) total 3 (4) while true (5) for x 1 to total 2 (6) for y 1 to total x 1 (7) z
More information185.A09 Advanced Mathematical Logic
185.A09 Advanced Mathematical Logic www.volny.cz/behounek/logic/teaching/mathlog13 Libor Běhounek, behounek@cs.cas.cz Lecture #1, October 15, 2013 Organizational matters Study materials will be posted
More informationLecture Notes on Combinatory Modal Logic
Lecture Notes on Combinatory Modal Logic 15-816: Modal Logic Frank Pfenning Lecture 9 February 16, 2010 1 Introduction The connection between proofs and program so far has been through a proof term assignment
More information1. each λ-variable is a λρ-term, called atom or atomic term, 2. if M and N are λρ-term then (MN) is a λρ-term called application,
Yuichi Komori Arato Cho λρ-calculus abstract. In [K02], one of the authors introduced the system λρ-calculus and stated without proof that the strong normalization theorem hold. We have discovered an elegant
More informationSequent Combinators: A Hilbert System for the Lambda Calculus
Sequent Combinators: A Hilbert System for the Lambda Calculus Healfdene Goguen Department of Computer Science, University of Edinburgh The King s Buildings, Edinburgh, EH9 3JZ, United Kingdom Fax: (+44)
More informationModels of Computation,
Models of Computation, 2010 1 The Lambda Calculus A brief history of mathematical notation. Our notation for numbers was introduced in the Western World in the Renaissance (around 1200) by people like
More informationInformal Statement Calculus
FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example
More informationPropositional Logic: Part II - Syntax & Proofs 0-0
Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems
More informationGraph models for the untyped λ-calculus
Graph models for the untyped λ-calculus Kelley Philip van Evert On the cover: a picture I drew of Dana Scott. Graph models for the untyped λ-calculus Kelley Philip van Evert 4046854 Bachelor s thesis in
More informationOn Upper Bounds on the Church-Rosser Theorem
On Upper Bounds on the Church-Rosser Theorem Ken-etsu Fujita Department of Computer Science Gunma University Kiryu, Japan fujita@cs.gunma-u.ac.jp The Church-Rosser theorem in the type-free λ-calculus is
More informationGraph lambda theories
Under consideration for publication in Math. Struct. in Comp. Science Graph lambda theories A N T O N I O B U C C I A R E L L I 1 and A N T O N I N O S A L I B R A 2 1 Equipe PPS (case 7014), Université
More informationSimply Typed λ-calculus
Simply Typed λ-calculus Lecture 2 Jeremy Dawson The Australian National University Semester 2, 2017 Jeremy Dawson (ANU) COMP4630,Lecture 2 Semester 2, 2017 1 / 19 Outline Properties of Curry type system:
More informationSemantics of Higher-Order Functional Programming
Semantics of Higher-Order Functional Programming Petros Barbagiannis µ λ July 14, 2014 Petros Barbagiannis Semantics of Higher-Order Functional Programming July 14, 2014 1 / 18 Introduction Higher-order
More informationA probabilistic lambda calculus - Some preliminary investigations
A probabilistic lambda calculus - Some preliminary investigations Ugo Dal Lago, Margherita Zorzi Università di Bologna, Università di Verona June, 9-11, 2010, Torino Introduction: Λ P We present some results
More informationNon-Idempotent Typing Operators, beyond the λ-calculus
Non-Idempotent Typing Operators, beyond the λ-calculus Soutenance de thèse Pierre VIAL IRIF (Univ. Paris Diderot and CNRS) December 7, 2017 Non-idempotent typing operators P. Vial 0 1 /46 Certification
More informationCategories, Proofs and Programs
Categories, Proofs and Programs Samson Abramsky and Nikos Tzevelekos Lecture 4: Curry-Howard Correspondence and Cartesian Closed Categories In A Nutshell Logic Computation 555555555555555555 5 Categories
More informationLambda Calculus. Yuxi Fu. 31 May, 2013
Lambda Calculus Yuxi Fu 31 May, 2013 Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica,
More informationEquivalent Computers. Lecture 39: Lambda Calculus. Lambda Calculus. What is Calculus? Real Definition. Why?
#,, - Lecture 39: Lambda Calculus Equivalent Computers z z z... term = variable term term (term) λ variable. term λy. M α λv. (M [y α v]) where v does not occur in M. (λx. M)N β M [ x α N ] Turing Machine
More informationSubtyping and Intersection Types Revisited
Subtyping and Intersection Types Revisited Frank Pfenning Carnegie Mellon University International Conference on Functional Programming (ICFP 07) Freiburg, Germany, October 1-3, 2007 Joint work with Rowan
More informationSmall families. (at INRIA with Gérard and in the historical λ-calculus) Jean-Jacques Lévy
Small families (at INRIA with Gérard and in the historical λ-calculus) Jean-Jacques Lévy INRIA Rocquencourt and Microsoft Research-INRIA Joint Centre June 22, 2007 caml years coq sixty years is 31,557,600
More informationOn Modal Logics of Partial Recursive Functions
arxiv:cs/0407031v1 [cs.lo] 12 Jul 2004 On Modal Logics of Partial Recursive Functions Pavel Naumov Computer Science Pennsylvania State University Middletown, PA 17057 naumov@psu.edu June 14, 2018 Abstract
More informationNotes on the λ-calculus
Notes on the λ-calculus J.R.B. Cockett Department of Computer Science, University of Calgary Calgary, T2N 1N4, Alberta, Canada November 30, 2017 1 Introduction The λ-calculus was one of the first descriptions
More informationLambda Calculus and Types
Lambda Calculus and Types (complete) Andrew D. Ker 16 Lectures, Hilary Term 2009 Oxford University Computing Laboratory ii Contents Introduction To The Lecture Notes vii 1 Terms, Equational Theory 1 1.1
More informationTyped Arithmetic Expressions
Typed Arithmetic Expressions CS 550 Programming Languages Jeremy Johnson TAPL Chapters 3 and 5 1 Types and Safety Evaluation rules provide operational semantics for programming languages. The rules provide
More informationFirst-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms
First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO
More informationFIXED POINTS AND EXTENSIONALITY IN TYPED FUNCTIONAL PROGRAMMING LANGUAGES
FIXED POINTS AND EXTENSIONALITY IN TYPED FUNCTIONAL PROGRAMMING LANGUAGES a dissertation submitted to the department of computer science and the committee on graduate studies of stanford university in
More informationAn Introduction to Modal Logic III
An Introduction to Modal Logic III Soundness of Normal Modal Logics Marco Cerami Palacký University in Olomouc Department of Computer Science Olomouc, Czech Republic Olomouc, October 24 th 2013 Marco Cerami
More informationHOAS by example What is a Formal System? A Simply Typed Framework What Does it Mean? Canonical LF References HOAS. Randy Pollack
HOAS Randy Pollack Version of November 2, 2011 Outline 1 HOAS by example 2 What is a Formal System? 3 A Simply Typed Framework 4 What Does it Mean? 5 Canonical LF Judgement Forms and Rules Hereditary Substitution
More information1. Object Calculus. Object calculus is to OO languages what lambda calculus is to functional languages
1. Object Calculus In this section we will introduce a calculus of objects that gives a simple but powerful mathematical model to study object based languages. Object calculus is to OO languages what lambda
More informationParallel Reduction in Type Free Lambda-mu- Calculus
九州大学学術情報リポジトリ Kyushu University Institutional Repository Parallel Reduction in Type Free Lambda-mu- Calculus Baba, Kensuke Graduate School of Information Science and Electrical Engineering, Kyushu University
More informationarxiv: v1 [cs.lo] 29 May 2014
An Introduction to the Clocked Lambda Calculus Jörg Endrullis, Dimitri Hendriks, Jan Willem Klop, and Andrew Polonsky VU University Amsterdam, The Netherlands Abstract We give a brief introduction to the
More informationPrinciples of Programming Languages
Principles of Programming Languages Lecture 03 Theoretical Foundations 1 Domains Semantic model of a data type: semantic domain! Examples: Integer, Natural, Truth-Value Domains D are more than a set of
More informationA Common Notation System for the Lambda-Calculus and Combinatory Logic
A Common Notation System for the Lambda-Calculus and Combinatory Logic Masahiko Sato Graduate School of Informatics, Kyoto University Joint work with Takafumi Sakurai and Helmut Schwichtenberg IFIP WG
More informationComputer Science at Kent
Computer Science at Kent New eta-reduction and Church-Rosser Yong Luo Technical Report No. 7-05 October 2005 Copyright c 2005 University of Kent Published by the Computing Laboratory, University of Kent,
More informationFirst-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig
First-Order Logic First-Order Theories Roopsha Samanta Partly based on slides by Aaron Bradley and Isil Dillig Roadmap Review: propositional logic Syntax and semantics of first-order logic (FOL) Semantic
More informationClassical Combinatory Logic
Computational Logic and Applications, CLA 05 DMTCS proc. AF, 2006, 87 96 Classical Combinatory Logic Karim Nour 1 1 LAMA - Equipe de logique, Université de Savoie, F-73376 Le Bourget du Lac, France Combinatory
More informationSemantics with Intersection Types
Semantics with Intersection Types Steffen van Bakel Department of Computing, Imperial College of Science, Technology and Medicine, 180 Queen s Gate, London SW7 2BZ, U.K., E-mail: svb@doc.ic.ac.uk (Sections
More informationPropositional and Predicate Logic. jean/gbooks/logic.html
CMSC 630 February 10, 2009 1 Propositional and Predicate Logic Sources J. Gallier. Logic for Computer Science, John Wiley and Sons, Hoboken NJ, 1986. 2003 revised edition available on line at http://www.cis.upenn.edu/
More informationDiscrete Structures - CM0246 Mathematical Induction
Discrete Structures - CM0246 Mathematical Induction Andrés Sicard-Ramírez EAFIT University Semester 2014-2 Motivation Example Conjecture a formula for the sum of the first n positive odd integers. Discrete
More informationRealisability methods of proof and semantics with application to expansion
Realisability methods of proof and semantics with application to expansion First Year Examination Supervisors : Professor Fairouz Kamareddine and Doctor Joe B. Wells Student : Vincent Rahli ULTRA group,
More informationInfinite λ-calculus and non-sensible models
Infinite λ-calculus and non-sensible models Alessandro Berarducci Dipartimento di Matematica, Università di Pisa Via Buonarroti 2, 56127 Pisa, Italy berardu@dm.unipi.it July 7, 1994, Revised Nov. 13, 1994
More informationOn Undefined and Meaningless in Lambda Definability
On Undefined and Meaningless in Lambda Definability Fer-Jan de Vries Computer Science, University of Leicester, Leicester, UK fdv1@le.ac.uk Abstract We distinguish between undefined terms as used in lambda
More information