Models of computation
|
|
- Octavia Cannon
- 5 years ago
- Views:
Transcription
1 Lambda-Calculus (I) 2nd Asian-Pacific Summer School on Formal ethods Tsinghua University, August 23, 2010 Plan computation models lambda-notation bound variables odels of computation Computation models [machines] automata theory -- Turing machines [character strings] formal grammars, Thue systems, Post conversion rules [numbers] Kleene recursive functions theory reductions [terms] Church lambda-calculus, term rewriting systems normal forms numeral systems lambda-definability Applications to logic [cut elimination] 2nd order arithmetic -- Howard, Girard Barendregt, Henk, The Lambda Calculus. Its Syntax and Semantics, Elsevier, 2nd edition, Barendregt, Henk; Dezani, ariangiola, Lambda calculi with Types, [higher order dependent types] HOL, Isabelle, Coq -- Coquand, Huet
2 Computing with terms Computing with terms (2 + 3) ((2 + 3) + 4) (4 + 5)... (λf.λx.f (f x))(λx.x + 2)3... Computing with terms Computation model (λx. x + 1) (λx.2 x + 2) (λf.f 3)(λx. x + 2) (λx. x + 2) (λf.λx.f (f x))(λx.x + 2)... define a minimum set no instructions, no states, only expressions no arithmetic just a calculus of functions functions applied to functions functions as results interesting?
3 Abbreviations λ-calculus 1 2 n for ( ((1 )2 ) n ) (λx1 x2 xn. ) for (λx1.(λx2. (λxn. ) )) external parentheses and parentheses after a dot may be forgotten Exercice 1 Write following terms in long notation: λx.x, λx.λy.x, λxy.x, λxyz.y, λxyz.zxy, λxyz.z(xy ), (λx.λy.x), (λxy.x), (λxy.y ), (λxy.y )() The lambda-calculus (λx.x) Lambda terms,, P ::= x, y, z,... (variables) ( λx. ) ( as function of x) ( ) ( applied to ) c, d,... (constants ) Calculations reductions ((λx.)) {x := } Examples (λf.f )(λx.x) (λx.x) (λx.xx)(λx.x) (λx.x)(λx.x) (λx.xx)(λx.xx) (λx.xx)(λx.xx) Yf = (λx.f (xx))(λx.f (xx)) f (Yf ) f (f (Yf )) (λx.x) f ((λx.f (xx))(λx.f (xx))) = f (Yf ) f n (Yf )
4 Recapitulation Abstract syntax calculus is more complex than expected Example: (λx.(λy.λx.y x)(λz.z x))x y looping expressions!! is recursion operator seems definable when termination? y consistency?!x x computing power?!y!z!x Abstract syntax Bound variables The syntax of lambda-terms can be abstracted as:,, P ::= x, y, z,... (variables) x (λx.(λy.λx.y x)(λz.z x))x y (rightmost x, y are free) ( λx. ) ( as function of x)!x Exercice 2 Show binders of bound variables in (λf.(λx.f (xx))(λx.f (xx)))(λx.λy.x) ( ) ( applied to ) (λf.(λx.f (xx))(λx.f (xx)))(λf xy.x(f y)) (λf.f ((λx.x)3))(λx.λy.x) c, d,... (constants ) c
5 Bound variables Bound variables (λy.λx.y)x λx.x incorrect (dynamic binding: Lisp) (λy.λx.y)x λx.x correct (lexical binding: Scheme) de Bruijn indices is a systematic computer representation of bound variables for each occurence of a bound variable, one counts the number of binders to traverse to reach its binder. Example: is (λx.(λy.λx.y x)(λz.z x))x y (λ.(λ.λ.1 0)(λ.0 1))x y!x x y!y!z!x Exercice 2bis Why Lisp is consistent? Bound variables Substitution (λy.λx.y)x λx.x (λy.λx.y)x = α (λy.λx.y)x λx.x renaming of bound variables names of bound variables are not important standard in many other calculi x{y := P} = x y{y := P} = P c{y := P} = c (){y := P} = {y := P} {y := P} (λy.){y := P} = λy. (λx.){y := P} = λx.{x := x }{y := P} where x = x if y not free in or x not free in P, otherwise x is the first variable not free in and P. (we suppose that the set of variables is infinite and enumerable) π/2 0 cos(x)dx = π/2 0 cos(x )dx λx.x +2 = α λy.y +2 9 i=1 a i = 9 j=1 a j λxy.x + y = α λyx.y + x Free variables var(x) ={x} var(c) = var() = var() var() var(λx.) = var() {x}
6 Conversion rules Lambda theories λx. α λx.{x := x } (x var()) (λx.) β {x := } λx.x η (x var()) = β when and are related by a zigzag of reductions and are said interconvertible left-hand-side of conversion rule is a redex (reductible expression) "-redex, #-redex, $-redex,... we forget indices when clear from context, often # Reduction step let R be a redex in. Then one can contrat redex R in and get : R Also = α, = η, = β,η,... Interconvertibility is symmetric, reflexive, transivite closure of reduction relation or with notations of mathematical logic: α =, β =, η =, β + η =,... the syntactic equality = will often stand for = α. Reductions Exercice 3 when = n = (n 0) same with explicit contracted redexes = 0 R 1 1 R 2 2 and with named reductions ρ : = 0 R 1 1 R 2 2 R n R n n = n = we speak of redex occurences when specifying reduction steps, but it is convenient to confuse redexes and redex occurences when clear from context Find terms such that: = n = ( i all distinct) = β x = β λx. = β = β 1 2 n for all 1, 2,... n Find term Y such that, for any : Y = β (Y) Find Y such that, for any : Y (Y ) (difficult) Show there is only one redex R such that R R
7 ormal forms An expression without redexes is in normal form If reduces to a normal form, then has a normal form δ-rules, in normal form Exercice 4 which of following terms are in #-normal form? in #$-normal form? λx.x λx.x(λxy.x)(λx.x) λxy.x λxy.x(λxy.x)(λx.yx) λxy.xy λxy.x((λx.xx)(λx.xx))y λxy.x((λx.y (xx))(λx.y (xx))) Exercice 5 Adding!-rules: PCF Show that if is in normal form and, then = Terms of PCF Show that: 1- λx. 2- or,, P implies = λx. and P implies λx., 3- x1 2 n, and P = and {x := } implies 1 1, 2 P 2,... n n and x1 2 n = 4- {x := } or λy.p implies ::= x, y, z,... (variables) λx. ( function of x) ( applied to ) n ifz P then else (conditionnal) (integer constant) Conversion rules (λx.) λy. and {x := } x1 2 n and 1 {x := } n {x := } P λy.p (arithmetic operation, +, *, -, / ) m n {x := } m n ifz 0 then else ifz n+1 then else
8 Examples (bis) (2 + 3) ((2 + 3) + 4) (4 + 5)... Examples (bis) (λf.λx.f (f x))(λx.x + 2)3... Examples (bis) Examples (λx. x + 1) (λx.2 x + 2) (λf.f 3)(λx. x + 2) (λx. x + 2) (λf.λx.f (f x))(λx.x + 2)... Fact(3) Fact = Y (λf.λx. ifz x then 1 else x f (x 1)) Y = λf.(λx.f (xx))(λx.f (xx)) can be written as a single term in: (λ Fact. Fact(3)) ((λy.y (λf.λx. ifz x then 1 else x f (x 1))) (λf.(λx.f (xx))(λx.f (xx))) )
9
10
11
12 Computing without!-rules Booleans λ-definability True = λx.λy.x = K False = λx.λy.y True False π1, π2, Pairs and Projections, = λx.x π1 = λx.x True π2 = λx.x False on-negative integers... 0 = True, True n + 1 = False, n iszero = π1 Computing without!-rules Computing without!-rules... integers umbers will be in unary-code Succ = λx. False, x =0 S( ) Pred = λx. iszero x 0 π2 with following implementation: 0 = True,? 1 = False, 0 = False, True,? 2 = False, 1 = False, False, True,?... n = False, n 1 = False, False, True,? n iszero 0 True iszero(n + 1) False
13 Other numeral system also named Church s numerals Other numeral system... successor and predecessor or n = λf.λx.f (f ( f (x) )) n Succ = λn.λf.λx.nf (f x) Pred = λn. π3 3 (n φ 1, 1, 1) φ = λt.(λx.λy.λz.succ x, x, y)(π1 3 t)(π3 2 t)(π3 3 t) n = λf. f f f n where π 3 1, π3 2, π3 3 are the 3 projections on triples was n+1 in Church s original monograph φ shift register! FIFO Other numeral system Church numeral system Lambda-I calculus λx. ( depends upon x) K = λx.λy.x Church numerals n = λf.λx.f n (x) ni I n 1 I = λx.x no Pairs and projections, = λx.x π 1 = λp.p(λx.λy. yix) π 2 = λp.p(λx.λy. xiy π 1 m, n π 2 m, n m n Alonzo Church Stephen Kleene
14 Programming languages
15 Towards programming languages any!-rules Adding types never following terms : λx.x 4(5) ext class =??? 20(λx.x) λf.(λx.f (xx))(λx.f (xx)) ifz λx.x then 1 else 3 λx.xx Adding store and mutable values Functional programming ext class Scheme, SL, Ocaml, Haskell are functional programming languages they manipulate functions and try to reduce the number of memory states confluency F# Haskell SL Ocaml L Jocaml Ocaml Scheme Camllight Lisp Caml consistency
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 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 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 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 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 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 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 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 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 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 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 informationTraditional 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 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 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 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 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 informationLambda 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 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 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 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 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 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 λ-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 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 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 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 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 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 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 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 informationIntroduction to Turing Machines
Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability
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 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 informationThe Locally Nameless Representation
Noname manuscript No. (will be inserted by the editor) The Locally Nameless Representation Arthur Charguéraud Received: date / Accepted: date Abstract This paper provides an introduction to the locally
More informationOn 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 informationAbout 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 informationProgramming Languages and Types
Programming Languages and Types Klaus Ostermann based on slides by Benjamin C. Pierce Where we re going Type Systems... Type systems are one of the most fascinating and powerful aspects of programming
More informationOperational Semantics
Operational Semantics Semantics and applications to verification Xavier Rival École Normale Supérieure Xavier Rival Operational Semantics 1 / 50 Program of this first lecture Operational semantics Mathematical
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 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 informationDecidability: Church-Turing Thesis
Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there
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 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 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 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 informationBeyond 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 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 informationSharing in the weak lambda-calculus (2)
Sharing in the weak lambda-calculus (2) Jean-Jacques Lévy INRIA Joint work with Tomasz Blanc and Luc aranget Happy birthday Henk! Happy birthday Henk! Happy birthday Henk! History Sharing in the lambda-calculus
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 information3. 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 informationNormalization by Evaluation
Normalization by Evaluation Andreas Abel Department of Computer Science and Engineering Chalmers and Gothenburg University PhD Seminar in Mathematical Engineering EAFIT University, Medellin, Colombia 9
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 informationType 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 informationClassical Program Logics: Hoare Logic, Weakest Liberal Preconditions
Chapter 1 Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions 1.1 The IMP Language IMP is a programming language with an extensible syntax that was developed in the late 1960s. We will
More informationThe 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 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 informationl-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 informationCOMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 16 : Turing Machines
COMP-330 Theory of Computation Fall 2017 -- Prof. Claude Crépeau Lec. 16 : Turing Machines COMP 330 Fall 2017: Lectures Schedule 1-2. Introduction 1.5. Some basic mathematics 2-3. Deterministic finite
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 informationIntroduction 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 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 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 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 informationNon deterministic classical logic: the λµ ++ -calculus
Paru dans : Mathematical Logic Quarterly, 48, pp. 357-366, 2002 Non deterministic classical logic: the λµ ++ -calculus Karim NOUR LAMA - Equipe de Logique, Université de Savoie 73376 Le Bourget du Lac
More informationOn 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 informationThe Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. Lunch-time meeting, 14 May Oxford University Computing Laboratory
The Safe λ-calculus William Blum Joint work with C.-H. Luke Ong Oxford University Computing Laboratory Lunch-time meeting, 14 May 2007 Overview Safety is originally a syntactic restriction for higher-order
More informationDenotational semantics
Denotational semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 4 4 March 2016 Course 4 Denotational semantics Antoine Miné p.
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 informationλ-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 informationA 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 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 information(2) (15pts) Using Prolog, implement a type-checker for the following small subset of System F:
CS 6371 Advanced Programming Languages Sample Spring 2018 Final Exam This sample final exam is LONGER than a real final exam (to give you more practice problems) and has a medium difficulty level. You
More informationTHE UNIVERSITY OF CALGARY FACULTY OF SCIENCE FINAL EXAMINATION COMPUTER SCIENCE 521
P. 1 of 7 THE UNIVERSITY OF CALGARY FACULTY OF SCIENCE FINAL EXAMINATION COMPUTER SCIENCE 521 December, 2016 Time: 2 hrs. Instructions The exam contains questions totaling 100 points. Answer all questions.
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 informationFormal 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 informationforty-two XLII Equivalent Computers? Lecture 40: Computing with Glue and Photons What is 42? cuarenta y dos Meaning of Numbers Meaning of Numbers
), #, R #,, - ), #, R #,, - Lecture 40: Computing with Glue and Photons Equivalent Computers? z z z... term = variable term term (term) λ variable. term λy. M α λv. (M [y α v]) where v does not occur in
More informationFunctional Programming with F# Overview and Basic Concepts
Functional Programming with F# Overview and Basic Concepts Radu Nicolescu Department of Computer Science University of Auckland 27 Sep 2017 1 / 52 1 Background 2 Overview 3 Type System and Type Inference
More informationFormal 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 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 informationTypage 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 informationMinimal logic for computable functionals
Minimal logic for computable functionals Helmut Schwichtenberg Mathematisches Institut der Universität München Contents 1. Partial continuous functionals 2. Total and structure-total functionals 3. Terms;
More informationSafety Analysis versus Type Inference
Information and Computation, 118(1):128 141, 1995. Safety Analysis versus Type Inference Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus
More informationLocal Representations of Binding
Local Representations of Binding Randy Pollack LFCS, University of Edinburgh Joint work with James McKinna, Christian Urban, Arthur Charguéraud, Brian Aydemir, Benjamin Pierce, Stephanie Weirich Version
More informationThe Turing machine model of computation
The Turing machine model of computation For most of the remainder of the course we will study the Turing machine model of computation, named after Alan Turing (1912 1954) who proposed the model in 1936.
More informationComputation 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 informationIntroduction to Type Theory February 2008 Alpha Lernet Summer School Piriapolis, Uruguay. Herman Geuvers Nijmegen & Eindhoven, NL
Introduction to Type Theory February 2008 Alpha Lernet Summer School Piriapolis, Uruguay Herman Geuvers Nijmegen & Eindhoven, NL Lecture 5: Higher Order Logic and the Calculus of Constructions 1 Church
More informationThe 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 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 informationFormal Methods Lecture 8. (B. Pierce's slides for the book Types and Programming Languages )
Formal Methods Lecture 8 (B. Pierce's slides for the book Types and Programming Languages ) Erasure and Typability Erasure We can transform terms in λ to terms of the untyped lambda-calculus simply by
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 informationLocal computation of β-reduction A concrete presentation of Game Semantics
1 2 3 4 Local computation of β-reduction A concrete presentation of Game Semantics William Blum and C.H. Luke Ong Oxford University Computing Laboratory 5 6 Abstract We show that... Key words: Lambda calculus,
More informationIntroduction to lambda calculus Part 6
Introduction to lambda calculus Part 6 Antti-Juhani Kaijanaho 2017-02-16 1 Untyped lambda calculus 2 Typed lambda calculi 2.1 Dynamically typed lambda calculus with integers 2.2 A model of Lisp 2.3 Simply
More informationSimple Type Extensions
Simple Type Extensions Type Systems, Lecture 4 Jevgeni Kabanov Tartu, 14.02.2006 PREVIOUSLY ON TYPE SYSTEMS Lambda Calculus Embedded Booleans and Arithmetical expressions Fixpoints and Recursion Simple
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 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 informationCMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008
CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008 Contents 1 Polymorphism 1 2 Polymorphic λ-calculus: Syntax 1 3 Static Semantics 2 4 Dynamic Semantics
More informationCOMP-330 Theory of Computation. Fall Prof. Claude Crépeau. Lec. 14 : Turing Machines
COMP-330 Theory of Computation Fall 2012 -- Prof. Claude Crépeau Lec. 14 : Turing Machines 1 COMP 330 Fall 2012: Lectures Schedule 1. Introduction 1.5. Some basic mathematics 2. Deterministic finite automata
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 informationThe Safe Lambda Calculus
The Safe Lambda Calculus William Blum Linacre College Submitted in partial fulfilment of the requirements for the degree of Doctor of Philosophy Oxford University Computing Laboratory Michaelmas 2008 Abstract
More information