System F. Proofs and Types. Bow-Yaw Wang. Academia Sinica. Spring 2012

Size: px
Start display at page:

Download "System F. Proofs and Types. Bow-Yaw Wang. Academia Sinica. Spring 2012"

Transcription

1 Proofs and Types System F Bow-Yaw Wang Academia Sinica Spring 2012

2 The Calculus Types in System F are defined as follows. type variables: X, Y,.... if U and V are types, then U V is a type. if V is a type and X is a type variable, ΠX.V is a type. Terms in System F are defined as follows. variables: x T, y T,... of type T. applications: tu of type V when t and u are of types U V and U respectively. λ-abstraction: λx U.v of type U V when x U is a variable of type U and v is of type V. universal abstraction: if v is a term of type V and the type variable X is not free in the type of any free variable of v, then the term ΛX.v is of type ΠX.V. ΛZ.λx Z.x is of type ΠZ.Z Z; ΛZ.x Z is not allowed. universal application (or extraction): if t is a term of type ΠX.V and U is a type, then tu is of type V[U/X]. (ΛZ.λx Z.x)(ΠZ.Z Z) is of type (ΠZ.Z Z) (ΠZ.Z Z).

3 Conversions Two types of conversions: (λx U.v)u v[u/x] and (ΛX.v)U v[u/x] For example, (ΛZ.λx Z.x)(ΠZ.Z Z) λx ΠZ.Z Z.x. By convention, we write U 1 U 2 U n V for U 1 (U 2 (U n V)) and fu 1 u 2 u n for ( ((fu 1 )u 2 ) )u n

4 Circularity? again the term ΛZ.λx Z.x of type ΠZ.Z Z. Naively, we can say ΛZ.λx Z.x is the identify function λx Z.x for any type Z. (ΛZ.λx Z.x)Int 0 (λx Int.x)0 0. (ΛZ.λx Z.x)Bool F (λx Bool.x)F F. We can define functions of different types. How do you implement a universal identity in C++ or Java? Very easy in modern functional languages (OCaml, Haskell, etc). Our naive semantics may lead to circularity. Does any type include the type of all types? Russell s paradox: A = {x : x A}.

5 Representation of simple types Boolean We can define Booleans in system F. We have Bool T : Bool F : Bool = ΠX.X X X = ΛX.λx X.λy X.x = ΛX.λx X.λy X.y D u v t : U = t U u v (u, v : U; t : Bool) D u v T = (ΛX.λx X.λy X.x) U u v (λx U.λy U.x) u v (λy U.u) v u D u v F = (ΛX.λx X.λy X.y) U u v (λx U.λy U.y) u v

6 Representation of simple types Product Types U V = ΠX.(U V X) X u, v π 1 t π 2 t = ΛX.λx U V X.x u v = t U (λx U.λy U.x) = t U (λx U.λy U.x) We have π 1 u, v = (ΛX.λx U V X.x u v) U (λx U.λy V.x) (λx U V U.x u v)(λx U.λy V.x) (λx U.λy V.x) u v (λy V.u) v u π 2 u, v = (ΛX.λx U V X.x u v) U (λx U.λy V.y) (λx U V U.x u v)(λx U.λy V.y) (λx U.λy V.y) u v

7 Representation of simple types Empty Type If t : Emp, then ɛ U t : U. Emp = ΠX.X ɛ U t = t U

8 Representation of simple types Sum Types U + V = ΠX.(U X) (V X) X ι 1 u = ΛX.λx U X.λy V X.x u ι 2 v = ΛX.λx U X.λy V X.y v δx.u y.v t = t U (λx U.u) (λy V.v) (u, v : U; t : R + S) We have δx.u y.v (ι 1 r) = (ΛX.λx R X.λy S X.x r) U (λx R.u) (λy S.v) (λx R U.λy S U.x r) (λx R.u) (λy S.v) (λy S U.(λx R.u) r) (λy S.v) (λx R.u) r u[r/x] Similarly, δx.u y.v (ι 2 s) v[s/y].

