Nameless Representation of Terms

Size: px
Start display at page:

Download "Nameless Representation of Terms"

Transcription

1 Nameless Representation of Terms CIS500: Software Foundations Nameless Representation of Terms p.1/29

2 First, some review... A Proof on λ-terms Nameless Representation of Terms p.2/29

3 Proof (1) We want to prove that if z FV ([x v]u) then In other words, z (FV (u) \ {x}) FV (v) FV ([x v]u) (FV (u) \ {x}) FV (v) Proof by induction on the structure of u. Nameless Representation of Terms p.3/29

4 Proof (2) Case u = x: Then [x v]u = v, and FV (v) FV (u) \ {x} FV (v) Case u = y, where y x: Then [x v]u = y, and FV (u) = FV (y) = {y} ({y} \ {x}) FV (v) = (FV (u) \ {x}) FV (v) Nameless Representation of Terms p.4/29

5 Proof (3) Case u = λy. t, where y x: Then [x v]u = λy. [x v]t By the IH, FV ([x v]t) (FV (t) \ {x}) FV (v). So FV ([x v]u) = FV (λy. [x v] t) = FV ([x v] t) \ {y} ((FV (t) \ {x}) FV (v)) \ {y} (FV (t) \ {x} \ {y}) FV (v) = (FV (t) \ {y} \ {x}) FV (v) = (FV (u) \ {x}) FV (v) Nameless Representation of Terms p.5/29

6 Proof (4) Case u = t 1 t 2 : Exercise. Nameless Representation of Terms p.6/29

7 Now on to the main topic... Nameless Representation of Terms Nameless Representation of Terms p.7/29

8 Representing Terms t ::= x λx. t t 1 t 2 Choosing a concrete way to represent terms is necessary when using computers to work with λ-terms. Implementing programming language evaluators. Writing machine-checkable definitions and proofs of theorems. Nameless Representation of Terms p.8/29

9 Variable Capture [x λy. z](λz. x) λz. λy. z How can we be sure that our implementation doesn t make this mistake? Nameless Representation of Terms p.9/29

10 Idea: Rename During Substitution Rename z to z before applying substitution. [x λy. z](λz. x) = λz. λy. z Nameless Representation of Terms p.10/29

11 Idea: Barendregt Convention We can make sure our terms never use the same variable name twice. So we must always start with [x λy. z](λz. x) Nameless Representation of Terms p.11/29

12 Idea: Barendregt Convention We can make sure our terms never use the same variable name twice. So we must always start with [x λy. z](λz. x) But then what happens here? [x λy. z](λz. x x) Nameless Representation of Terms p.11/29

13 More Extreme Proposals Explicit Substitutions: Make substitutions part of the syntax and encode renaming into the evaluation rules. Combinators: Find a language with applications but no variables or binding, and translate terms to this langauge. Nameless Representation of Terms p.12/29

14 Devise Canonical Representation Maybe we can think of a unique representation for α-equivalent terms. Nameless Representation of Terms p.13/29

15 Devise Canonical Representation Maybe we can think of a unique representation for α-equivalent terms. For λx. λy. x (y x) we could write λ. λ. 1 (0 1) Is this representation unique? Nameless Representation of Terms p.13/29

16 Devise Canonical Representation Maybe we can think of a unique representation for α-equivalent terms. For λx. λy. x (y x) we could write λ. λ. 1 (0 1) Is this representation unique? What about free variables? Nameless Representation of Terms p.13/29

17 Formal Definition of de Bruijn Terms We will define a family of sets T n so that the set T i can represent terms with at most i free variables. 0 k < n k T n t T n n > 0 λ.t T n 1 t 1 T n t 2 T n (t 1 t 2 ) T n Nameless Representation of Terms p.14/29

18 Free Variables What do we do with y? λx. y x Nameless Representation of Terms p.15/29

19 Free Variables What do we do with y? λx. y x We need some sort of context of definitions, for example Γ = x 4,y 3,z 2,a 1,b 0 Then we should be able to define a function db Γ, such that db Γ (x (y z)) = 4 (3 2) db Γ (λx. y x) = λ. 4 0 Nameless Representation of Terms p.15/29

