Type Theory and Coq. Herman Geuvers. Principal Types and Type Checking
|
|
- Δωρός Μοσχοβάκης
- 5 χρόνια πριν
- Προβολές:
Transcript
1 Type Theory and Coq Herman Geuvers Principal Types and Type Checking 1
2 Overview of todays lecture Simple Type Theory à la Curry (versus Simple Type Theory à la Church) Principal Types algorithm Type checking dependent tytpe theory: λp 2
3 Recap: Simple type theory a la Church. Formulation with contexts to declare the free variables: x 1 : σ 1,x 2 : σ 2,...,x n : σ n is a context, usually denoted by Γ. Derivation rules of λ (à la Church): x:σ Γ Γ x : σ Γ M : σ τ Γ N : σ Γ MN : τ Γ,x:σ P : τ Γ λx:σ.p : σ τ Γ λ M : σ if there is a derivation using these rules with conclusion Γ M : σ 3
4 Recap: Formulas-as-Types (Curry, Howard) There are two readings of a judgement M : σ 1. term as algorithm/program, type as specification: M is a function of type σ 2. type as a proposition, term as its proof: M is a proof of the proposition σ There is a one-to-one correspondence: typable terms in λ derivations in minimal proposition logic x 1 : τ 1,x 2 : τ 2,...,x n : τ n M : σ can be read as M is a proof of σ from the assumptions τ 1,τ 2,...,τ n. 4
5 Recap: Example [α β γ] 3 [α] 1 β γ γ 1 α γ (α β) α γ [α β] 2 [α] 1 β (α β γ) (α β) α γ 2 3 λx:α β γ.λy:α β.λz:α.xz(yz) : (α β γ) (α β) α γ 5
6 Untyped λ-calculus Untyped λ-calculus Λ ::= Var (ΛΛ) (λvar.λ) Examples: - K := λxy.x - S := λxyz.xz(yz) - ω := λx.xx - Ω := ωω Ω β Ω 6
7 Untyped λ-calculus Untyped λ-calculus is Turing complete It s power lies in the fact that you can solve recursive equations: Is there a term M such that Is there a term M such that M x = β xm x? M x = β if (Zerox)then1elseMultx(M (Predx))? Yes, because we have a fixed point combinator: - Y := λf.(λx.f(xx))(λx.f(xx)) Property: Y f = β f(y f) 7
8 Why do we want to add types to λ-calculus? Types give a (partial) specification Typed terms can t go wrong (Milner) Subject Reduction property Typed terms always terminate The type checking algorithm detects (simple) mistakes But: The compiler should compute the type information for us! (Why would the programmer have to type all that?) This is called a type assignment system, or also typing à la Curry: For M an untyped term, the type system assigns a type σ to M (or not) 8
9 STT à la Church and à la Curry λ (à la Church): x:σ Γ Γ x : σ Γ M : σ τ Γ N : σ Γ MN : τ Γ,x:σ P : τ Γ λx:σ.p : σ τ λ (à la Curry): x:σ Γ Γ x : σ Γ M : σ τ Γ N : σ Γ MN : τ Γ,x:σ P : τ Γ λx.p : σ τ 9
10 Examples Typed Terms: λx : α.λy : (β α) α.y(λz : β.x)) has only the type α ((β α) α) α Type Assignment: can be assigned the types λx.λy.y(λz.x)) α ((β α) α) α (α α) ((β α α) γ) γ... with α ((β α) γ) γ being the principal type 10
11 Connection between Church and Curry typed STT Definition The erasure map from STT à la Church to STT à la Curry is defined by erasing all type information. So, e.g. x := x M N := M N λx : σ.m := λx. M λx : α.λy : (β α) α.y(λz : β.x)) = λx.λy.y(λz.x)) Theorem If M : σ in STT à la Church, then M : σ in STT à la Curry. Theorem If P : σ in STT à la Curry, then there is an M such that M P and M : σ in STT à la Church. 11
12 Connection between Church and Curry typed STT Definition The erasure map from STT à la Church to STT à la Curry is defined by erasing all type information. x := x M N := M N λx : σ.m := λx. M Theorem If P : σ in STT à la Curry, then there is an M such that M P and M : σ in STT à la Church. Proof: by induction on derivations. x:σ Γ Γ x : σ Γ M : σ τ Γ N : σ Γ MN : τ Γ,x:σ P : τ Γ λx:σ.p : σ τ 12
13 Example of computing a principal type δ {}}{ λx α.λy β.y β (λz γ. y β x α ) }{{} ε 1. Assign type vars to all variables: x : α,y : β,z : γ. 2. Assign type vars to all applicative subterms: yx : δ, y(λz.yx) : ε. 3. Generate equations between types, necessary for the term to be typable: β = α δ β = (γ δ) ε 4. Find a most general unifier (a substitution) for the type vars that solves the equations: α := γ ε, β := (γ ε) ε, δ := ε 5. The principal type of λx.λy.y(λz.yx) is now (γ ε) ((γ ε) ε) ε 13
14 Exercise Compute principal types for S := λx.λy.λz.xz(yz) M := λx.λy.x(y(λz.xzz))(y(λz.xzz)). 14
15 Principal Types: Preliminary Definitions A type substitution (or just substitution) is a map S from type variables to types. (Note: we can compose substitutions.) A unifier of the types σ and τ is a substitution that makes σ and τ equal, i.e. an S such that S(σ) = S(τ) A most general unifier (or mgu) of the types σ and τ is the simplest substitution that makes σ and τ equal, i.e. an S such that S(σ) = S(τ) for all substitutions T such that T(σ) = T(τ) there is a substitution R such that T = R S. All these notions generalize to lists of types σ 1,...,σ n in stead of pairs σ,τ. 15
16 Computing a most general unifier There is an algorithm U that, when given types σ 1,...,σ n outputs A most general unifier of σ 1,...,σ n, if σ 1,...,σ n can be unified. Fail if σ 1,...,σ n can t be unified. U( α = α,...,σ n = τ n ) := U( σ 2 = τ 2,...,σ n = τ n ). U( α = τ 1,...,σ n = τ n ) := reject if α FV(τ 1 ), τ 1 α. U( σ 1 = α,...,σ n = τ n ) := U( α = σ 1,...,σ n = τ n ) U( α = τ 1,...,σ n = τ n ) := [α := V(τ 1 ),V], if α / FV(τ 1 ), where V abbreviates U( σ 2 [α := τ 1 ] = τ 2 [α := τ 1 ],...,σ n [α := τ 1 ] = τ n [α := τ 1 ] ). U( µ ν = ρ ξ,...,σ n = τ n ) := U( µ = ρ,ν = ξ,...,σ n = τ n ) 16
17 Principal type: Definition Definition σ is a principal type for the closed untyped λ-term M if M : σ in STT à la Curry for all types τ, if M : τ, then τ = S(σ) for some substitution S. A principal type is unique up to renaming of type variables. Both α α and β β are principal type of λx.x. 17
18 Principal Types Theorem Theorem There is an algorithm PT that, when given a closed untyped λ-term M, outputs A principal type σ of M if M is typable in STT à la Curry, Fail if M is not typable in STT à la Curry. This can be extended to open untyped λ-terms: There is an algorithm PP that, when given an untyped λ-term M, outputs A principal pair (Γ,σ) of M if M is typable in STT à la Curry, Fail if M is not typable in STT à la Curry. Definition (Γ,σ) is a principal pair for M if Γ M : σ and for every typing M : τ there is a substitution S such that τ = S(σ) and = S(Γ). 18
19 Typical problems one would like to have an algorithm for M : σ? Type Checking Problem TCP M :? Type Synthesis Problem TSP? : σ Type Inhabitation Problem (by a closed term) TIP For λ, all these problems are decidable, both for the Curry style and for the Church style presentation. TCP and TSP are (usually) equivalent: To solve MN : σ, one has to solve N :? (and if this gives answer τ, solve M : τ σ). For Curry systems, TCP and TSP soon become undecidable beyond λ. TIP is undecidable for most extensions of λ, as it corresponds to provability in some logic. 19
20 Rules for λp: axiom, application, abstraction, product : Γ M : Πx : A.B Γ N : A Γ MN : B[x := N] Γ, x : A M : B Γ Πx : A.B : s Γ λx : A.M : Πx : A.B Γ A : Γ, x : A B : s Γ Πx : A.B : s 20
21 Rules for λp: weakening, variable, conversion Γ A : B Γ C : s Γ, x : C A : B Γ A : s Γ, x : A x : A Γ A : B Γ B : s with B = β B Γ A : B 21
22 Properties of λp Uniqueness of types If Γ M : σ and Γ M : τ, then σ= β τ. Subject Reduction If Γ M : σ and M β N, then Γ N : σ. Strong Normalization If Γ M : σ, then all β-reductions from M terminate. Proof of SN is by defining a reduction preserving map from λp to λ. 22
23 Decidability Questions Γ M : σ? TCP Γ M :? TSP Γ? : σ TIP For λp: TIP is undecidable (Equivalent to provability in minimal predicate logic.) TCP/TSP: simultaneously with Context checking 23
24 Type Checking algorithm for λp Define algorithms Ok( ) and Type ( ) simultaneously: Ok( ) takes a context and returns true or false Type ( ) takes a context and a term and returns a term or false. Definition. The type synthesis algorithm Type ( ) is sound if Type Γ (M) = A Γ M : A for all Γ and M. Definition. The type synthesis algorithm Type ( ) is complete if for all Γ, M and A. Γ M : A Type Γ (M) = β A 24
25 Ok(<>) = true Ok(Γ,x:A) = Type Γ (A) {,kind}, Type Γ (x) = if Ok(Γ) and x:a Γ then A else false, Type Γ (type) = if Ok(Γ) then kind else false, Type Γ (MN) = if Type Γ (M) = C and Type Γ (N) = D then if C β Πx:A.B and A = β D then B[x := N] else false else false, 25
26 Type Γ (λx:a.m) = if Type Γ,x:A (M) = B then if Type Γ (Πx:A.B) {type,kind} then Πx:A.B else false else false, Type Γ (Πx:A.B) = if Type Γ (A) = type and Type Γ,x:A (B) = s then s else false 26
27 Soundness and Completeness Soundness Type Γ (M) = A Γ M : A Completeness Γ M : A Type Γ (M) = β A As a consequence: Type Γ (M) = false M is not typable in Γ NB 1. Completeness only makes sense if types are uniqueness upto = β (Otherwise: let Type ( ) generate a set of possible types) NB 2. Completeness only implies that Type terminates on all well-typed terms. We want that Type terminates on all pseudo terms. 27
28 Termination We want Type ( ) to terminate on all inputs. Interesting cases: λ-abstraction and application: Type Γ (λx:a.m) = if Type Γ,x:A (M) = B then else false, if Type Γ (Πx:A.B) {type,kind} then Πx:A.B else false! Recursive call is not on a smaller term! Replace the side condition if Type Γ (Πx:A.B) {type,kind} by if Type Γ (A) {type} 28
29 Termination We want Type ( ) to terminate on all inputs. Interesting cases: λ-abstraction and application: Type Γ (MN) = if Type Γ (M) = C and Type Γ (N) = D then if C β Πx:A.B and A = β D else then B[x := N] else false false,! Need to decide β-reduction and β-equality! For this case, termination follows from soundness of Type and the decidability of equality on well-typed terms (using SN and CR). 29
Proving with Computer Assistance Lecture 2. Herman Geuvers
Proving with Computer Assistance Lecture 2 Herman Geuvers 1 Typed λ calculus as the basis for a Proof Assistant (e.g. Coq) λ-term program proof type specification formula Integrated system for proving
Διαβάστε περισσότεραThe Simply Typed Lambda Calculus
Type Inference Instead of writing type annotations, can we use an algorithm to infer what the type annotations should be? That depends on the type system. For simple type systems the answer is yes, and
Διαβάστε περισσότεραAbout these lecture notes. Simply Typed λ-calculus. Types
About these lecture notes Simply Typed λ-calculus Akim Demaille akim@lrde.epita.fr EPITA École Pour l Informatique et les Techniques Avancées Many of these slides are largely inspired from Andrew D. Ker
Διαβάστε περισσότεραC.S. 430 Assignment 6, Sample Solutions
C.S. 430 Assignment 6, Sample Solutions Paul Liu November 15, 2007 Note that these are sample solutions only; in many cases there were many acceptable answers. 1 Reynolds Problem 10.1 1.1 Normal-order
Διαβάστε περισσότεραIntroduction 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 1: Introduction, Overview, Simple Type Theory 1 Types and sets Types
Διαβάστε περισσότερα2 Composition. Invertible Mappings
Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan Composition. Invertible Mappings In this section we discuss two procedures for creating new mappings from old ones, namely,
Διαβάστε περισσότεραLecture 2. Soundness and completeness of propositional logic
Lecture 2 Soundness and completeness of propositional logic February 9, 2004 1 Overview Review of natural deduction. Soundness and completeness. Semantics of propositional formulas. Soundness proof. Completeness
Διαβάστε περισσότεραIntroduction 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 3: Polymorphic Type Theory: Full polymorphism and ML style polymorphism
Διαβάστε περισσότεραEvery set of first-order formulas is equivalent to an independent set
Every set of first-order formulas is equivalent to an independent set May 6, 2008 Abstract A set of first-order formulas, whatever the cardinality of the set of symbols, is equivalent to an independent
Διαβάστε περισσότεραOrdinal Arithmetic: Addition, Multiplication, Exponentiation and Limit
Ordinal Arithmetic: Addition, Multiplication, Exponentiation and Limit Ting Zhang Stanford May 11, 2001 Stanford, 5/11/2001 1 Outline Ordinal Classification Ordinal Addition Ordinal Multiplication Ordinal
Διαβάστε περισσότεραThe λ-calculus. Lecturer: John Wickerson. Phil Wadler
The λ-calculus Lecturer: John Wickerson Phil Wadler A tiny bit of Java expr ::= expr + expr expr < expr x n block ::= cmd { cmd... cmd } cmd ::= expr; if(cmd) block else block; if(cmd) block; try{cmd}
Διαβάστε περισσότερα3.4 SUM AND DIFFERENCE FORMULAS. NOTE: cos(α+β) cos α + cos β cos(α-β) cos α -cos β
3.4 SUM AND DIFFERENCE FORMULAS Page Theorem cos(αβ cos α cos β -sin α cos(α-β cos α cos β sin α NOTE: cos(αβ cos α cos β cos(α-β cos α -cos β Proof of cos(α-β cos α cos β sin α Let s use a unit circle
Διαβάστε περισσότεραA Lambda Model Characterizing Computational Behaviours of Terms
A Lambda Model Characterizing Computational Behaviours of Terms joint paper with Silvia Ghilezan RPC 01, Sendai, October 26, 2001 1 Plan of the talk normalization properties inverse limit model Stone dualities
Διαβάστε περισσότεραFractional Colorings and Zykov Products of graphs
Fractional Colorings and Zykov Products of graphs Who? Nichole Schimanski When? July 27, 2011 Graphs A graph, G, consists of a vertex set, V (G), and an edge set, E(G). V (G) is any finite set E(G) is
Διαβάστε περισσότεραEE512: Error Control Coding
EE512: Error Control Coding Solution for Assignment on Finite Fields February 16, 2007 1. (a) Addition and Multiplication tables for GF (5) and GF (7) are shown in Tables 1 and 2. + 0 1 2 3 4 0 0 1 2 3
Διαβάστε περισσότεραFrom the finite to the transfinite: Λµ-terms and streams
From the finite to the transfinite: Λµ-terms and streams WIR 2014 Fanny He f.he@bath.ac.uk Alexis Saurin alexis.saurin@pps.univ-paris-diderot.fr 12 July 2014 The Λµ-calculus Syntax of Λµ t ::= x λx.t (t)u
Διαβάστε περισσότεραderivation of the Laplacian from rectangular to spherical coordinates
derivation of the Laplacian from rectangular to spherical coordinates swapnizzle 03-03- :5:43 We begin by recognizing the familiar conversion from rectangular to spherical coordinates (note that φ is used
Διαβάστε περισσότεραAbstract Storage Devices
Abstract Storage Devices Robert König Ueli Maurer Stefano Tessaro SOFSEM 2009 January 27, 2009 Outline 1. Motivation: Storage Devices 2. Abstract Storage Devices (ASD s) 3. Reducibility 4. Factoring ASD
Διαβάστε περισσότεραChapter 6: Systems of Linear Differential. be continuous functions on the interval
Chapter 6: Systems of Linear Differential Equations Let a (t), a 2 (t),..., a nn (t), b (t), b 2 (t),..., b n (t) be continuous functions on the interval I. The system of n first-order differential equations
Διαβάστε περισσότεραλρ-calculus 1. each λ-variable is a λρ-term, called an atom or atomic term; 2. if M and N are λρ-term then (MN) is a λρ-term called an application;
λρ-calculus Yuichi Komori komori@math.s.chiba-u.ac.jp Department of Mathematics, Faculty of Sciences, Chiba University Arato Cho aratoc@g.math.s.chiba-u.ac.jp Department of Mathematics, Faculty of Sciences,
Διαβάστε περισσότεραLecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3
Lecture 2: Dirac notation and a review of linear algebra Read Sakurai chapter 1, Baym chatper 3 1 State vector space and the dual space Space of wavefunctions The space of wavefunctions is the set of all
Διαβάστε περισσότεραOverview. Transition Semantics. Configurations and the transition relation. Executions and computation
Overview Transition Semantics Configurations and the transition relation Executions and computation Inference rules for small-step structural operational semantics for the simple imperative language Transition
Διαβάστε περισσότεραSequent Calculi for the Modal µ-calculus over S5. Luca Alberucci, University of Berne. Logic Colloquium Berne, July 4th 2008
Sequent Calculi for the Modal µ-calculus over S5 Luca Alberucci, University of Berne Logic Colloquium Berne, July 4th 2008 Introduction Koz: Axiomatisation for the modal µ-calculus over K Axioms: All classical
Διαβάστε περισσότεραk A = [k, k]( )[a 1, a 2 ] = [ka 1,ka 2 ] 4For the division of two intervals of confidence in R +
Chapter 3. Fuzzy Arithmetic 3- Fuzzy arithmetic: ~Addition(+) and subtraction (-): Let A = [a and B = [b, b in R If x [a and y [b, b than x+y [a +b +b Symbolically,we write A(+)B = [a (+)[b, b = [a +b
Διαβάστε περισσότεραOther Test Constructions: Likelihood Ratio & Bayes Tests
Other Test Constructions: Likelihood Ratio & Bayes Tests Side-Note: So far we have seen a few approaches for creating tests such as Neyman-Pearson Lemma ( most powerful tests of H 0 : θ = θ 0 vs H 1 :
Διαβάστε περισσότεραStatistical Inference I Locally most powerful tests
Statistical Inference I Locally most powerful tests Shirsendu Mukherjee Department of Statistics, Asutosh College, Kolkata, India. shirsendu st@yahoo.co.in So far we have treated the testing of one-sided
Διαβάστε περισσότεραMatrices and Determinants
Matrices and Determinants SUBJECTIVE PROBLEMS: Q 1. For what value of k do the following system of equations possess a non-trivial (i.e., not all zero) solution over the set of rationals Q? x + ky + 3z
Διαβάστε περισσότεραPhys460.nb Solution for the t-dependent Schrodinger s equation How did we find the solution? (not required)
Phys460.nb 81 ψ n (t) is still the (same) eigenstate of H But for tdependent H. The answer is NO. 5.5.5. Solution for the tdependent Schrodinger s equation If we assume that at time t 0, the electron starts
Διαβάστε περισσότεραCHAPTER 25 SOLVING EQUATIONS BY ITERATIVE METHODS
CHAPTER 5 SOLVING EQUATIONS BY ITERATIVE METHODS EXERCISE 104 Page 8 1. Find the positive root of the equation x + 3x 5 = 0, correct to 3 significant figures, using the method of bisection. Let f(x) =
Διαβάστε περισσότεραHomomorphism in Intuitionistic Fuzzy Automata
International Journal of Fuzzy Mathematics Systems. ISSN 2248-9940 Volume 3, Number 1 (2013), pp. 39-45 Research India Publications http://www.ripublication.com/ijfms.htm Homomorphism in Intuitionistic
Διαβάστε περισσότεραST5224: Advanced Statistical Theory II
ST5224: Advanced Statistical Theory II 2014/2015: Semester II Tutorial 7 1. Let X be a sample from a population P and consider testing hypotheses H 0 : P = P 0 versus H 1 : P = P 1, where P j is a known
Διαβάστε περισσότεραFourier Series. MATH 211, Calculus II. J. Robert Buchanan. Spring Department of Mathematics
Fourier Series MATH 211, Calculus II J. Robert Buchanan Department of Mathematics Spring 2018 Introduction Not all functions can be represented by Taylor series. f (k) (c) A Taylor series f (x) = (x c)
Διαβάστε περισσότεραLambda calculus. Part II Lambda Calculi with Types
Lambda calculus Part II Lambda Calculi with Types Based on materials provided by H. Barendregt Types are certain objects, usually syntactic expressions (e.g. boolean, integer, Char), that may be assigned
Διαβάστε περισσότεραProblem Set 3: Solutions
CMPSCI 69GG Applied Information Theory Fall 006 Problem Set 3: Solutions. [Cover and Thomas 7.] a Define the following notation, C I p xx; Y max X; Y C I p xx; Ỹ max I X; Ỹ We would like to show that C
Διαβάστε περισσότεραExample Sheet 3 Solutions
Example Sheet 3 Solutions. i Regular Sturm-Liouville. ii Singular Sturm-Liouville mixed boundary conditions. iii Not Sturm-Liouville ODE is not in Sturm-Liouville form. iv Regular Sturm-Liouville note
Διαβάστε περισσότεραNumerical Analysis FMN011
Numerical Analysis FMN011 Carmen Arévalo Lund University carmen@maths.lth.se Lecture 12 Periodic data A function g has period P if g(x + P ) = g(x) Model: Trigonometric polynomial of order M T M (x) =
Διαβάστε περισσότεραSection 8.3 Trigonometric Equations
99 Section 8. Trigonometric Equations Objective 1: Solve Equations Involving One Trigonometric Function. In this section and the next, we will exple how to solving equations involving trigonometric functions.
Διαβάστε περισσότεραAreas and Lengths in Polar Coordinates
Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the
Διαβάστε περισσότεραInverse trigonometric functions & General Solution of Trigonometric Equations. ------------------ ----------------------------- -----------------
Inverse trigonometric functions & General Solution of Trigonometric Equations. 1. Sin ( ) = a) b) c) d) Ans b. Solution : Method 1. Ans a: 17 > 1 a) is rejected. w.k.t Sin ( sin ) = d is rejected. If sin
Διαβάστε περισσότερα4.6 Autoregressive Moving Average Model ARMA(1,1)
84 CHAPTER 4. STATIONARY TS MODELS 4.6 Autoregressive Moving Average Model ARMA(,) This section is an introduction to a wide class of models ARMA(p,q) which we will consider in more detail later in this
Διαβάστε περισσότεραSection 7.6 Double and Half Angle Formulas
09 Section 7. Double and Half Angle Fmulas To derive the double-angles fmulas, we will use the sum of two angles fmulas that we developed in the last section. We will let α θ and β θ: cos(θ) cos(θ + θ)
Διαβάστε περισσότεραFinite Field Problems: Solutions
Finite Field Problems: Solutions 1. Let f = x 2 +1 Z 11 [x] and let F = Z 11 [x]/(f), a field. Let Solution: F =11 2 = 121, so F = 121 1 = 120. The possible orders are the divisors of 120. Solution: The
Διαβάστε περισσότεραHomework 3 Solutions
Homework 3 Solutions Igor Yanovsky (Math 151A TA) Problem 1: Compute the absolute error and relative error in approximations of p by p. (Use calculator!) a) p π, p 22/7; b) p π, p 3.141. Solution: For
Διαβάστε περισσότεραDynamic types, Lambda calculus machines Section and Practice Problems Apr 21 22, 2016
Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Dynamic types, Lambda calculus machines Apr 21 22, 2016 1 Dynamic types and contracts (a) To make sure you understand the
Διαβάστε περισσότεραOn the Galois Group of Linear Difference-Differential Equations
On the Galois Group of Linear Difference-Differential Equations Ruyong Feng KLMM, Chinese Academy of Sciences, China Ruyong Feng (KLMM, CAS) Galois Group 1 / 19 Contents 1 Basic Notations and Concepts
Διαβάστε περισσότεραMath221: HW# 1 solutions
Math: HW# solutions Andy Royston October, 5 7.5.7, 3 rd Ed. We have a n = b n = a = fxdx = xdx =, x cos nxdx = x sin nx n sin nxdx n = cos nx n = n n, x sin nxdx = x cos nx n + cos nxdx n cos n = + sin
Διαβάστε περισσότεραUniform Convergence of Fourier Series Michael Taylor
Uniform Convergence of Fourier Series Michael Taylor Given f L 1 T 1 ), we consider the partial sums of the Fourier series of f: N 1) S N fθ) = ˆfk)e ikθ. k= N A calculation gives the Dirichlet formula
Διαβάστε περισσότεραNowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in
Nowhere-zero flows Let be a digraph, Abelian group. A Γ-circulation in is a mapping : such that, where, and : tail in X, head in : tail in X, head in A nowhere-zero Γ-flow is a Γ-circulation such that
Διαβάστε περισσότεραConcrete Mathematics Exercises from 30 September 2016
Concrete Mathematics Exercises from 30 September 2016 Silvio Capobianco Exercise 1.7 Let H(n) = J(n + 1) J(n). Equation (1.8) tells us that H(2n) = 2, and H(2n+1) = J(2n+2) J(2n+1) = (2J(n+1) 1) (2J(n)+1)
Διαβάστε περισσότερα6.1. Dirac Equation. Hamiltonian. Dirac Eq.
6.1. Dirac Equation Ref: M.Kaku, Quantum Field Theory, Oxford Univ Press (1993) η μν = η μν = diag(1, -1, -1, -1) p 0 = p 0 p = p i = -p i p μ p μ = p 0 p 0 + p i p i = E c 2 - p 2 = (m c) 2 H = c p 2
Διαβάστε περισσότερα6.3 Forecasting ARMA processes
122 CHAPTER 6. ARMA MODELS 6.3 Forecasting ARMA processes The purpose of forecasting is to predict future values of a TS based on the data collected to the present. In this section we will discuss a linear
Διαβάστε περισσότεραFoundations of Computer Science ENGR 3520 Fall 2013 Thursday, Nov 21, 2013
Foundations of Computer Science Lecture Notes ENGR 3520 Fall 2013 Thursday, Nov 21, 2013 λ-calculus λ-terms. A λ-term is either: A variable x, y, z,... λx.m M N (M) (where x is a variable and M a λ-term)
Διαβάστε περισσότεραAreas and Lengths in Polar Coordinates
Kiryl Tsishchanka Areas and Lengths in Polar Coordinates In this section we develop the formula for the area of a region whose boundary is given by a polar equation. We need to use the formula for the
Διαβάστε περισσότεραChapter 6: Systems of Linear Differential. be continuous functions on the interval
Chapter 6: Systems of Linear Differential Equations Let a (t), a 2 (t),..., a nn (t), b (t), b 2 (t),..., b n (t) be continuous functions on the interval I. The system of n first-order differential equations
Διαβάστε περισσότερα5. Choice under Uncertainty
5. Choice under Uncertainty Daisuke Oyama Microeconomics I May 23, 2018 Formulations von Neumann-Morgenstern (1944/1947) X: Set of prizes Π: Set of probability distributions on X : Preference relation
Διαβάστε περισσότεραExercises 10. Find a fundamental matrix of the given system of equations. Also find the fundamental matrix Φ(t) satisfying Φ(0) = I. 1.
Exercises 0 More exercises are available in Elementary Differential Equations. If you have a problem to solve any of them, feel free to come to office hour. Problem Find a fundamental matrix of the given
Διαβάστε περισσότεραPractice Exam 2. Conceptual Questions. 1. State a Basic identity and then verify it. (a) Identity: Solution: One identity is csc(θ) = 1
Conceptual Questions. State a Basic identity and then verify it. a) Identity: Solution: One identity is cscθ) = sinθ) Practice Exam b) Verification: Solution: Given the point of intersection x, y) of the
Διαβάστε περισσότεραΑλγόριθμοι και πολυπλοκότητα NP-Completeness (2)
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Αλγόριθμοι και πολυπλοκότητα NP-Completeness (2) Ιωάννης Τόλλης Τμήμα Επιστήμης Υπολογιστών NP-Completeness (2) x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 11 13 21
Διαβάστε περισσότεραHOMEWORK 4 = G. In order to plot the stress versus the stretch we define a normalized stretch:
HOMEWORK 4 Problem a For the fast loading case, we want to derive the relationship between P zz and λ z. We know that the nominal stress is expressed as: P zz = ψ λ z where λ z = λ λ z. Therefore, applying
Διαβάστε περισσότεραPARTIAL NOTES for 6.1 Trigonometric Identities
PARTIAL NOTES for 6.1 Trigonometric Identities tanθ = sinθ cosθ cotθ = cosθ sinθ BASIC IDENTITIES cscθ = 1 sinθ secθ = 1 cosθ cotθ = 1 tanθ PYTHAGOREAN IDENTITIES sin θ + cos θ =1 tan θ +1= sec θ 1 + cot
Διαβάστε περισσότεραTridiagonal matrices. Gérard MEURANT. October, 2008
Tridiagonal matrices Gérard MEURANT October, 2008 1 Similarity 2 Cholesy factorizations 3 Eigenvalues 4 Inverse Similarity Let α 1 ω 1 β 1 α 2 ω 2 T =......... β 2 α 1 ω 1 β 1 α and β i ω i, i = 1,...,
Διαβάστε περισσότεραSrednicki Chapter 55
Srednicki Chapter 55 QFT Problems & Solutions A. George August 3, 03 Srednicki 55.. Use equations 55.3-55.0 and A i, A j ] = Π i, Π j ] = 0 (at equal times) to verify equations 55.-55.3. This is our third
Διαβάστε περισσότεραω ω ω ω ω ω+2 ω ω+2 + ω ω ω ω+2 + ω ω+1 ω ω+2 2 ω ω ω ω ω ω ω ω+1 ω ω2 ω ω2 + ω ω ω2 + ω ω ω ω2 + ω ω+1 ω ω2 + ω ω+1 + ω ω ω ω2 + ω
0 1 2 3 4 5 6 ω ω + 1 ω + 2 ω + 3 ω + 4 ω2 ω2 + 1 ω2 + 2 ω2 + 3 ω3 ω3 + 1 ω3 + 2 ω4 ω4 + 1 ω5 ω 2 ω 2 + 1 ω 2 + 2 ω 2 + ω ω 2 + ω + 1 ω 2 + ω2 ω 2 2 ω 2 2 + 1 ω 2 2 + ω ω 2 3 ω 3 ω 3 + 1 ω 3 + ω ω 3 +
Διαβάστε περισσότεραORDINAL ARITHMETIC JULIAN J. SCHLÖDER
ORDINAL ARITHMETIC JULIAN J. SCHLÖDER Abstract. We define ordinal arithmetic and show laws of Left- Monotonicity, Associativity, Distributivity, some minor related properties and the Cantor Normal Form.
Διαβάστε περισσότεραEcon 2110: Fall 2008 Suggested Solutions to Problem Set 8 questions or comments to Dan Fetter 1
Eon : Fall 8 Suggested Solutions to Problem Set 8 Email questions or omments to Dan Fetter Problem. Let X be a salar with density f(x, θ) (θx + θ) [ x ] with θ. (a) Find the most powerful level α test
Διαβάστε περισσότεραSolutions to Exercise Sheet 5
Solutions to Eercise Sheet 5 jacques@ucsd.edu. Let X and Y be random variables with joint pdf f(, y) = 3y( + y) where and y. Determine each of the following probabilities. Solutions. a. P (X ). b. P (X
Διαβάστε περισσότεραLecture 15 - Root System Axiomatics
Lecture 15 - Root System Axiomatics Nov 1, 01 In this lecture we examine root systems from an axiomatic point of view. 1 Reflections If v R n, then it determines a hyperplane, denoted P v, through the
Διαβάστε περισσότεραSection 9.2 Polar Equations and Graphs
180 Section 9. Polar Equations and Graphs In this section, we will be graphing polar equations on a polar grid. In the first few examples, we will write the polar equation in rectangular form to help identify
Διαβάστε περισσότεραTypes and Logics. Programming Languages CS442. David Toman. School of Computer Science University of Waterloo
Types and Logics Programming Languages CS442 David Toman School of Computer Science University of Waterloo David Toman (University of Waterloo) Types and Logics 1 / 20 Curry-Howard Isomorphism Idea types
Διαβάστε περισσότεραTMA4115 Matematikk 3
TMA4115 Matematikk 3 Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet Trondheim Spring 2010 Lecture 12: Mathematics Marvellous Matrices Andrew Stacey Norges Teknisk-Naturvitenskapelige Universitet
Διαβάστε περισσότεραCRASH COURSE IN PRECALCULUS
CRASH COURSE IN PRECALCULUS Shiah-Sen Wang The graphs are prepared by Chien-Lun Lai Based on : Precalculus: Mathematics for Calculus by J. Stuwart, L. Redin & S. Watson, 6th edition, 01, Brooks/Cole Chapter
Διαβάστε περισσότεραSCHOOL OF MATHEMATICAL SCIENCES G11LMA Linear Mathematics Examination Solutions
SCHOOL OF MATHEMATICAL SCIENCES GLMA Linear Mathematics 00- Examination Solutions. (a) i. ( + 5i)( i) = (6 + 5) + (5 )i = + i. Real part is, imaginary part is. (b) ii. + 5i i ( + 5i)( + i) = ( i)( + i)
Διαβάστε περισσότεραANSWERSHEET (TOPIC = DIFFERENTIAL CALCULUS) COLLECTION #2. h 0 h h 0 h h 0 ( ) g k = g 0 + g 1 + g g 2009 =?
Teko Classes IITJEE/AIEEE Maths by SUHAAG SIR, Bhopal, Ph (0755) 3 00 000 www.tekoclasses.com ANSWERSHEET (TOPIC DIFFERENTIAL CALCULUS) COLLECTION # Question Type A.Single Correct Type Q. (A) Sol least
Διαβάστε περισσότεραChapter 3: Ordinal Numbers
Chapter 3: Ordinal Numbers There are two kinds of number.. Ordinal numbers (0th), st, 2nd, 3rd, 4th, 5th,..., ω, ω +,... ω2, ω2+,... ω 2... answers to the question What position is... in a sequence? What
Διαβάστε περισσότεραCommutative Monoids in Intuitionistic Fuzzy Sets
Commutative Monoids in Intuitionistic Fuzzy Sets S K Mala #1, Dr. MM Shanmugapriya *2 1 PhD Scholar in Mathematics, Karpagam University, Coimbatore, Tamilnadu- 641021 Assistant Professor of Mathematics,
Διαβάστε περισσότεραQuadratic Expressions
Quadratic Expressions. The standard form of a quadratic equation is ax + bx + c = 0 where a, b, c R and a 0. The roots of ax + bx + c = 0 are b ± b a 4ac. 3. For the equation ax +bx+c = 0, sum of the roots
Διαβάστε περισσότεραReminders: linear functions
Reminders: linear functions Let U and V be vector spaces over the same field F. Definition A function f : U V is linear if for every u 1, u 2 U, f (u 1 + u 2 ) = f (u 1 ) + f (u 2 ), and for every u U
Διαβάστε περισσότεραLecture 13 - Root Space Decomposition II
Lecture 13 - Root Space Decomposition II October 18, 2012 1 Review First let us recall the situation. Let g be a simple algebra, with maximal toral subalgebra h (which we are calling a CSA, or Cartan Subalgebra).
Διαβάστε περισσότεραCS-XXX: Graduate Programming Languages. Lecture 27 Higher-Order Polymorphism. Matthew Fluet 2012
CS-XXX: Graduate Programming Languages Lecture 27 Higher-Order Polymorphism Matthew Fluet 2012 Looking back, looking forward Have defined System F. Metatheory (what properties does it have) What (else)
Διαβάστε περισσότεραFormal Semantics. 1 Type Logic
Formal Semantics Principle of Compositionality The meaning of a sentence is determined by the meanings of its parts and the way they are put together. 1 Type Logic Types (a measure on expressions) The
Διαβάστε περισσότεραA Note on Intuitionistic Fuzzy. Equivalence Relation
International Mathematical Forum, 5, 2010, no. 67, 3301-3307 A Note on Intuitionistic Fuzzy Equivalence Relation D. K. Basnet Dept. of Mathematics, Assam University Silchar-788011, Assam, India dkbasnet@rediffmail.com
Διαβάστε περισσότερα2. Let H 1 and H 2 be Hilbert spaces and let T : H 1 H 2 be a bounded linear operator. Prove that [T (H 1 )] = N (T ). (6p)
Uppsala Universitet Matematiska Institutionen Andreas Strömbergsson Prov i matematik Funktionalanalys Kurs: F3B, F4Sy, NVP 2005-03-08 Skrivtid: 9 14 Tillåtna hjälpmedel: Manuella skrivdon, Kreyszigs bok
Διαβάστε περισσότεραPartial Differential Equations in Biology The boundary element method. March 26, 2013
The boundary element method March 26, 203 Introduction and notation The problem: u = f in D R d u = ϕ in Γ D u n = g on Γ N, where D = Γ D Γ N, Γ D Γ N = (possibly, Γ D = [Neumann problem] or Γ N = [Dirichlet
Διαβάστε περισσότεραThe challenges of non-stable predicates
The challenges of non-stable predicates Consider a non-stable predicate Φ encoding, say, a safety property. We want to determine whether Φ holds for our program. The challenges of non-stable predicates
Διαβάστε περισσότεραb. Use the parametrization from (a) to compute the area of S a as S a ds. Be sure to substitute for ds!
MTH U341 urface Integrals, tokes theorem, the divergence theorem To be turned in Wed., Dec. 1. 1. Let be the sphere of radius a, x 2 + y 2 + z 2 a 2. a. Use spherical coordinates (with ρ a) to parametrize.
Διαβάστε περισσότεραΜηχανική Μάθηση Hypothesis Testing
ΕΛΛΗΝΙΚΗ ΔΗΜΟΚΡΑΤΙΑ ΠΑΝΕΠΙΣΤΗΜΙΟ ΚΡΗΤΗΣ Μηχανική Μάθηση Hypothesis Testing Γιώργος Μπορμπουδάκης Τμήμα Επιστήμης Υπολογιστών Procedure 1. Form the null (H 0 ) and alternative (H 1 ) hypothesis 2. Consider
Διαβάστε περισσότεραD Alembert s Solution to the Wave Equation
D Alembert s Solution to the Wave Equation MATH 467 Partial Differential Equations J. Robert Buchanan Department of Mathematics Fall 2018 Objectives In this lesson we will learn: a change of variable technique
Διαβάστε περισσότεραSecond Order Partial Differential Equations
Chapter 7 Second Order Partial Differential Equations 7.1 Introduction A second order linear PDE in two independent variables (x, y Ω can be written as A(x, y u x + B(x, y u xy + C(x, y u u u + D(x, y
Διαβάστε περισσότεραT λx. (λy. x) F λx. (λy. y) if λpca. pca
#,, - Class 32: Computability in Theory and Practice Menu Lambda Calculus Review Computability in Theory and Practice Learning to Count CS50: Computer Science University of Virginia Computer Science David
Διαβάστε περισσότεραDurbin-Levinson recursive method
Durbin-Levinson recursive method A recursive method for computing ϕ n is useful because it avoids inverting large matrices; when new data are acquired, one can update predictions, instead of starting again
Διαβάστε περισσότεραEcon Spring 2004 Instructor: Prof. Kiefer Solution to Problem set # 5. γ (0)
Cornell University Department of Economics Econ 60 - Spring 004 Instructor: Prof. Kiefer Solution to Problem set # 5. Autocorrelation function is defined as ρ h = γ h γ 0 where γ h =Cov X t,x t h =E[X
Διαβάστε περισσότεραAppendix to On the stability of a compressible axisymmetric rotating flow in a pipe. By Z. Rusak & J. H. Lee
Appendi to On the stability of a compressible aisymmetric rotating flow in a pipe By Z. Rusak & J. H. Lee Journal of Fluid Mechanics, vol. 5 4, pp. 5 4 This material has not been copy-edited or typeset
Διαβάστε περισσότερα1. Introduction and Preliminaries.
Faculty of Sciences and Mathematics, University of Niš, Serbia Available at: http://www.pmf.ni.ac.yu/filomat Filomat 22:1 (2008), 97 106 ON δ SETS IN γ SPACES V. Renuka Devi and D. Sivaraj Abstract We
Διαβάστε περισσότερα12. Radon-Nikodym Theorem
Tutorial 12: Radon-Nikodym Theorem 1 12. Radon-Nikodym Theorem In the following, (Ω, F) is an arbitrary measurable space. Definition 96 Let μ and ν be two (possibly complex) measures on (Ω, F). We say
Διαβάστε περισσότεραNotes on the Open Economy
Notes on the Open Econom Ben J. Heijdra Universit of Groningen April 24 Introduction In this note we stud the two-countr model of Table.4 in more detail. restated here for convenience. The model is Table.4.
Διαβάστε περισσότερα( y) Partial Differential Equations
Partial Dierential Equations Linear P.D.Es. contains no owers roducts o the deendent variables / an o its derivatives can occasionall be solved. Consider eamle ( ) a (sometimes written as a ) we can integrate
Διαβάστε περισσότεραInstruction Execution Times
1 C Execution Times InThisAppendix... Introduction DL330 Execution Times DL330P Execution Times DL340 Execution Times C-2 Execution Times Introduction Data Registers This appendix contains several tables
Διαβάστε περισσότεραΕγχειρίδια Μαθηµατικών και Χταποδάκι στα Κάρβουνα
[ 1 ] Πανεπιστήµιο Κύπρου Εγχειρίδια Μαθηµατικών και Χταποδάκι στα Κάρβουνα Νίκος Στυλιανόπουλος, Πανεπιστήµιο Κύπρου Λευκωσία, εκέµβριος 2009 [ 2 ] Πανεπιστήµιο Κύπρου Πόσο σηµαντική είναι η απόδειξη
Διαβάστε περισσότεραStrain gauge and rosettes
Strain gauge and rosettes Introduction A strain gauge is a device which is used to measure strain (deformation) on an object subjected to forces. Strain can be measured using various types of devices classified
Διαβάστε περισσότεραChapter 2. Ordinals, well-founded relations.
Chapter 2. Ordinals, well-founded relations. 2.1. Well-founded Relations. We start with some definitions and rapidly reach the notion of a well-ordered set. Definition. For any X and any binary relation
Διαβάστε περισσότερα