9 Representation of simple types Secondary Conversions the secondary conversions in deductions:. U V. U V U 1E. U V V 2E I U V [U] U V 1I [V] U V 2I E U V converts to converts to. U V. U V Our representations in system F do not reflect the secondary conversions: π 1 t, π 2 t t δx.(ι 1 x) y.(ι 2 y) t t

10 Representation of simple types Existential Types ΣX.V = ΠY.(ΠX.(V Y)) Y U, v X.x.w t = ΛY.λx ΠX.V Y.x U v (v : V[U/X]) = t W (ΛX.λx V.w) ΣX.V means for some predicate X, V holds. This is second-order logic. We will come back to this later. We have ( X.x.w) U, v = (ΛY.λx ΠX.V Y.x U v) W (ΛX.λx V.w) (λx ΠX.V W.x U v) (ΛX.λx V.w) (ΛX.λx V.w) U v (λx V[U/X].w[U/X]) v w[u/x][v/x]

11 Representation of Inductive Types Free Structures a collection Θ of terms generated by functions that builds new Θ-terms from old (constructors). Constructors that do not take old Θ-term are constants. Examples. The Boolean type has two constants: f and t. represented by ΠX.X X X The product type has one constructor:,. represented by ΠX.(U V X) X The sum type has two constructors: ι 1 and ι 2. represented by ΠX.(U X) (V X) X The empty type has nothing. represented by ΠX.X.

12 Representation of Inductive Types Representation of Constructors Suppose a free structure Θ is represented by the type T. A Θ-term is therefore of type T. Representations of its constructors can be derived naturally. Examples. For ΠX.X X X, we have two constants ΛX.λx X.λy X.x and ΛX.λx X.λy X.y. For ΠX.(U V X) X, we have one constructor ΛX.λx U V X.x u v with parameters u U and v V. For ΠX.(U X) (V X) X, we have two constructors: ΛX.λx U X.λy V X.x u with a parameter u U and ΛX.λx U X.λy V X.y v with a parameter v V.

13 Representation of Inductive Types Induction on Free Structures Let a free structure Θ be represented by the type T. the induction h on a Θ-terms t: If t is generated by the constructor ctri from the non-θ-terms s 1, s 2,..., s k, and the Θ-terms t 1, t 2,..., t l, return h i (s 1, s 2,..., s k, h(t 1 ), h(t 2 ),..., h(t l )). Examples. For the Boolean type, return u if t = t; return v if t = f. h 1 = u and h 2 = v. If h 1, h 2 are of type U, t U h 1 h 2 performs the induction. For the sum type, return u[r/x] if t = ι 1 r; return v[s/y] if t = ι 2 s. h 1 = λx R.u and h 2 = λy S.v. If h 1, h 2 are of type R U, S U, t U h 1 h 2 performs the induction.

14 Representation of Inductive Types Integers We now define integers in system F. Int = ΠX.X (X X) X O = ΛX.λx X.λy X X.x S t It u f t = ΛX.λx X.λy X X.y (t X x y) = t U u f (u : U; f : U U) Int has two constructors: O and S. It u f t performs the induction on an Int-term. We have It u f O = (ΛX.λx X.λy X X.x) U u f (λx U.λy U U.x) u f u It u f (St) = (ΛX.λx X.λy X X.y (t X x y)) U u f (λx U.λy U U.y (t U x y)) u f

15 Representation of Inductive Types Lists Let U be a type. We define lists whose elements are of type U. List U = ΠX.X (U X X) X nil cons u t It w f t We have = ΛX.λx X.λy U X X.x = ΛX.λx X.λy U X X.y u (t X x y) = t W w f (w : W; f : U W W) It w f nil w and It w f (cons u t) f u (It w f t)

