Typed Lambda Calculi. Nikos Tzeveλekos Queen Mary, University of London 1 / 23

Size: px
Start display at page:

Download "Typed Lambda Calculi. Nikos Tzeveλekos Queen Mary, University of London 1 / 23"

Transcription

1 Typed Lambda Calculi Nikos Tzeveλekos Queen Mary, University of London 1 / 23

2 What is the Lambda Calculus A minimal formalism expressing computation with functionals s ::= x λx.s ss All you need is lambda. (Simon Peyton-Jones) The aim of the course is to provide an introduction to the lambda calculus along with a selection of results on its operational and denotational semantics. 2 / 23

3 Material Mostly following: A. D. Ker. Lambda Calculus and Types (2009). Background reading: Henk Barendregt. The Lambda Calculus: Its Syntax and Semantics. North-Holland, revised edition (1984). J. Roger Hindley. Basic Simple Type Theory. CUP (1997). Freely downloadable: J.-Y. Girard. Proofs and Types (1990). Barendregt and Barendsen. An Introduction to the Lambda Calculus (1994). R. Loader. Notes on Simply Typed Lambda Calculus (1998). Peter Selinger. Lecture notes on the Lambda Calculus (2007) / 23

4 What is the Lambda Calculus for? it depends on whom you ask Church, Curry (1920s): it is the theory of functions. Turing (1930s): it is the definition of effective computability. Brouwer, Heyting, Kolmogorov,... : it is a representation of logical proofs. (Curry-Howard correspondence; 1920s to present day) McCarthy, Scott,... : it is a basis for the definition of functional programming languages (e.g. haskell). (1950s-60s) Lambek, lots of other category theorists,... : it is the internal language of Cartesian Closed Categories. (1970s) 4 / 23

5 What is the Lambda Calculus for? it depends on whom you ask Church, Curry (1920s): it is the theory of functions. Turing (1930s): it is the definition of effective computability. It is also a vital part of any computer scientist s vocabulary. There Brouwer, are a number Heyting, of Kolmogorov, varieties of λ-calculi,... : it is asuited representation to different oftasks. logical proofs. (Curry-Howard correspondence; 1920s to present day) McCarthy, Scott,... : it is a basis for the definition of functional programming languages (e.g. haskell). (1950s-60s) Lambek, lots of other category theorists,... : it is the internal language of Cartesian Closed Categories. (1970s) 4 / 23

6 Intuitively, What is the Lambda Calculus? It is a formal language to reason about functions, the terms of which sometimes look halfway between a computer program and a mathematical formula. For example, λy.(y +3) and λy.(y y) 5 / 23

7 Intuitively, What is the Lambda Calculus? It is a formal language to reason about functions, the terms of which sometimes look halfway between a computer program and a mathematical formula. For example, λy.(y +3) and λy.(y y) represent the add 3 function and the squaring function respectively. Compare with: φ(y) = y +3 and φ(y) = y y 5 / 23

8 Functions The key fact is that a function becomes an object which can be passed as a parameter just like a number can. Here is a function which returns a function as output: λx.(ifx > 0then(λy.(y +3))else(λy.(y y))) 6 / 23