20 Naming Contexts Let s simplify Γ to be a sequence of variable names. Γ = x n 1,...,x 1,x 0 Then we ll define dom(γ) = {x n 1,...,x 1,x 0 } And Γ(x) = rightmost index of x in Γ Nameless Representation of Terms p.16/29

21 Converting to Nameless Representation db Γ (x) = Γ(x) db Γ (λx. t) = λ.db Γ,x (t) db Γ (t 1 t 2 ) = db Γ (t 1 ) db Γ (t 2 ) Nameless Representation of Terms p.17/29

22 Converting to Nameless Representation db Γ (x) = Γ(x) db Γ (λx. t) = λ.db Γ,x (t) db Γ (t 1 t 2 ) = db Γ (t 1 ) db Γ (t 2 ) What is the type of db Γ? Nameless Representation of Terms p.17/29

23 Converting to Nameless Representation db Γ (x) = Γ(x) db Γ (λx. t) = λ.db Γ,x (t) db Γ (t 1 t 2 ) = db Γ (t 1 ) db Γ (t 2 ) What is the type of db Γ? db Γ : T λ T len(γ) Nameless Representation of Terms p.17/29

24 Conversion Example We will work with Γ = x,y,z and will convert the term λx. y x Then we have db x,y,z (λx. y x) = λ. db x,y,z,x (y x) = λ. db x,y,z,x (y) db x,y,z,x (x) = λ. 2 0 Nameless Representation of Terms p.18/29

25 Defining Substitution Nameless Representation of Terms p.19/29

26 Substitution on Nameless Terms We must define for terms in T n. But how? [k s]t Nameless Representation of Terms p.20/29

27 Substitution on Nameless Terms We must define [k s]t for terms in T n. But how? We want to guarantee db Γ ([x s]t) = [Γ(x) db Γ (s)]db Γ (t) for all Γ such that FV (s) FV (t) {x} dom(γ) Nameless Representation of Terms p.20/29