16 Representation of Inductive Types Lists Conc s t = It t (λx U.λy List U.cons x y) s We have Conc nil t = It t (λx U.λy List U.cons x y) nil = nil (List U) t (λx U.λy List U.cons x y) = (ΛX.λx X.λy U X X.x) (List U) t (λx U.λy List U.cons x y) (λx List U.λy U List U List U.x) t (λx U.λy List U.cons x y) t Conc (cons u s) t = It t (λx U.λy List U.cons x y) (cons u s) = (cons u s) (List U) t (λx U.λy List U.cons x y) = (ΛX.λx X.λy U X X.y u (s X x y)) (List U) t (λx U.λy List U.cons x y) (λx List U.λy U List U List U.y u (s (List U) x y)) t (λx U.λy List U.cons x y) (λy U List U List U.y u (s (List U) t y)) (λx U.λy List U.cons x y) (λx U.λy List U.cons x y) u (s (List U) t (λx U.λy List U.cons x y)) cons u (s (List U) t (λx U.λy List U.cons x y)) U List U

17 Representation of Inductive Types Polymorphic Lists The type of elements in a list can of course be quantified. Nil = ΛX.nil X : ΛX.List X Cons = ΛX.cons X : ΛX.X List X List X

18 Representation of Inductive Types Binary Trees A binary tree is either a node (constant) or a tree with two subtrees (constructor). Bintree = ΠX.X (X X X) X nil = ΛX.λx X.λy X X X.x couple u v = ΛX.λx X.λy X X X.y (u X x y) (v X x y) It w f t = t W w f (w : W; f : W W W) We have It w f nil w and It w f (couple u v) f (It w f u) (It w f v)

19 Representation of Inductive Types Trees of Branching Type U A tree of branching type U is either a node (constant) or a tree with subtrees {t u } u U (constructor). Tree = ΠX.X ((U X) X) X nil collect f It w h t We have = ΛX.λx X.λy (U X) X.x = ΛX.λx X.λy (U X) X.y (λz U.f z X x y) = t W w h (w : W; h : (U W) W) It w h nil w and It w h (collect f ) h (λx U.It w h (f x))

LOWELL JOURNAL. MUST APOLOGIZE. such communication with the shore as Is m i Boimhle, noewwary and proper for the comfort

LOWELL JOURNAL. MUST APOLOGIZE. such communication with the shore as Is m i Boimhle, noewwary and proper for the comfort - 7 7 Z 8 q ) V x - X > q - < Y Y X V - z - - - - V - V - q \ - q q < -- V - - - x - - V q > x - x q - x q - x - - - 7 -» - - - - 6 q x - > - - x - - - x- - - q q - V - x - - ( Y q Y7 - >»> - x Y - ] [

More information

Derivatives in 2D. Outline. James K. Peterson. November 9, Derivatives in 2D! Chain Rule

Derivatives in 2D. Outline. James K. Peterson. November 9, Derivatives in 2D! Chain Rule Derivatives in 2D James K. Peterson Department of Biological Sciences and Department of Mathematical Sciences Clemson University November 9, 2016 Outline Derivatives in 2D! Chain Rule Let s go back to

More information

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2)

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2) CVO103: Programming Languages Lecture 2 Inductive Definitions (2) Hakjoo Oh 2018 Spring Hakjoo Oh CVO103 2018 Spring, Lecture 2 March 13, 2018 1 / 20 Contents More examples of inductive definitions natural

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

County Council Named for Kent