9 Function Application To use a function we apply it to an argument, e.g. (λy.(y +3)) }{{} the function the argument {}}{ 10 = 13 Compare with φ(y) = y +3 φ(10) = 13 7 / 23

10 Function Application To use a function we apply it to an argument, e.g. (λy.(y +3)) }{{} the function the argument {}}{ 10 = 13 Compare with φ(y) = y +3 φ(10) = 13 A more complicated example: ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 = (λy.(y y))3 = 9 Perhaps you can already see how the λ-calculus helps bridge the gap between mathematics and computer programs 7 / 23

11 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! 8 / 23

12 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 8 / 23

13 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 8 / 23

14 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 (if 2 > 0then(λy.(y +3))else(λy.(y y)))3 8 / 23

15 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 (if 2 > 0then(λy.(y +3))else(λy.(y y)))3 (λy.(y y))3 8 / 23

16 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 (if 2 > 0then(λy.(y +3))else(λy.(y y)))3 (λy.(y y))3 8 / 23

17 Equality What do we mean by = in the previous examples? We mean equality modulo computation/reduction! ((λx.(ifx > 0then(λy.(y +3))else(λy.(y y))))( 2))3 (if 2 > 0then(λy.(y +3))else(λy.(y y)))3 (λy.(y y)) / 23

18 Currying What about functions with many arguments? 9 / 23

19 Currying What about functions with many arguments? For example, can be represented as φ(x,y) = x+y λx.(λy.(x+y)) so (λx.(λy.(x+y))2)5 (λy.(2+y))5 7 9 / 23

20 Currying What about functions with many arguments? For example, can be represented as φ(x,y) = x+y λx.(λy.(x+y)) so (λx.(λy.(x+y))2)5 (λy.(2+y))5 7 We usually write λx.(λy.s) as λxy.s. This technique, which allows us to get by with functions with only one argument, is due to Schönfinkel (1924). (But named after H. B. Curry) 9 / 23

21 Some examples λx.x it takes an input and returns that as the output in other words it is the identity function. 10 / 23

22 Some examples λx.x it takes an input and returns that as the output in other words it is the identity function. λx.xx it takes an input and applies it to itself (?!) 10 / 23

23 Some examples λx.x it takes an input and returns that as the output in other words it is the identity function. λx.xx it takes an input and applies it to itself (?!) λx.(λy.x) it takes an inputxand returns the constant function which takes an input, ignores it, and always returns x. 10 / 23

24 Some examples λx.x it takes an input and returns that as the output in other words it is the identity function. λx.xx it takes an input and applies it to itself (?!) λx.(λy.x) it takes an inputxand returns the constant function which takes an input, ignores it, and always returns x. We usually write the latter functionλxy.x. We can now see that it is just the curried version of a projection function. 10 / 23

25 Terms of the Untyped λ-calculus Let s start! 11 / 23

26 Terms of the Untyped λ-calculus Let us assume a countably infinite setv of variable identifiers. Terms will be finite strings made up of variable identifiers and the symbols: λ ( ). Definition. The set of termsλof the untypedλ-calculus is defined inductively by the rules: (var) x Λ x V (app) s Λ t Λ (st) Λ (abs) s Λ (λx.s) Λ x V 11 / 23

27 Terms of the Untyped λ-calculus Let us assume a countably infinite setv of variable identifiers. Terms will be finite strings made up of variable identifiers and the symbols: λ ( ). Definition. The set of termsλof the untypedλ-calculus is defined inductively by the rules: (var) x Λ x V (app) s Λ t Λ (st) Λ (abs) s Λ (λx.s) Λ x V E.g. (λx.x) (xy) ((xy)z) (x(yz)) ((λx.x)(λy.(zz))) (x(λy.(((λz.z)x)y))) / 23

28 Omitting parentheses 1. Outermost parentheses can be omitted: st means (st) 2. A sequence of applications associates to the left: xyz means ((xy)z) 12 / 23

29 Omitting parentheses 1. Outermost parentheses can be omitted: st means (st) 2. A sequence of applications associates to the left: xyz means ((xy)z) 3. Nested abstractions associate to the right and can be gathered under a singleλ. The body of an abstraction is as much as possible of the rest of the term (unless otherwise bracketed). E.g. λxy.yx means (λx.(λy.(yx))) 12 / 23

30 Omitting parentheses 1. Outermost parentheses can be omitted: st means (st) 2. A sequence of applications associates to the left: xyz means ((xy)z) 3. Nested abstractions associate to the right and can be gathered under a singleλ. The body of an abstraction is as much as possible of the rest of the term (unless otherwise bracketed). E.g. λxy.yx means (λx.(λy.(yx))) Examples: ((((xy)z)t)u) can be written xyztu but(x(y(z(tu)))) has to be written x(y(z(tu))) 12 / 23

31 Omitting parentheses 1. Outermost parentheses can be omitted: st means (st) 2. A sequence of applications associates to the left: xyz means ((xy)z) 3. Nested abstractions associate to the right and can be gathered under a singleλ. The body of an abstraction is as much as possible of the rest of the term (unless otherwise bracketed). E.g. λxy.yx means (λx.(λy.(yx))) Examples: ((((xy)z)t)u) can be written xyztu but(x(y(z(tu)))) has to be written x(y(z(tu))) (λx.(λy.(λz.(x(yz))))) is written λxyz.x(yz) (λx.(λy.(λz.((xy)z)))) is written λxyz.xyz 12 / 23

32 Free Variables Each termshas a set of free variables, FV(s), defined by: FV(x) = {x} FV(st) = FV(s) FV(t) FV(λx.s) = FV(s)\{x} E.g: FV(x(λy.(λz.z)xy)) = {x} 13 / 23

33 Free Variables Each termshas a set of free variables, FV(s), defined by: FV(x) = {x} FV(st) = FV(s) FV(t) FV(λx.s) = FV(s)\{x} E.g: FV(x(λy.(λz.z)xy)) = {x} A term with no free variables is called closed. The set of closed terms is denotedλ 0. Closed terms are sometimes called combinators. Some standard combinators: i := λx.x,k := λxy.x,ω := (λx.xx)(λx.xx). Variables appearing insunder aλare called bound. (λ is a binder) 13 / 23

34 Alpha Conversion Definition. Two termssandtare said to beα-convertible, written s α t or justs t, if: one can derive the same term from both purely by renaming bound variables to fresh variables. Examples: λx.x λy.y, x(λx.x) x(λy.y), / 23

35 Alpha Conversion Definition. Two termssandtare said to beα-convertible, written s α t or justs t, if: one can derive the same term from both purely by renaming bound variables to fresh variables. Examples: λx.x λy.y, x(λx.x) x(λy.y),... We consider terms which are α-convertible to be identical at the syntactic level to us they are the same term! We adopt the variable convention (aka the Barendregt convention): In any definition, theorem or proof in which only finitely or countably many terms appear, we silently α-convert them so that the bound variables of each term are not the same as the bound variables of any other term, or the free variables of any term. 14 / 23

36 Alpha Conversion formally Formally, we define variable swapping on terms recursively as follows. (y x) z y ifz x x ifz y z otherwise (y x) st ((y x) s)((y x) t) (y x) λz.s λ((y x) z).((y x) s) 15 / 23

37 Alpha Conversion formally Formally, we define variable swapping on terms recursively as follows. (y x) z y ifz x x ifz y z otherwise (y x) st ((y x) s)((y x) t) (y x) λz.s λ((y x) z).((y x) s) E.g.(y x) λxy.x(λz.yz) λyx.y(λz.xz) 15 / 23

38 Alpha Conversion formally Formally, we define variable swapping on terms recursively as follows. (y x) z y ifz x x ifz y z otherwise (y x) st ((y x) s)((y x) t) (y x) λz.s λ((y x) z).((y x) s) E.g.(y x) λxy.x(λz.yz) λyx.y(λz.xz) Then, α is the relation on terms defined by: x α x s α s t α t st α s t (y x) s α (y x ) s λx.s α λx.s y / FV(ss ) 15 / 23

39 Substitution What happens when (λx.s)t? 16 / 23

40 Substitution The effect of applying a function to an argument is defined by the scheme: (λx.s)t s[t/x] for any termssandtand variablex, where s[t/x] means inssubstitutet for every free occurrence of the variable x. 16 / 23

41 Substitution The effect of applying a function to an argument is defined by the scheme: (λx.s)t s[t/x] for any termssandtand variablex, where s[t/x] means inssubstitutet for every free occurrence of the variable x. Formally: y[t/x] { y ifx y t ifx y (su)[t/x] (s[t/x])(u[t/x]) (λy.s)[t/x] λy.(s[t/x]) assumingy x andy FV(t) 16 / 23

42 Substitution The effect of applying a function to an argument is defined by the scheme: (λx.s)t s[t/x] for any termssandtand variablex, where s[t/x] means inssubstitutet for every free occurrence of the variable x. Formally: y[t/x] { y ifx y t ifx y (su)[t/x] (s[t/x])(u[t/x]) We can assume that y x and y / FV(t) because of the variable convention. This kind of substitution is usually termed as capture-avoiding. (λy.s)[t/x] λy.(s[t/x]) assumingy x andy FV(t) 16 / 23

43 Substitution The effect of applying a function to an argument is defined by the scheme: (λx.s)t s[t/x] for any termssandtand variablex, where s[t/x] means inssubstitutet for every free occurrence of the variable x. Formally: y[t/x] { y ifx y t ifx y (su)[t/x] (s[t/x])(u[t/x]) We can assume that y x and y / FV(t) because of the variable convention. This kind of substitution is usually termed as capture-avoiding. (λy.s)[t/x] λy.(s[t/x]) assumingy x andy FV(t) For example: x[λxy.y/x] λxy.y, (λx.y)[λyz.z/y] λxyz.z, (λx.x)[λxy.y/x] (λz.z)[λxy.y/x] λz.z λx.x, / 23

44 Notions of Reduction A notion of reduction overλ, also called a redex rule, is just a binary relation onλ, i.e. a subset ofλ Λ. From a notion of reductionrwe can derive the relations onλ Λ: The one-stepr-reduction is the relation R defined by: s R t s,t R s R t su R tu s R t us R ut s R t λx.s R λx.t We read s R t as sr-reduces totin one step 17 / 23

45 Notions of Reduction A notion of reduction overλ, also called a redex rule, is just a binary relation onλ, i.e. a subset ofλ Λ. From a notion of reductionrwe can derive the relations onλ Λ: The one-stepr-reduction is the relation R defined by: s R t s,t R s R t su R tu s R t us R ut s R t λx.s R λx.t We read s R t as sr-reduces totin one step = R is the reflexive closure of R + R is the transitive closure of R R is the reflexive, transitive closure of R Reads R t as sr-reduces tot = R is the reflexive, symmetric, transitive closure of R Reads = R t as sr-converts tot (or s isr-convertible tot ) 17 / 23

46 Notions of Reduction (rules) (R) s = R t s,t R s + R t s,t R s R t s,t R s = R t s,t R (l-app) s = R t su = R tu + s R t su + R tu s R t su R tu s = R t su = R tu (r-app) s = R t us = R ut + s R t us + R ut s R t us R ut s = R t us = R ut (abs) s = R t λx.s = R λx.t + s R t λx.s + R λx.t s R t λx.s R λx.t s = R t λx.s = R λx.t (refl) s = R s s R s s = R s (trans) s + R u u + R t s + R t s R u u R t s R t s = R u u = R t s = R t (sym) t = R s s = R t 18 / 23

47 Alternative characterisations Lemma. LetRbe a notion of reduction overλand lets,t be terms. s + R t if and only if for somen 1 and termss 0,s 1,...,s n, s s 0 R s 1 R R s n t 19 / 23

48 Alternative characterisations Lemma. LetRbe a notion of reduction overλand lets,t be terms. s + R t if and only if for somen 1 and termss 0,s 1,...,s n, s s 0 R s 1 R R s n t s R t if and only if for somen 0 and termss 0,s 1,...,s n, s s 0 R s 1 R R s n t 19 / 23

49 Alternative characterisations Lemma. LetRbe a notion of reduction overλand lets,t be terms. s + R t if and only if for somen 1 and termss 0,s 1,...,s n, s s 0 R s 1 R R s n t s R t if and only if for somen 0 and termss 0,s 1,...,s n, s s 0 R s 1 R R s n t s = R t if and only if for somen 0 ands 0,s 1,...,s n,t 0,t 1,...,t n, R t 0 t 1 R R... t n 1 R s s 0 s 1... s n t n t R 19 / 23

50 Beta-reduction The notion of reductionβ is the relation: β = { redex contractum {}}{{}}{ (λx.s)t, s[t/x] s,t Λ} E.g. one-step β-reduction is explicitly given by: (λx.s)t β s[t/x] s β t su β tu s β t us β ut s β t λx.s β λx.t 20 / 23

51 Beta-reduction The notion of reductionβ is the relation: β = { redex contractum {}}{{}}{ (λx.s)t, s[t/x] s,t Λ} E.g. one-step β-reduction is explicitly given by: (λx.s)t β s[t/x] s β t su β tu s β t us β ut s β t λx.s β λx.t For example: (λx.x)(λyz.z) β λyz.z λx.x((λy.y)x) β λx.xx (λx.xx)((λx.xx)y) β yy(yy) reduction paths? (λz.zz)((λx.x)y) β yy β (λz.z)((λx.xx)y) so (λz.zz)((λx.x)y) = β (λz.z)((λx.xx)y) 20 / 23

52 Beta-reduction The notion of reductionβ is the relation: β = { redex contractum {}}{{}}{ (λx.s)t, s[t/x] s,t Λ} E.g. one-step β-reduction is explicitly given by: (λx.s)t β s[t/x] s β t su β tu s β t us β ut s β t λx.s β λx.t For example: (λx.x)(λyz.z) β λyz.z λx.x((λy.y)x) β λx.xx (λx.xx)((λx.xx)y) β yy(yy) reduction paths? (λz.zz)((λx.x)y) β yy β (λz.z)((λx.xx)y) so (λz.zz)((λx.x)y) = β (λz.z)((λx.xx)y) recall Ω := (λx.xx)(λx.xx), thus Ω β Ω β Ω β Ω β 20 / 23

53 Fixed Point Combinators Definition. For termsf andu,uis said to be a fixed point off if fu = β u. Theorem (First Recursion Theorem). Letf be a term. Then there is a termuwhich is a fixed point off. In fact,ucan be computed within the λ-calculus itself. 21 / 23

54 Fixed Point Combinators Definition. For termsf andu,uis said to be a fixed point off if fu = β u. Theorem (First Recursion Theorem). Letf be a term. Then there is a termuwhich is a fixed point off. In fact,ucan be computed within the λ-calculus itself. Proof. A fixed point combinator is a closed termssuch that for all terms u: u(su) = β su In other words,su is a fixed point ofu, for everyu. 21 / 23

55 Fixed Point Combinators Definition. For termsf andu,uis said to be a fixed point off if fu = β u. Theorem (First Recursion Theorem). Letf be a term. Then there is a termuwhich is a fixed point off. In fact,ucan be computed within the λ-calculus itself. Proof. A fixed point combinator is a closed termssuch that for all terms u: u(su) = β su In other words,su is a fixed point ofu, for everyu. Two well-known FPC s are: y := λf.(λx.f(xx))(λx.f(xx)) θ := (λxy.y(xxy))(λxy.y(xxy)) due to Curry and Turing respectively. 21 / 23

56 Recursion Fixed point combinators allow us to encode recursion within the lambda calculus: yg β g((λx.g(xx))λx.g(xx)) β g(yg) so yg = β g(yg) θg β g(θg) Let us define (assuming we have specified notation for booleans and arithmetic): fact := y(λf.(λx.ifx = 0then1elsex f(x 1))) 22 / 23

57 Recursion Fixed point combinators allow us to encode recursion within the lambda calculus: yg β g((λx.g(xx))λx.g(xx)) β g(yg) so yg = β g(yg) θg β g(θg) Let us define (assuming we have specified notation for booleans and arithmetic): fact := y(λf.(λx.ifx = 0then1elsex f(x 1))) Then, fact satisfies the property: fact = β λx.ifx = 0then1elsex fact(x 1) 22 / 23

58 Recursion Fixed point combinators allow us to encode recursion within the lambda calculus: yg β g((λx.g(xx))λx.g(xx)) β g(yg) so yg = β g(yg) θg β g(θg) Let us define (assuming we have specified notation for booleans and arithmetic): fact := y(λf.(λx.ifx = 0then1elsex f(x 1))) Then, fact satisfies the property: fact = β λx.ifx = 0then1elsex fact(x 1) In particular: factx = β ifx = 0then1elsex fact(x 1) 22 / 23

59 Exercises 1. List all the free variables in: (a) (b) (c) (d) (e) λxy.(λu.uvxy)z λxy.z(λu.uvxy) λwx.z(λu.uvwx) λvw.z(λz.uvvw) λyx.z(λu.uwyx) Which of these five terms are identified byα-conversion (i.e. which are actually the same as each other)? 2. Perform the following substitutions: (a) (b) (c) (λx.yx)[yz/x] (λy.xy)[yx/x] (λz.(λx.yx)xz)[zx/x] 3. Show that, for any variable x distinct from y, any terms s and t, and term u not containing x as a free variable, s[t/x][u/y] s[u/y][t[u/y]/x]. You will need to use induction on the structure of the term s. 5 Letmgs be the combinatormgs := TT T, wheret is: }{{} 26 λabc... xyz.z(midlands graduate school rulez) Prove that mgs is a fixed point combinator. 6 Construct: (a) (b) for each closed terms, a closed termt 1 such thatt 1 = β t 1 s. for each closed term s, a closed term t 2 such that t 2 (λx.x)ss = β t 2 s. [Hint: try to render these equations to some formu = β (...)u and then use the First Recursion Theorem.] 7 Show that there is no term f such that for all terms s and t, f(st) = β s. [Hint: Use the First Recursion Theorem. You may assume that= β is consistent, that is, there exist termss,t such thats β t.] 8 Show that every fixed point combinator can be characterised as a fixed point of a termg. FindG. 4. (a) (b) Find a term s such that, for all terms t and u, stu = β ut. Show that exists a termssuch that, for all termst,st = β ss. [Hint: do not use the First Recursion Theorem. Use common sense. What does s do with its argument(s) in each case?] 23 / 23

Lambda Calculus and Types

Lambda 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 information

Models of computation

Models 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 information

Categories, Proofs and Programs

Categories, 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 information

Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal Methods Tsinghua University, August 23, 2010

Lambda-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

COMP6463: λ-calculus

COMP6463: λ-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 information

Traditional and Non Traditional lambda calculi

Traditional and Non Traditional lambda calculi Strategies July 2009 Strategies Syntax Semantics Manipulating Expressions Variables and substitutions Free and bound variables Subterms and substitution Grafting and substitution Ordered list of variables

More information

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus

CS 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 information

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.

Type 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 information

Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT

Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT Lambda Calculus Andrés Sicard-Ramírez Universidad EAFIT Semester 2010-2 Bibliography Textbook: Hindley, J. R. and Seldin, J. (2008). Lambda-Calculus and Combinators. An Introduction. Cambridge University

More information

Models of Computation,

Models 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 information

Lecture 2. Lambda calculus. Iztok Savnik, FAMNIT. March, 2018.

Lecture 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 information

λ Slide 1 Content Exercises from last time λ-calculus COMP 4161 NICTA Advanced Course Advanced Topics in Software Verification

λ 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 information

Simply Typed λ-calculus

Simply 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 information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

What is a Categorical Model of the Differential and the Resource λ-calculi?

What is a Categorical Model of the Differential and the Resource λ-calculi? What is a Categorical Model of the Differential and the Resource λ-calculi? Giulio Manzonetto a a Department of Computer Science, Radboud University, Nijmegen, The Netherlands Email: G.Manzonetto@cs.ru.nl

More information

Formal Methods Lecture 6. (B. Pierce's slides for the book Types and Programming Languages )

Formal Methods Lecture 6. (B. Pierce's slides for the book Types and Programming Languages ) Formal Methods Lecture 6 (B. Pierce's slides for the book Types and Programming Languages ) Programming in the Lambda-Calculus, Continued Testing booleans Recall: tru = λt. λf. t fls = λt. λf. f We showed

More information

Lecture 3. Lambda calculus. Iztok Savnik, FAMNIT. October, 2015.

Lecture 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 information

Formal Methods Lecture 6. (B. Pierce's slides for the book Types and Programming Languages )

Formal Methods Lecture 6. (B. Pierce's slides for the book Types and Programming Languages ) Formal Methods Lecture 6 (B. Pierce's slides for the book Types and Programming Languages ) This Saturday, 10 November 2018, room 335 (FSEGA), we will recover the following activities: 1 Formal Methods

More information

Introduction to lambda calculus Part 2

Introduction 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 information

The Lambda Calculus. Stephen A. Edwards. Fall Columbia University

The 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 information

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms

Alonzo 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 information

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Type 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 information

FORMAL SYSTEMS: COMBINATORY LOGIC

FORMAL 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 information

Origin in Mathematical Logic

Origin 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 information

Equivalent Computers. Lecture 39: Lambda Calculus. Lambda Calculus. What is Calculus? Real Definition. Why?

Equivalent 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 information

The Lambda-Calculus Reduction System

The 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 information

3.2 Equivalence, Evaluation and Reduction Strategies

3.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 information

Typing λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus

Typing λ-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 information

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012

Henk 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 information

Lazy Strong Normalization

Lazy 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 information

Computation Theory, L 9 116/171

Computation Theory, L 9 116/171 Definition. A partial function f is partial recursive ( f PR) ifitcanbebuiltupinfinitelymanysteps from the basic functions by use of the operations of composition, primitive recursion and minimization.

More information

Typed Arithmetic Expressions

Typed 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 information

Introduction to λ-calculus

Introduction 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 information

1. Object Calculus. Object calculus is to OO languages what lambda calculus is to functional languages

1. 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 information

Origin in Mathematical Logic

Origin 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 information

Charles Wells 1. February 25, 1999

Charles 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 information

Advanced 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 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 information

Lambda calculus L9 103

Lambda calculus L9 103 Lambda calculus L9 103 Notions of computability L9 104 Church (1936): λ-calculus Turing (1936): Turing machines. Turing showed that the two very different approaches determine the same class of computable

More information

ITP Programming Languages Lambda Calculus Lesson 0 Functional Programming and Lambda Calculus Lesson 1 Introduction to the Lambda Calculus

ITP Programming Languages Lambda Calculus Lesson 0 Functional Programming and Lambda Calculus Lesson 1 Introduction to the Lambda Calculus ITP 20005 Programming Languages Lambda Calculus Lesson 0 Functional Programming and Lambda Calculus Lesson 1 Introduction to the Lambda Calculus Lesson 2 Boolean Logic in the Lambda Calculus Lesson 3 Function

More information

Type Systems Winter Semester 2006

Type Systems Winter Semester 2006 Type Systems Winter Semester 2006 Week 7 November 29 November 29, 2006 - version 1.0 Plan PREVIOUSLY: 1. type safety as progress and preservation 2. typed arithmetic expressions 3. simply typed lambda

More information

summer school Logic and Computation Goettingen, July 24-30, 2016

summer 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 information

Lambda-Calculus (cont): Fixpoints, Naming. Lecture 10 CS 565 2/10/08

Lambda-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 information

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.

3.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 information

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007

Review. 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 information

Sub-λ-calculi, Classified

Sub-λ-calculi, Classified Electronic Notes in Theoretical Computer Science 203 (2008) 123 133 www.elsevier.com/locate/entcs Sub-λ-calculi, Classified François-Régis Sinot Universidade do Porto (DCC & LIACC) Rua do Campo Alegre

More information

The Greek Alphabet. (a) The Untyped λ-calculus

The Greek Alphabet. (a) The Untyped λ-calculus 3. The λ-calculus and Implication Greek Letters (a) The untyped λ-calculus. (b) The typed λ-calculus. (c) The λ-calculus in Agda. (d) Logic with Implication (e) Implicational Logic in Agda. (f) More on

More information

Type Systems Winter Semester 2006

Type Systems Winter Semester 2006 Type Systems Winter Semester 2006 Week 5 November 15 November 15, 2006 - version 1.0 Programming in the Lambda-Calculus, Continued Testing booleans Recall: tru = λt. λf. t fls = λt. λf. f We showed last

More information

Classical Combinatory Logic

Classical 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 information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D Guttman Worcester Polytechnic Institute September 16, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

CSCI 490 problem set 6

CSCI 490 problem set 6 CSCI 490 problem set 6 Due Tuesday, March 1 Revision 1: compiled Tuesday 23 rd February, 2016 at 21:21 Rubric For full credit, your solutions should demonstrate a proficient understanding of the following

More information

Command = Value Context. Hans-Dieter Hiep. 15th of June, /17

Command = Value Context. Hans-Dieter Hiep. 15th of June, /17 1/17 Command = Value Context Hans-Dieter Hiep 15th of June, 2018 2/17 Example Consider a total functional programming language. swap :: A B B A swap (a, b) = (b, a) paws :: A B B A paws a = a paws b =

More information

About Typed Algebraic Lambda-calculi

About Typed Algebraic Lambda-calculi About Typed Algebraic Lambda-calculi Benoît Valiron INRIA Saclay/LIX Palaiseau, France valiron@lix.polytechnique.fr Abstract Arrighi and Dowek (2008) introduce an untyped lambdacalculus together with a

More information

Rewriting, Explicit Substitutions and Normalisation

Rewriting, 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 information

Formal Techniques for Software Engineering: Denotational Semantics

Formal Techniques for Software Engineering: Denotational Semantics Formal Techniques for Software Engineering: Denotational Semantics Rocco De Nicola IMT Institute for Advanced Studies, Lucca rocco.denicola@imtlucca.it May 2013 Lesson 4 R. De Nicola (IMT-Lucca) FoTSE@LMU

More information

Programming Language Concepts: Lecture 18

Programming 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 information

Komponenten- und Service-orientierte Softwarekonstruktion

Komponenten- 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 information

An Introduction to the Lambda Calculus

An 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 information

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Theory of Computation

Theory of Computation Thomas Zeugmann Hokkaido University Laboratory for Algorithmics http://www-alg.ist.hokudai.ac.jp/ thomas/toc/ Lecture 1: Introducing Formal Languages Motivation I This course is about the study of a fascinating

More information

Functional Programming with Coq. Yuxin Deng East China Normal University

Functional 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 information

Programming Languages

Programming 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 information

On the Standardization Theorem for λβη-calculus

On the Standardization Theorem for λβη-calculus On the Standardization Theorem for λβη-calculus Ryo Kashima Department of Mathematical and Computing Sciences Tokyo Institute of Technology Ookayama, Meguro, Tokyo 152-8552, Japan. e-mail: kashima@is.titech.ac.jp

More information

λ-calculus and types

λ-calculus and types λ-calculus and types Lecture notes Midland Graduate School / APPSEM Spring School 2004 Thorsten Altenkirch School of Computer Science and Information Technology, Nottingham University txa@cs.nott.ac.uk

More information

Solutions to Exercises. Solution to Exercise 2.4. Solution to Exercise 2.5. D. Sabel and M. Schmidt-Schauß 1

Solutions to Exercises. Solution to Exercise 2.4. Solution to Exercise 2.5. D. Sabel and M. Schmidt-Schauß 1 D. Sabel and M. Schmidt-Schauß 1 A Solutions to Exercises Solution to Exercise 2.4 We calculate the sets of free and bound variables: FV ((λy.(y x)) (λx.(x y)) (λz.(z x y))) = FV ((λy.(y x)) (λx.(x y)))

More information

Introduction to Computational Logic

Introduction to Computational Logic Introduction to Computational Logic Lecture Notes SS 2008 July 14, 2008 GertSmolkaandChadE.Brown Department of Computer Science Saarland University Copyright 2008 by Gert Smolka, All Rights Reserved Contents

More information

l-calculus and Decidability

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 information

The λ-calculus and Curry s Paradox Drew McDermott , revised

The λ-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 information

TYPED LAMBDA CALCULI. Andrzej S. Murawski University of λeicester.

TYPED 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 information

3. The λ-calculus and Implication

3. The λ-calculus and Implication 3. The λ-calculus and Implication (a) (b) (c) (d) (e) (f) The untyped λ-calculus. The typed λ-calculus. The λ-calculus in Agda. Logic with Implication Implicational Logic in Agda. More on the typed λ-calculus.

More information

The lambda calculus with constructors

The lambda calculus with constructors The lambda calculus with constructors Categorical semantic and Continuations Barbara Petit Focus - Univ. Bologna CaCos 2012 Barbara Petit (Focus - Univ. Bologna) The lambda calculus with constructors 1

More information

Kleene realizability and negative translations

Kleene realizability and negative translations Q E I U G I C Kleene realizability and negative translations Alexandre Miquel O P. D E. L Ō A U D E L A R April 21th, IMERL Plan 1 Kleene realizability 2 Gödel-Gentzen negative translation 3 Lafont-Reus-Streicher

More information

How to Think of Intersection Types as Cartesian Products

How to Think of Intersection Types as Cartesian Products Available online at www.sciencedirect.com Electronic Notes in Theoretical Computer Science 325 (2016) 305 312 www.elsevier.com/locate/entcs How to Think of Intersection Types as Cartesian Products Rick

More information

Lecture 9: The Recursion Theorem. Michael Beeson

Lecture 9: The Recursion Theorem. Michael Beeson Lecture 9: The Recursion Theorem Michael Beeson The problem of computing by recursion We still have not provided completely convincing evidence that every intuitively computable function is Turing computable,

More information

Silvia Ghilezan and Jelena Ivetić

Silvia Ghilezan and Jelena Ivetić PUBLICATIONS DE L INSTITUT MATHÉMATIQUE Nouvelle série, tome 82(96) (2007), 85 91 DOI 102298/PIM0796085G INTERSECTION TYPES FOR λ Gtz -CALCULUS Silvia Ghilezan and Jelena Ivetić Abstract. We introduce

More information

A Lambda Calculus for Quantum Computation

A Lambda Calculus for Quantum Computation arxiv:quant-ph/0307150v5 3 Apr 004 A Lambda Calculus for Quantum Computation André van Tonder Department of Physics, Brown University Box 1843, Providence, RI 0906 andre@het.brown.edu July 15, 003 Revised

More information

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

NICTA 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 information

SHARING IN THE WEAK LAMBDA-CALCULUS REVISITED

SHARING 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 information

hal , version 1-21 Oct 2009

hal , version 1-21 Oct 2009 ON SKOLEMISING ZERMELO S SET THEORY ALEXANDRE MIQUEL Abstract. We give a Skolemised presentation of Zermelo s set theory (with notations for comprehension, powerset, etc.) and show that this presentation

More information

Intersection Types and Lambda Theories

Intersection Types and Lambda Theories Intersection Types and Lambda Theories M.Dezani-Ciancaglini S.Lusin Abstract We illustrate the use of intersection types as a semantic tool for showing properties of the lattice of λ-theories. Relying

More information

Mathematical Logic IV

Mathematical 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 information

On the Correctness and Efficiency of the Krivine Machine

On the Correctness and Efficiency of the Krivine Machine On the Correctness and Efficiency of the Krivine Machine Mitchell Wand Northeastern University Daniel P. Friedman Indiana University February 12, 2003 Abstract We provide a short derivation of the Krivine

More information

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods Elsa L Gunter 2112 SC, UIUC egunter@illinois.edu http://courses.engr.illinois.edu/cs477 Slides based in part on previous lectures

More information

Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees

Intersection 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 information

A should be R-closed: R(A) A. We would like this to hold because we would like every element that the rules say should be in A to actually be in A.

A should be R-closed: R(A) A. We would like this to hold because we would like every element that the rules say should be in A to actually be in A. CS 6110 S18 Lecture 7 Inductive Definitions and Least Fixed Points 1 Set Operators Last time we considered a set of rule instances of the form X 1 X 2... X n, (1) X where X and the X i are members of some

More information

Axioms of Kleene Algebra

Axioms of Kleene Algebra Introduction to Kleene Algebra Lecture 2 CS786 Spring 2004 January 28, 2004 Axioms of Kleene Algebra In this lecture we give the formal definition of a Kleene algebra and derive some basic consequences.

More information

Consistency 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 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 information

Non-Idempotent Typing Operators, beyond the λ-calculus

Non-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 information

Typage et déduction dans le calcul de

Typage et déduction dans le calcul de Typage et déduction dans le calcul de réécriture Benjamin Wack Encadrants : C. Kirchner, L. Liquori Deduction and computation λ-calculus [Church 40] is a simple and powerful computational model Explicit

More information

Topology in Denotational Semantics

Topology in Denotational Semantics Journées Topologie et Informatique Thomas Ehrhard Preuves, Programmes et Systèmes (PPS) Université Paris Diderot - Paris 7 and CNRS March 21, 2013 What is denotational semantics? The usual stateful approach

More information

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg Type Inference For the Simply-Typed Lambda Calculus Albert-Ludwigs-Universität Freiburg Peter Thiemann, Manuel Geffken University of Freiburg 24. Januar 2013 Outline 1 Introduction 2 Applied Lambda Calculus

More information

The Call-by-Need Lambda Calculus

The Call-by-Need Lambda Calculus The Call-by-Need Lambda Calculus John Maraist, Martin Odersky School of Computer and Information Science, University of South Australia Warrendi Road, The Levels, Adelaide, South Australia 5095 fmaraist,oderskyg@cis.unisa.edu.au

More information

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC)

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC) University of Science and Technology of China (USTC) 09/26/2011 Overview Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic?

More information

Advanced Lambda Calculus Lecture 5

Advanced 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 information

Introduction to Type Theory

Introduction to Type Theory Introduction to Type Theory Herman Geuvers Radboud University Nijmegen & Technical University Eindhoven, The Netherlands July 8, 2008 1 Overview These notes comprise the lecture Introduction to Type Theory

More information

The Curry-Howard Isomorphism

The Curry-Howard Isomorphism The Curry-Howard Isomorphism Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) The Curry-Howard Isomorphism MFES 2008/09

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-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 information

Principles of Programming Languages

Principles 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 information

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra.

Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. V. Borschev and B. Partee, October 26, 2006 p. 1 Lecture 12. Statement Logic as a word algebra on the set of atomic statements. Lindenbaum algebra. 0. Preliminary notes...1 1. Freedom for algebras. Word

More information

CS522 - Programming Language Semantics

CS522 - 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 information