28 First Attempt { s if k = j [j s]k = k otherwise [j s](λ.t) = λ. [j s]t [j s](t 1 t 2 ) = ([j s]t 1 ) ([j s]t 2 ) Nameless Representation of Terms p.21/29

29 Counter-Example [x λz. z](x (λy. y)) Let Γ = x. db Γ ([x λz. z](x (λy. y))) = db Γ ((λz. z) (λy. y)) = (λ. 0) (λ. 0) but [Γ(x) db Γ (λz. z)]db Γ (x (λy. y)) = [0 λ. 0](0 (λ.0)) = (λ. 0) (λ. [0 λ. 0]0) = (λ. 0) (λ. λ. 0) Nameless Representation of Terms p.22/29

30 Second Attempt { s if k = j [j s]k = k otherwise [j s](λ.t) = λ. [j + 1 s]t [j s](t 1 t 2 ) = ([j s]t 1 ) ([j s]t 2 ) Nameless Representation of Terms p.23/29

31 Counter-Example [x λy. w]λz. x Let Γ = x,w. but db Γ ([x λy. w]λz. x) = db Γ (λz. λy. w) = λ. db Γ,z (λy. w) = λ. λ. db Γ,z,y (w) = λ. λ. 2 [Γ(x) db Γ (λy. w)]db Γ (λz. x) = [1 λ. 1]λ. 2 = λ. [2 λ. 1]2 = λ. λ. 1 Nameless Representation of Terms p.24/29

32 Third Attempt (Shifting) (k) = k + 1 (λ. t) = λ. (t) (t 1 t 2 ) = (t 1 ) (t 2 ) { s if k = j [j s]k = k otherwise [j s](λ.t) = λ. [j + 1 (s)]t [j s](t 1 t 2 ) = ([j s]t 1 ) ([j s]t 2 ) Nameless Representation of Terms p.25/29

33 Counter-Example [x λy. w y]λz. x Let Γ = x,w. but db Γ ([x λy. w y]λz. x) = db Γ (λz. λy. w y) = λ. λ. db Γ,z,y (w y) = λ. λ. 2 0 [Γ(x) db Γ (λy. w y)]db Γ (λz. x) = [1 λ. 1 0]λ. 2 = λ. [2 (λ. 1 0)]2 = λ. [2 λ. 2 1]2 = λ. λ. 2 1 Nameless Representation of Terms p.26/29

34 Third Attempt (Shifting with Cut-Off) { k if k < c c (k) = k + 1 if k c c (λ. t) = λ. c+1 (t) c (t 1 t 2 ) = c (t 1 ) c (t 2 ) { s if k = j [j s]k = k otherwise [j s](λ.t) = λ. [j (s)]t [j s](t 1 t 2 ) = ([j s]t 1 ) ([j s]t 2 ) Nameless Representation of Terms p.27/29

35 Generalized Shifting { k if k < c d c (k) = k + d if k c d c (λ. t) = λ. d c+1 (t) d c (t 1 t 2 ) = d c (t 1 ) d c (t 2 ) Nameless Representation of Terms p.28/29

36 Evaluation of de Bruijn Terms The evaluation rule we want is (λ. t 12 ) v ([0 1 0 (v 2 )]t 12 ) E-APPABS Nameless Representation of Terms p.29/29

37 Evaluation of de Bruijn Terms The evaluation rule we want is (λ. t 12 ) v ([0 1 0 (v 2 )]t 12 ) E-APPABS Consider this example. Let s say our context is Γ = z,y,x. db Γ ((λw. w x y) x y z) = (λ ) ( 1 0 ([0 1 0 (0)](0 1 2))) 1 2 = ( 1 0 ([0 1](0 1 2))) 1 2 = ( 1 0 (1 1 2)) 1 2 = = db Γ (x x y y z) Nameless Representation of Terms p.29/29

λ 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

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

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

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

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

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

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

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

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

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

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

Specification of Core Agda Subtitle

Specification of Core Agda Subtitle 1 Specification of Core Agda Subtitle THE AGDA SPECIFICATION TEAM, Institution1 FIRST2 LAST2, Institution2a and Institution2b This document specifies the abstract syntax, evaluation rules, and typing rules

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

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

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

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

Topics in linear algebra

Topics in linear algebra Chapter 6 Topics in linear algebra 6.1 Change of basis I want to remind you of one of the basic ideas in linear algebra: change of basis. Let F be a field, V and W be finite dimensional vector spaces over

More information

Notes from Yesterday s Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons.

Notes from Yesterday s  Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons. CIS 500 Software Foundations Fall 2006 Notes from Yesterday s Email Discussion November 1 Some lessons This is generally a crunch-time in the semester Slow down a little and give people a chance to catch

More information

PHIL 422 Advanced Logic Inductive Proof

PHIL 422 Advanced Logic Inductive Proof PHIL 422 Advanced Logic Inductive Proof 1. Preamble: One of the most powerful tools in your meta-logical toolkit will be proof by induction. Just about every significant meta-logical result relies upon

More information

The Locally Nameless Representation

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

Lectures on The Lambda Calculus (I)

Lectures on The Lambda Calculus (I) Lectures on The Lambda Calculus (I) Masahiko Sato Graduate School of Informatics, Kyoto University Autumn school Proof and Computation Fischbachau, Germany October 4, 2016 Overview In these lectures, I

More information

Local Representations of Binding

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

Recursion Theorem. Ziv Scully Ziv Scully Recursion Theorem / 28

Recursion Theorem. Ziv Scully Ziv Scully Recursion Theorem / 28 Recursion Theorem Ziv Scully 18.504 Ziv Scully Recursion Theorem 18.504 1 / 28 A very λ-calculus appetizer P-p-p-plot twist! λ Ziv Scully Recursion Theorem 18.504 2 / 28 A very λ-calculus appetizer The

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

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

Simply Typed λ-calculus

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

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation 3 1 Gaussian Graphical Models: Schur s Complement Consider

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

EXAM 2 REVIEW DAVID SEAL

EXAM 2 REVIEW DAVID SEAL EXAM 2 REVIEW DAVID SEAL 3. Linear Systems and Matrices 3.2. Matrices and Gaussian Elimination. At this point in the course, you all have had plenty of practice with Gaussian Elimination. Be able to row

More information

Binding in Nominal Equational Logic

Binding in Nominal Equational Logic MFPS 2010 Binding in Nominal Equational Logic Ranald Clouston 1,2 Computer Laboratory, University of Cambridge, Cambridge CB3 0DF, United Kingdom Abstract Many formal systems, particularly in computer

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

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

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

CIS 500 Software Foundations Final Exam Answer key December 20, 2004

CIS 500 Software Foundations Final Exam Answer key December 20, 2004 CIS 500 Software Foundations Final Exam Answer key December 20, 2004 True/False questions For each of the following statements, circle T if the sentence is true or F otherwise. 1. (10 points) (a) T F The

More information

The Suspension Notation as a Calculus of Explicit Substitutions

The Suspension Notation as a Calculus of Explicit Substitutions The Suspension Notation as a Calculus of Explicit Substitutions Gopalan Nadathur Digital Technology Center and Department of Computer Science University of Minnesota [Joint work with D.S. Wilson and A.

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

25. REVISITING EXPONENTS

25. REVISITING EXPONENTS 25. REVISITING EXPONENTS exploring expressions like ( x) 2, ( x) 3, x 2, and x 3 rewriting ( x) n for even powers n This section explores expressions like ( x) 2, ( x) 3, x 2, and x 3. The ideas have been

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give

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

Inverse Functions. One-to-one. Horizontal line test. Onto

Inverse Functions. One-to-one. Horizontal line test. Onto Inverse Functions One-to-one Suppose f : A B is a function. We call f one-to-one if every distinct pair of objects in A is assigned to a distinct pair of objects in B. In other words, each object of the

More information

Recitation 2: Binding, Semantics, and Safety : Foundations of Programming Languages

Recitation 2: Binding, Semantics, and Safety : Foundations of Programming Languages Recitation 2: Binding, Semantics, and Safety 15-312: Foundations of Programming Languages Charles Yuan, Jeanne Luning Prak September 5, 2018 1 Abstract Binding Trees The abstract syntax trees we saw previously

More information

Homework 5: Parallelism and Control Flow : Types and Programming Languages Fall 2015 TA: Evan Cavallo

Homework 5: Parallelism and Control Flow : Types and Programming Languages Fall 2015 TA: Evan Cavallo Homework 5: Parallelism and Control Flow 15-814: Types and Programming Languages Fall 2015 TA: Evan Cavallo (ecavallo@cs.cmu.edu) Out: 11/5/15 Due: 11/17/15, 10:30am 1 Cost Dynamics In this section, we

More information

CSE 505, Fall 2005, Midterm Examination 8 November Please do not turn the page until everyone is ready.

CSE 505, Fall 2005, Midterm Examination 8 November Please do not turn the page until everyone is ready. CSE 505, Fall 2005, Midterm Examination 8 November 2005 Please do not turn the page until everyone is ready. Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.

More information

Lecture notes on Turing machines

Lecture notes on Turing machines Lecture notes on Turing machines Ivano Ciardelli 1 Introduction Turing machines, introduced by Alan Turing in 1936, are one of the earliest and perhaps the best known model of computation. The importance

More information

JUST THE MATHS SLIDES NUMBER 9.6. MATRICES 6 (Eigenvalues and eigenvectors) A.J.Hobson

JUST THE MATHS SLIDES NUMBER 9.6. MATRICES 6 (Eigenvalues and eigenvectors) A.J.Hobson JUST THE MATHS SLIDES NUMBER 96 MATRICES 6 (Eigenvalues and eigenvectors) by AJHobson 96 The statement of the problem 962 The solution of the problem UNIT 96 - MATRICES 6 EIGENVALUES AND EIGENVECTORS 96

More information

Section 4.6 Negative Exponents

Section 4.6 Negative Exponents Section 4.6 Negative Exponents INTRODUCTION In order to understand negative exponents the main topic of this section we need to make sure we understand the meaning of the reciprocal of a number. Reciprocals

More information

Isometric Transformations: Rotations

Isometric Transformations: Rotations 1. What kind of angle is this? Isometric Transformations: Rotations Rotation: transformation that turns the plane through a given angle about (around) a given point. In other words, a translation is a

More information

Convex Analysis and Economic Theory Winter 2018

Convex Analysis and Economic Theory Winter 2018 Division of the Humanities and Social Sciences Ec 181 KC Border Convex Analysis and Economic Theory Winter 2018 Topic 7: Quasiconvex Functions I 7.1 Level sets of functions For an extended real-valued

More information

MATH 105: PRACTICE PROBLEMS FOR CHAPTER 3: SPRING 2010

MATH 105: PRACTICE PROBLEMS FOR CHAPTER 3: SPRING 2010 MATH 105: PRACTICE PROBLEMS FOR CHAPTER 3: SPRING 010 INSTRUCTOR: STEVEN MILLER (SJM1@WILLIAMS.EDU Question 1 : Compute the partial derivatives of order 1 order for: (1 f(x, y, z = e x+y cos(x sin(y. Solution:

More information

COMMUTATIVE ALGEBRA LECTURE 1: SOME CATEGORY THEORY

COMMUTATIVE ALGEBRA LECTURE 1: SOME CATEGORY THEORY COMMUTATIVE ALGEBRA LECTURE 1: SOME CATEGORY THEORY VIVEK SHENDE A ring is a set R with two binary operations, an addition + and a multiplication. Always there should be an identity 0 for addition, an

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

Chapter 7. Homogeneous equations with constant coefficients

Chapter 7. Homogeneous equations with constant coefficients Chapter 7. Homogeneous equations with constant coefficients It has already been remarked that we can write down a formula for the general solution of any linear second differential equation y + a(t)y +

More information

Lecture Notes: Program Analysis Correctness

Lecture Notes: Program Analysis Correctness Lecture Notes: Program Analysis Correctness 15-819O: Program Analysis Jonathan Aldrich jonathan.aldrich@cs.cmu.edu Lecture 5 1 Termination As we think about the correctness of program analysis, let us

More information

Euclidean Space. This is a brief review of some basic concepts that I hope will already be familiar to you.

Euclidean Space. This is a brief review of some basic concepts that I hope will already be familiar to you. Euclidean Space This is a brief review of some basic concepts that I hope will already be familiar to you. There are three sets of numbers that will be especially important to us: The set of all real numbers,

More information

CSE 505, Fall 2008, Midterm Examination 29 October Please do not turn the page until everyone is ready.

CSE 505, Fall 2008, Midterm Examination 29 October Please do not turn the page until everyone is ready. CSE 505, Fall 2008, Midterm Examination 29 October 2008 Please do not turn the page until everyone is ready. Rules: The exam is closed-book, closed-note, except for one side of one 8.5x11in piece of paper.

More information

CIS 500 Software Foundations Final Exam Answer key December 14, 2005

CIS 500 Software Foundations Final Exam Answer key December 14, 2005 CIS 500 Software Foundations Final Exam Answer key December 14, 2005 True/False questions For each of the following statements, circle T if the sentence is true or F otherwise. 1. (9 points) (a) T F The

More information

Predicate Logic. x. x + 0 = x. Predicate logic over integer expressions: a language of logical assertions, for example. Why discuss predicate logic?

Predicate Logic. x. x + 0 = x. Predicate logic over integer expressions: a language of logical assertions, for example. Why discuss predicate logic? Predicate Logic Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic? It is an example of a simple language It has simple denotational

More information

Math (P)Review Part I:

Math (P)Review Part I: Lecture 1: Math (P)Review Part I: Linear Algebra Computer Graphics CMU 15-462/15-662, Fall 2017 Homework 0.0 (Due Monday!) Exercises will be a bit harder / more rigorous than what you will do for the rest

More information

(Refer Slide Time: 1:13)

(Refer Slide Time: 1:13) Linear Algebra By Professor K. C. Sivakumar Department of Mathematics Indian Institute of Technology, Madras Lecture 6 Elementary Matrices, Homogeneous Equaions and Non-homogeneous Equations See the next

More information

CSE 505, Fall 2009, Midterm Examination 5 November Please do not turn the page until everyone is ready.

CSE 505, Fall 2009, Midterm Examination 5 November Please do not turn the page until everyone is ready. CSE 505, Fall 2009, Midterm Examination 5 November 2009 Please do not turn the page until everyone is ready Rules: The exam is closed-book, closed-note, except for one side of one 85x11in piece of paper

More information

Handout 1 Systems of linear equations Gaussian elimination

Handout 1 Systems of linear equations Gaussian elimination 06-21254 Mathematical Techniques for Computer Science The University of Birmingham Autumn Semester 2017 School of Computer Science c Achim Jung September 27, 2017 Handout 1 Systems of linear equations

More information

Lazy Functions as Processes

Lazy Functions as Processes Lazy Functions as Processes Luke Maurer University of Oregon maurerl@cs.uoregon.edu Abstract CPS transforms have long been important tools in the study of programming languages, especially those related

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

1 Overview. 2 Extreme Points. AM 221: Advanced Optimization Spring 2016

1 Overview. 2 Extreme Points. AM 221: Advanced Optimization Spring 2016 AM 22: Advanced Optimization Spring 206 Prof. Yaron Singer Lecture 7 February 7th Overview In the previous lectures we saw applications of duality to game theory and later to learning theory. In this lecture

More information

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

Multivariable Calculus and Matrix Algebra-Summer 2017

Multivariable Calculus and Matrix Algebra-Summer 2017 Multivariable Calculus and Matrix Algebra-Summer 017 Homework 4 Solutions Note that the solutions below are for the latest version of the problems posted. For those of you who worked on an earlier version

More information

Validating QBF Invalidity in HOL4

Validating QBF Invalidity in HOL4 Interactive Theorem Proving (ITP) 14 July, 2010 Quantified Boolean Formulae Quantified Boolean Formulae Motivation System Overview Related Work QBF = propositional logic + quantifiers over Boolean variables

More information

(Refer Slide Time: 0:21)

(Refer Slide Time: 0:21) Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata

More information

Math Precalculus I University of Hawai i at Mānoa Spring

Math Precalculus I University of Hawai i at Mānoa Spring Math 135 - Precalculus I University of Hawai i at Mānoa Spring - 2013 Created for Math 135, Spring 2008 by Lukasz Grabarek and Michael Joyce Send comments and corrections to lukasz@math.hawaii.edu Contents

More information

MATH 228: Calculus III (FALL 2016) Sample Problems for FINAL EXAM SOLUTIONS

MATH 228: Calculus III (FALL 2016) Sample Problems for FINAL EXAM SOLUTIONS MATH 228: Calculus III (FALL 216) Sample Problems for FINAL EXAM SOLUTIONS MATH 228 Page 2 Problem 1. (2pts) Evaluate the line integral C xy dx + (x + y) dy along the parabola y x2 from ( 1, 1) to (2,

More information

Equivalent Forms of the Axiom of Infinity

Equivalent Forms of the Axiom of Infinity Equivalent Forms of the Axiom of Infinity Axiom of Infinity 1. There is a set that contains each finite ordinal as an element. The Axiom of Infinity is the axiom of Set Theory that explicitly asserts that

More information

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers.

Comment: The induction is always on some parameter, and the basis case is always an integer or set of integers. 1. For each of the following statements indicate whether it is true or false. For the false ones (if any), provide a counter example. For the true ones (if any) give a proof outline. (a) Union of two non-regular

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and

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

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove

Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Finite Automata Theory and Formal Languages TMV026/TMV027/DIT321 Responsible: Ana Bove Tuesday 28 of May 2013 Total: 60 points TMV027/DIT321 registration VT13 TMV026/DIT321 registration before VT13 Exam

More information

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

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

CIS 500 Software Foundations Midterm II Answer key November 17, 2004

CIS 500 Software Foundations Midterm II Answer key November 17, 2004 CIS 500 Software Foundations Midterm II Answer key November 17, 2004 Simply typed lambda-calculus The following questions refer to the simply typed lambda-calculus with booleans and error. The syntax,

More information

BRICS. A Computational Formalization for Partial Evaluation. (Extended Version) Basic Research in Computer Science

BRICS. A Computational Formalization for Partial Evaluation. (Extended Version) Basic Research in Computer Science BRICS RS-96-34 Hatcliff & Danvy: A Computational Formalization for Partial Evaluation BRICS Basic Research in Computer Science A Computational Formalization for Partial Evaluation (Extended Version) John

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

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

b. N/kerF = { {x x is an even number}, {x x is an odd number} } This will be the carrier set of the algebra.

b. N/kerF = { {x x is an even number}, {x x is an odd number} } This will be the carrier set of the algebra. 1. a. The homomorphism from N to Parity will map all even numbers (including 0) to even, and all odd numbers to odd. The kernel equivalence relation will therefore consist of all pairs of natural numbers

More information

Dependency Tree Automata

Dependency Tree Automata Dependency Tree Automata Colin Stirling School of Informatics Informatics Forum University of Edinburgh email: cps@inf.ed.ac.uk Abstract. We introduce a new kind of tree automaton, a dependency tree automaton,

More information

5. The Logical Framework

5. The Logical Framework 5. The Logical Framework (a) Judgements. (b) Basic form of rules. (c) The non-dependent function type and product. (d) Structural rules. (Omitted 2008). (e) The dependent function set and -quantification.

More information

Saarland University. Verified Compilation of Weak Call-by-Value Lambda-Calculus into Combinators and Closures

Saarland University. Verified Compilation of Weak Call-by-Value Lambda-Calculus into Combinators and Closures Saarland University Faculty of Natural Sciences and Technology I Bachelor s Thesis Verified Compilation of Weak Call-by-Value Lambda-Calculus into Combinators and Closures Fabian Maximilian Kunze Advisor:

More information

Discrete Structures Proofwriting Checklist

Discrete Structures Proofwriting Checklist CS103 Winter 2019 Discrete Structures Proofwriting Checklist Cynthia Lee Keith Schwarz Now that we re transitioning to writing proofs about discrete structures like binary relations, functions, and graphs,

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

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

Lecture 4: More on Regexps, Non-Regular Languages

Lecture 4: More on Regexps, Non-Regular Languages 6.045 Lecture 4: More on Regexps, Non-Regular Languages 6.045 Announcements: - Pset 1 is on piazza (as of last night) - If you don t have piazza access but are registered for 6.045, send email to TAs with

More information

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Gödel s Incompleteness Theorem. Overview. Computability and Logic Gödel s Incompleteness Theorem Overview Computability and Logic Recap Remember what we set out to do in this course: Trying to find a systematic method (algorithm, procedure) which we can use to decide,

More information

Element x is R-minimal in X if y X. R(y, x).

Element x is R-minimal in X if y X. R(y, x). CMSC 22100/32100: Programming Languages Final Exam M. Blume December 11, 2008 1. (Well-founded sets and induction principles) (a) State the mathematical induction principle and justify it informally. 1

More information

MATRIX THEORY (WEEK 2)

MATRIX THEORY (WEEK 2) MATRIX THEORY (WEEK 2) JAMES FULLWOOD Example 0.1. Let L : R 3 R 4 be the linear map given by L(a, b, c) = (a, b, 0, 0). Then which is the z-axis in R 3, and ker(l) = {(x, y, z) R 3 x = y = 0}, im(l) =

More information

Programming Languages and Types

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

Notes on multivariable calculus

Notes on multivariable calculus Notes on multivariable calculus Jonathan Wise February 2, 2010 1 Review of trigonometry Trigonometry is essentially the study of the relationship between polar coordinates and Cartesian coordinates in

More information

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

5 + 9(10) + 3(100) + 0(1000) + 2(10000) = Chapter 5 Analyzing Algorithms So far we have been proving statements about databases, mathematics and arithmetic, or sequences of numbers. Though these types of statements are common in computer science,

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

Final EXAM Preparation Sheet

Final EXAM Preparation Sheet Final EXAM Preparation Sheet M369 Fall 217 1 Key concepts The following list contains the main concepts and ideas that we have explored this semester. For each concept, make sure that you remember about

More information

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way

Designing Information Devices and Systems I Fall 2018 Lecture Notes Note Introduction to Linear Algebra the EECS Way EECS 16A Designing Information Devices and Systems I Fall 018 Lecture Notes Note 1 1.1 Introduction to Linear Algebra the EECS Way In this note, we will teach the basics of linear algebra and relate it

More information