County Council Named for Kent \ Y Y 8 9 69 6» > 69 ««] 6 : 8 «V z 9 8 x 9 8 8 8?? 9 V q» :: q;; 8 x () «; 8 x ( z x 9 7 ; x >«\ 8 8 ; 7 z x [ q z «z : > ; ; ; ( 76 x ; x z «7 8 z ; 89 9 z > q _ x 9 : ; 6? ; ( 9 [ ) 89 _ ;»» «; x V

More information

CMSC 631 Program Analysis and Understanding Fall Type Systems

CMSC 631 Program Analysis and Understanding Fall Type Systems Program Analysis and Understanding Fall 2017 Type Systems Type Systems A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according

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

Extending the Lambda Calculus: An Eager Functional Language

Extending the Lambda Calculus: An Eager Functional Language Syntax of the basic constructs: Extending the Lambda Calculus: An Eager Functional Language canonical forms z cfm ::= intcfm boolcfm funcfm tuplecfm altcfm intcfm ::= 0 1-1... boolcfm ::= boolconst funcfm

More information

a. (6.25 points) where we let b. (6.25 points) c. (6.25 points) d. (6.25 points) B 3 =(x)[ H(x) F (x)], and (11)

a. (6.25 points) where we let b. (6.25 points) c. (6.25 points) d. (6.25 points) B 3 =(x)[ H(x) F (x)], and (11) A1 Logic (25 points) For each of the following either prove it step-by-step using resolution or another sound and complete technique of your stated choice or disprove it by exhibiting in detail a relevant

More information

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures

1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures CS 6110 S18 Lecture 21 Products, Sums, and Other Datatypes 1 Introduction In this lecture, we add constructs to the typed λ-calculus that allow working with more complicated data structures, such as pairs,

More information

In Class Problem Set #15

In Class Problem Set #15 In Class Problem Set #15 CSE 1400 and MTH 2051 Fall 2012 Relations Definitions A relation is a set of ordered pairs (x, y) where x is related to y. Let denote a relational symbol. Write x y to express

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

Simply Typed Lambda Calculus

Simply Typed Lambda Calculus Simply Typed Lambda Calculus Language (ver1) Lambda calculus with boolean values t ::= x variable x : T.t abstraction tt application true false boolean values if ttt conditional expression Values v ::=

More information

Completeness Theorems and λ-calculus

Completeness Theorems and λ-calculus Thierry Coquand Apr. 23, 2005 Content of the talk We explain how to discover some variants of Hindley s completeness theorem (1983) via analysing proof theory of impredicative systems We present some remarks

More information

CSE 1400 Applied Discrete Mathematics Definitions

CSE 1400 Applied Discrete Mathematics Definitions CSE 1400 Applied Discrete Mathematics Definitions Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Arithmetic 1 Alphabets, Strings, Languages, & Words 2 Number Systems 3 Machine

More information

logical verification lecture program extraction and prop2

logical verification lecture program extraction and prop2 logical verification lecture 7 2017-05-04 program extraction and prop2 overview program extraction program extraction: examples verified programs: alternative approach formulas of prop2 terminology proofs

More information

Discrete Mathematics

Discrete Mathematics Discrete Mathematics Yi Li Software School Fudan University March 13, 2017 Yi Li (Fudan University) Discrete Mathematics March 13, 2017 1 / 1 Review of Lattice Ideal Special Lattice Boolean Algebra Yi

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

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

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

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

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

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

Non deterministic classical logic: the λµ ++ -calculus

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

Knowledge Representation and Reasoning in Modal Higher-order Logic

Knowledge Representation and Reasoning in Modal Higher-order Logic Knowledge Representation and Reasoning in Modal Higher-order Logic J.W. Lloyd Computer Sciences Laboratory College of Engineering and Computer Science The Australian National University August 23, 2007

More information

Complex Variables. Chapter 2. Analytic Functions Section Harmonic Functions Proofs of Theorems. March 19, 2017

Complex Variables. Chapter 2. Analytic Functions Section Harmonic Functions Proofs of Theorems. March 19, 2017 Complex Variables Chapter 2. Analytic Functions Section 2.26. Harmonic Functions Proofs of Theorems March 19, 2017 () Complex Variables March 19, 2017 1 / 5 Table of contents 1 Theorem 2.26.1. 2 Theorem

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

Proof Calculus for Partial Correctness

Proof Calculus for Partial Correctness Proof Calculus for Partial Correctness Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 7, 2016 Bow-Yaw Wang (Academia Sinica) Proof Calculus for Partial Correctness September

More information

Minimal logic for computable functionals

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

Theory of Computation

Theory of Computation Theory of Computation (Feodor F. Dragan) Department of Computer Science Kent State University Spring, 2018 Theory of Computation, Feodor F. Dragan, Kent State University 1 Before we go into details, what

More information

CSCI 220: Computer Architecture I Instructor: Pranava K. Jha. Multiplexers

CSCI 220: Computer Architecture I Instructor: Pranava K. Jha. Multiplexers CSCI : Computer Architecture I Instructor: Pranava K. Jha Multiplexers Q. Develop a Boolean expression for the function F in terms of the input variables v, w, x, y and z in the following circuit. (E is

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

The Mother of All Paradoxes

The Mother of All Paradoxes The Mother of All Paradoxes Volker Halbach Truth and Intensionality Amsterdam 3rd December 2016 A theory of expressions The symbols of L are: 1. infinitely many variable symbols v 0, v 1, v 2, v 3,...

More information

Discrete Mathematics Review

Discrete Mathematics Review CS 1813 Discrete Mathematics Discrete Mathematics Review or Yes, the Final Will Be Comprehensive 1 Truth Tables for Logical Operators P Q P Q False False False P Q False P Q False P Q True P Q True P True

More information

The intersection and the union of the asynchronous systems

The intersection and the union of the asynchronous systems BULETINUL ACADEMIEI DE ŞTIINŢE A REPUBLICII MOLDOVA. MATEMATICA Number 3(55), 2007, Pages 3 22 ISSN 1024 7696 The intersection and the union of the asynchronous systems Serban E. Vlad Abstract. The asynchronous

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions

Finite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Formal proofs; Simple/strong induction; Mutual induction; Inductively defined sets; Recursively defined functions. Lecture 3 Ana Bove

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

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

Part 2: First-Order Logic

Part 2: First-Order Logic Part 2: First-Order Logic First-order logic formalizes fundamental mathematical concepts is expressive (Turing-complete) is not too expressive (e. g. not axiomatizable: natural numbers, uncountable sets)

More information

Realizing the axiom of dependent choice

Realizing the axiom of dependent choice Realizing the axiom of dependent choice Jean-Louis Krivine PPS Group, University Paris 7, CNRS krivine@pps.jussieu.fr Edinburgh, March 26, 2003 1 The extended Curry-Howard correspondence We want to get

More information

3 Applications of partial differentiation

3 Applications of partial differentiation Advanced Calculus Chapter 3 Applications of partial differentiation 37 3 Applications of partial differentiation 3.1 Stationary points Higher derivatives Let U R 2 and f : U R. The partial derivatives

More information

Programming with classical quantum datatypes

Programming with classical quantum datatypes Programming with classical quantum datatypes Robin Cockett & Brett Giles (robin,gilesb)@cpsc.ucalgary.ca University of Calgary FMCS 2006, Programming with classical quantum datatypes p. 1/49 Yet another

More information

Declarative Programming for Agent Applications

Declarative Programming for Agent Applications Noname manuscript No. (will be inserted by the editor) Declarative Programming for Agent Applications J.W. Lloyd K.S. Ng Received: date / Accepted: date Abstract This paper introduces the execution model

More information

Herbrand Theorem, Equality, and Compactness

Herbrand Theorem, Equality, and Compactness CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order

More information

Mathematical Induction

Mathematical Induction Mathematical Induction COM1022 Functional Programming Techniques Professor Steve Schneider University of Surrey Semester 2, 2010 Week 10 Professor Steve Schneider Mathematical Induction Semester 2, 2010

More information

Relations to first order logic

Relations to first order logic An Introduction to Description Logic IV Relations to first order logic Marco Cerami Palacký University in Olomouc Department of Computer Science Olomouc, Czech Republic Olomouc, November 6 th 2014 Marco

More information

' '-'in.-i 1 'iritt in \ rrivfi pr' 1 p. ru

' '-'in.-i 1 'iritt in \ rrivfi pr' 1 p. ru V X X Y Y 7 VY Y Y F # < F V 6 7»< V q q $ $» q & V 7» Q F Y Q 6 Q Y F & Q &» & V V» Y V Y [ & Y V» & VV & F > V } & F Q \ Q \» Y / 7 F F V 7 7 x» > QX < #» > X >» < F & V F» > > # < q V 6 & Y Y q < &

More information

Top Down and Bottom Up Composition. 1 Notes on Notation and Terminology. 2 Top-down and Bottom-Up Composition. Two senses of functional application

Top Down and Bottom Up Composition. 1 Notes on Notation and Terminology. 2 Top-down and Bottom-Up Composition. Two senses of functional application Elizabeth Coppock Compositional Semantics coppock@phil.hhu.de Heinrich Heine University Wed. ovember 30th, 2011 Winter Semester 2011/12 Time: 14:30 16:00 Room: 25.22-U1.72 Top Down and Bottom Up Composition

More information

An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California. 2. Background: Semirings and Kleene algebras

An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California. 2. Background: Semirings and Kleene algebras An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California 1. Residuated Lattices with iteration 2. Background: Semirings and Kleene algebras 3. A Gentzen system

More information

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg Type Theory and Constructive Mathematics Type Theory and Constructive Mathematics Thierry Coquand University of Gothenburg Content An introduction to Voevodsky s Univalent Foundations of Mathematics The

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

MATH 220: Problem Set 3 Solutions

MATH 220: Problem Set 3 Solutions MATH 220: Problem Set 3 Solutions Problem 1. Let ψ C() be given by: 0, x < 1, 1 + x, 1 < x < 0, ψ(x) = 1 x, 0 < x < 1, 0, x > 1, so that it verifies ψ 0, ψ(x) = 0 if x 1 and ψ(x)dx = 1. Consider (ψ j )

More information

Context-Free Languages

Context-Free Languages CS:4330 Theory of Computation Spring 2018 Context-Free Languages Non-Context-Free Languages Haniel Barbosa Readings for this lecture Chapter 2 of [Sipser 1996], 3rd edition. Section 2.3. Proving context-freeness

More information

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P. First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable

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

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

On Lists and Other Abstract Data Types in the Calculus of Constructions

On Lists and Other Abstract Data Types in the Calculus of Constructions On Lists and Other Abstract Data Types in the Calculus of Constructions Jonathan P. Seldin Department of Mathematics Concordia University Montreal, Quebec, Canada seldin@alcor.concordia.ca January 29,

More information

Summer 2017 MATH Solution to Exercise 5

Summer 2017 MATH Solution to Exercise 5 Summer 07 MATH00 Solution to Exercise 5. Find the partial derivatives of the following functions: (a (xy 5z/( + x, (b x/ x + y, (c arctan y/x, (d log((t + 3 + ts, (e sin(xy z 3, (f x α, x = (x,, x n. (a

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

Lecture 2: Axiomatic semantics

Lecture 2: Axiomatic semantics Chair of Software Engineering Trusted Components Prof. Dr. Bertrand Meyer Lecture 2: Axiomatic semantics Reading assignment for next week Ariane paper and response (see course page) Axiomatic semantics

More information

On the Semantics of Parsing Actions

On the Semantics of Parsing Actions On the Semantics of Parsing Actions Hayo Thielecke School of Computer Science University of Birmingham Birmingham B15 2TT, United Kingdom Abstract Parsers, whether constructed by hand or automatically

More information

Normalization by Evaluation

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

A General Type for Storage Operators

A General Type for Storage Operators A General Type for Storage Operators Karim NOUR LAMA - Equipe de Logique, Université de Chambéry 73376 Le Bourget du Lac e-mail nour@univ-savoie.fr Abstract In 1990, J.L. Krivine introduced the notion

More information

Automated Reasoning Lecture 5: First-Order Logic

Automated Reasoning Lecture 5: First-Order Logic Automated Reasoning Lecture 5: First-Order Logic Jacques Fleuriot jdf@inf.ac.uk Recap Over the last three lectures, we have looked at: Propositional logic, semantics and proof systems Doing propositional

More information

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam Logic and Modelling Introduction to Predicate Logic Jörg Endrullis VU University Amsterdam Predicate Logic In propositional logic there are: propositional variables p, q, r,... that can be T or F In predicate

More information

Introduction to Z3. Bow-Yaw Wang. December 19, Institute of Information Science Academia Sinica, Taiwan

Introduction to Z3. Bow-Yaw Wang. December 19, Institute of Information Science Academia Sinica, Taiwan Introduction to Z3 Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan December 19, 2017 Bow-Yaw Wang (Academia Sinica) Introduction to Z3 December 19, 2017 1 / 26 Outline 1 Introduction

More information

Proofs and computations

Proofs and computations (j.w.w. Kenji Miyamoto) Mathematisches Institut, LMU, München Leeds University, 7. March 2012 Formalization and extraction One can extract from a (constructive) proof of a formula with computational content

More information

Handout: Proof of the completeness theorem

Handout: Proof of the completeness theorem MATH 457 Introduction to Mathematical Logic Spring 2016 Dr. Jason Rute Handout: Proof of the completeness theorem Gödel s Compactness Theorem 1930. For a set Γ of wffs and a wff ϕ, we have the following.

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

Predicate Logic. Xinyu Feng 11/20/2013. University of Science and Technology of China (USTC)

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

More information

Program Verification Using Separation Logic

Program Verification Using Separation Logic Program Verification Using Separation Logic Cristiano Calcagno Adapted from material by Dino Distefano Lecture 1 Goal of the course Study Separation Logic having automatic verification in mind Learn how

More information

(2) (15pts) Using Prolog, implement a type-checker for the following small subset of System F:

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

The Calculus of Inductive Constructions

The Calculus of Inductive Constructions The Calculus of Inductive Constructions Hugo Herbelin 10th Oregon Programming Languages Summer School Eugene, Oregon, June 16-July 1, 2011 1 Outline - A bit of history, leading to the Calculus of Inductive

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

Problem (p.613) Determine all solutions, if any, to the boundary value problem. y + 9y = 0; 0 < x < π, y(0) = 0, y (π) = 6,

Problem (p.613) Determine all solutions, if any, to the boundary value problem. y + 9y = 0; 0 < x < π, y(0) = 0, y (π) = 6, Problem 10.2.4 (p.613) Determine all solutions, if any, to the boundary value problem y + 9y = 0; 0 < x < π, y(0) = 0, y (π) = 6, by first finding a general solution to the differential equation. Solution.

More information

Blame for All. Amal Ahmed, Robert Bruce Findler, Jeremy Siek, Philip Wadler

Blame for All. Amal Ahmed, Robert Bruce Findler, Jeremy Siek, Philip Wadler Blame for All Amal Ahmed, Robert Bruce Findler, Jeremy Siek, Philip Wadler Vs. Part I The bit you know from before with a twist A simple untyped program let inc = λx. x + 1 in let app = λf. λx. f x in

More information

Introduction to Kleene Algebras

Introduction to Kleene Algebras Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1 Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0)

More information

Warm-Up Problem. Let be a Predicate logic formula and a term. Using the fact that. (which can be proven by structural induction) show that 1/26

Warm-Up Problem. Let be a Predicate logic formula and a term. Using the fact that. (which can be proven by structural induction) show that 1/26 Warm-Up Problem Let be a Predicate logic formula and a term Using the fact that I I I (which can be proven by structural induction) show that 1/26 Predicate Logic: Natural Deduction Carmen Bruni Lecture

More information

Our task The optimization principle Available choices Preferences and utility functions Describing the representative consumer preferences

Our task The optimization principle Available choices Preferences and utility functions Describing the representative consumer preferences X Y U U(x, y), x X y Y (x, y ) U(x, y ) (x, y ) (x, y ) (x, y ) (x, y ) (x, y ) U(x, y ) > U(x, y ) (x, y ) (x, y ) U(x, y ) < U(x, y ) U(x, y ) = U(x, y ) X Y U x y U x > x 0 U(x, y) U(x 0, y), y y >

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

Crew of25 Men Start Monday On Showboat. Many Permanent Improvements To Be Made;Project Under WPA

Crew of25 Men Start Monday On Showboat. Many Permanent Improvements To Be Made;Project Under WPA U G G G U 2 93 YX Y q 25 3 < : z? 0 (? 8 0 G 936 x z x z? \ 9 7500 00? 5 q 938 27? 60 & 69? 937 q? G x? 937 69 58 } x? 88 G # x 8 > x G 0 G 0 x 8 x 0 U 93 6 ( 2 x : X 7 8 G G G q x U> x 0 > x < x G U 5

More information

INVITATION FOR BID Exploratory Geothermal Drilling Services Department of Natural Resources (DNR)

INVITATION FOR BID Exploratory Geothermal Drilling Services Department of Natural Resources (DNR) V F B 21064 xy G v f u u ( B u: y : : u : -B ( u /k Wy y 30 2 1500 ff y W 98501 Bx 41017 y W 98504-1017 W 360-407-9399 w@wv y 18 2012 2:00 1500 ff 2331 y W 98501 ://wwwwv//u-f ://wwwwv/v/-k B U B V BF

More information

Code Generation for a Simple First-Order Prover

Code Generation for a Simple First-Order Prover Code Generation for a Simple First-Order Prover Jørgen Villadsen, Anders Schlichtkrull, and Andreas Halkjær From DTU Compute, Technical University of Denmark, 2800 Kongens Lyngby, Denmark Abstract. We

More information

On the Role of Implication in Formal Logic 1

On the Role of Implication in Formal Logic 1 On the Role of Implication in Formal Logic 1 Jonathan P. Seldin Department of Mathematics Concordia University Montréal, Québec, Canada seldin@alcor.concordia.ca April 24, 1998 1 This research was supported

More information

Introduction to first-order logic:

Introduction to first-order logic: Introduction to first-order logic: First-order structures and languages. Terms and formulae in first-order logic. Interpretations, truth, validity, and satisfaction. Valentin Goranko DTU Informatics September

More information

The Language. Elementary Logic. Outline. Well-Formed Formulae (wff s)

The Language. Elementary Logic. Outline. Well-Formed Formulae (wff s) The Language Elementary Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan July 1, 2009 The following symbols are used in sentential logic Symbol Name Remark ( left parenthesis

More information

Introduction to lambda calculus Part 6

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

A Logic Primer. Stavros Tripakis University of California, Berkeley

A Logic Primer. Stavros Tripakis University of California, Berkeley EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2015 A Logic Primer Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE 144/244,

More information

Fundamentals of Software Engineering

Fundamentals of Software Engineering Fundamentals of Software Engineering First-Order Logic Ina Schaefer Institute for Software Systems Engineering TU Braunschweig, Germany Slides by Wolfgang Ahrendt, Richard Bubel, Reiner Hähnle (Chalmers

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

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

Analytic Functions. Differentiable Functions of a Complex Variable

Analytic Functions. Differentiable Functions of a Complex Variable Analytic Functions Differentiable Functions of a Complex Variable In tis capter, we sall generalize te ideas for polynomials power series of a complex variable we developed in te previous capter to general

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Natural Deduction for Propositional Logic

Natural Deduction for Propositional Logic Natural Deduction for Propositional Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 10, 2018 Bow-Yaw Wang (Academia Sinica) Natural Deduction for Propositional Logic

More information

Introduction to dependent type theory. CIRM, May 30

Introduction to dependent type theory. CIRM, May 30 CIRM, May 30 Goals of this presentation Some history and motivations Notations used in type theory Main goal: the statement of main properties of equality type and the univalence axiom First talk P ropositions

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

The Pumping Lemma for Context Free Grammars

The Pumping Lemma for Context Free Grammars The Pumping Lemma for Context Free Grammars Chomsky Normal Form Chomsky Normal Form (CNF) is a simple and useful form of a CFG Every rule of a CNF grammar is in the form A BC A a Where a is any terminal

More information