The Church-Rosser Property for -reduction in Typed -Calculi. Herman Geuvers. University of Nijmegen

Size: px
Start display at page:

Download "The Church-Rosser Property for -reduction in Typed -Calculi. Herman Geuvers. University of Nijmegen"

Transcription

1 The Church-Rosser Property for -reduction in Typed -Calculi Herman Geuvers Faculty of Mathematics and Computer Science University of Nijmegen Nijmegen, The Netherlands Abstract In this paper we investigate the Church-Rosser property (CR) for Pure Type Systems with reduction. For Pure Type Systems with only - reduction, CR on well typed terms follows immediately from CR on the so called 'pseudoterms' and subject reduction. For -reduction, CR on the set of pseudoterms is just false, as was shown by [Nederpelt 1973]. Here we prove that CR (for ) on the well-typed terms of a xed type holds, which is the maximum we can expect in view of Nederpelts counterexample. The proof is given for a large class of Pure Type systems that contains e.g. LF (for which CR for was proved by [Salvesen 1989] and [Coquand 1991]), F, F! and the Calculus of Constructions. In the proof, one key lemma (a very weak form of CR for on pseudoterms) takes a central position. It is remarkable that in the proof of this key lemma the counterexample to CR for is essentially used. 1 Introduction Simply typed lambda calculus (from now on denoted by!) and polymorphic lambda calculus are usually described by rst giving the set of types and then the derivation rules for deriving typing judgements of the form? ` M:, where is a type,? is a 'context' and M is an element of the set of so called 'pseudoterms'. For! this amounts to the following. Typ! ::= TVar j Typ!!Typ! ; where TVar denotes the set of type variables. A context is a sequence of declarations x: with 2 Typ! and x 2 var, the set of term variables. The derivation rules are. (var)? ` x : if x: 2??; x: ` M : ()? ` x::m :! (app)? ` M :!? ` N :? ` MN : For meta-theory it is convenient to introduce the set of pseudoterms of!, T! ::= var j (var:typ! :T!) j T!T!; then one can see the derivation rules as singling out the well-typed terms from the set of pseudoterms. Let's write Term! for the set of pseudoterms typable with some type in some context. Now, -reduction on T! is Church-Rosser, so with the Subject Reduction property:? ` M: & M?!?! M 0, then? ` M 0 :, we obtain that -reduction is CR on the well-typed terms: M 2 Term!, M?!?! M 0 & M?!?! M 00, then 9N 2 Term!:M 0?!?! N & M 00?!?! N. If one is interested in the combination of - and -reduction, the situation is a little bit more complicated, because we have the following counterexample to CR for -reduction on T!. (Originally due to [Nederpelt 1973].) Take M := x::(y::y)x; with 6=. Then M?! x::x and M?! x::x and both are in normal form. This problem can be overcome by noticing that the only problematic overlapping of redexes in T! is when we have a subterm x::(y::m)x (with x =2 FV(M)) and by proving that in well-typed terms, this can only happen when. For the polymorphic lambda calculus the situation is quite similar; we now have polymorphic types and polymorphic terms (with abstraction and application), but for the problematic overlapping of redexes in a term (x::(y::m)x with x =2 FV(M)), we still have that. For the higher order lambda calculus (F! ), the situation is a bit more dicult, because we have reduction inside types. Now types are also formed inside a context and there is an extra rule, stating that convertible types have the same 'inhabitants'. The syntax is the following. There are two sets of variables, var, denoting the term variables, and Var, denoting the so called constructor variables (the set of constructors will include the types.) We also distinguish two kinds of contexts, the constructor contexts, denoted by, for declaring constructor variables, and the term contexts, denoted by?, for declaring term variables. The term variables are declared to types and the constructor variables to so called kinds. 'Kind' represents the collection of kinds and 'Type' represents the kind of types. Kind is dened by Kind ::= Type j Kind!Kind. We now give the derivation rules. Let be a constructor context. 1. (Var) ` : A if :A 2

2 ; :A ` M : B 2. (1) ` :A:M : A!B 3. (app1) ` M : A!B ` N : A ` MN : B ` A : Type ` B : Type 4. (!) ` A!B : Type ; :A ` B : Type 5. () ` :A:B : Type ` A : Type ;? ok 6. (context) ;?; x:a ok ;? ok 7. (var) if x:a 2? ;? ` x : A ;?; x:a ` M : B 8. (2) ;? ` x:a:m : A!B ; :A;? ` M : B 9. (3) if =2 FV(?) ;? ` :A:M : :A:B ;? ` M : A!B ;? ` N : A 10. (app2) ;? ` MN : B ;? ` M : x:a:b ;? ` N : A 11. (app3) ;? ` MN : B[N=x] ;? ` M : A ` B : Type 12. (conv ) A = B ;? ` M : B Here constructor variables are denoted by Greek characters and term variables by Roman characters. In the rules (Var), (var) and (weak) it is always assumed that the newly declared variable is fresh, that is, it has not yet been declared in?. If one wants to look at -reduction in the system, it is of course reasonable to replace the rule (conv ) by (conv ), which is the conversion rule with A = B as side condition. This equality condition is an equality in the set of pseudoterms T, which can be dened similarly to T! for!, with extra clauses for - expressions etcetera. This equality on pseudoterms as a side condition may seem strange, because many of these pseudoterms do not have any semantical significance and it would be more intuitive to replace this side condition by an equality judgement of the form? ` A = B : Type (where this judgement means that A converts to B via a reduction/expansion path in which all expressions are well-typed.) A reason for studying the system with equality as a side condition is that meta-theory about reduction and conuence becomes easier, because one can apply well-known properties of the untyped lambda calculus without having to cope with typing conditions. We see that for studying reduction, untyped lambda calculus is not of immediate help. Nevertheless, the general CR proof given below will make use of the untyped lambda calculus. We shall come back later to the two dierent ways of introducing and using the equality in the system. Now CR on the pseudoterms T doesn't hold and if x:a:(y:b:m)x (well-typed with A; B:Type) is a - and an -redex, we only obtain (by meta-reasoning) that A = B. It looks like before proving CR for well-typed terms, we have to prove CR for types. In the system F! this is possible; types can only contain redexes in which the -abstraction arises from the (1)-rule and application from the (app1)-rule, because terms can't be subexpressions of types. So, one rst proves conuence of -reduction for types (for A and B types, if A = B, then A?!?! C and B?!?! C for some type C.) Then CR for terms follows. For systems with so called dependent types, that is types that have terms as subexpressions, like LF or the Calculus of Constructions (CC), the Church-Rosser property is very complicated: if x:a:(y:b:m)x is a well-typed term, we know A = B, but now this doesn't bring us any further because the equality may arise from an equality between terms. CR for LF was proved in [Salvesen 1989] and later by [Coquand 1991], but for more complicated systems with dependent types the question of CR was still open. Here we shall prove CR for normalizing, functional Pure Type Systems, which includes CC. (There is no proof of normalization for reduction for CC in the literature. However, the strong normalization proof for -reduction for CC in [Geuvers and Nederhof 1991] can easily be adapted to the case for -reduction.) 2 Pure Type Systems and the extension with -reduction Let's take a look at the denition of Pure Type Systems (PTSs for short) and give some of the meta theory. (See [Geuvers and Nederhof 1991], [Barendregt 199+] for more meta-theory and examples.) Denition 2.1 For S a set, A S S and R S S S, (S; A; R) is the typed lambda calculus with the following deduction rules. 1. (sort) ` s 1 : s 2 if (s 1 ; s 2 ) 2 A.? ` A : s 2. (var)?; x:a ` x : A 3. (weak)? ` A : s? ` M : C?; x:a ` M : C 4. ()? ` A : s 1?; x:a ` B : s 2? ` x:a:b : s 3 if (s 1 ; s 2 ; s 3 ) 2 R?; x:a ` M : B? ` x:a:b : s 5. ()? ` x:a:m : x:a:b

3 6. (app)? ` M : x:a:b? ` N : A? ` MN : B[N=x] 7. (conv )? ` M : A? ` B : s? ` M : B A = B In the rules (var) and (weak) it is always assumed that the newly declared variable is fresh, that is, it has not yet been declared in?. If s 2 s 3 in a triple (s 1 ; s 2 ; s 3 ) 2 R, one usually just writes (s 1 ; s 2 ) 2 R. The equality A = B is the transitive, reexive, symmetric closure of one-step--reduction, which is (x:a:m)n?! M[N=x]; compatible with application, -abstraction and - abstraction, on the set of pseudoterms T, dened by T ::= S j Var j (Var:T:T) j (Var:T:T) j TT: The notions of free variable and bound variable of an expression are the usual ones from untyped lambda calculus ( and are the binders), writing FV(M) for the set of free variables of M. We work modulo -conversion, i.e. pseudoterms that only dier in their bound variables are considered to be equal, which equality will be denoted by. (So in fact we work with -equivalence classes of pseudoterms or representants of such classes. For practical reasons we shall only work with representants of -equivalence classes in which all bound variables are pairwise distinct and dierent from the free variables. (The variable convention)) The? in the judgement? ` M : A is, as usual, called a context. For? = x 1 :A 1 ; : : :x n :A n, FV(?) denotes the set FV(A 1 ; : : :A n ). We say that M is of type A in? if? ` M : A is a conclusion of a deduction tree which uses only the rules stated above. A well-typed term is a pseudoterm A for which? ` A : B or? ` B : A for some? and B. Term denotes the set of well-typed terms in a PTS, and Term(?; A) denotes the well-typed terms of type A in?. A PTS is normalizing, if every well-typed term in it reduces to a normal form. The collection of PTSs contains well-known type systems like simply typed lambda calculus,!, ((ftype; Kindg; ftype:kindg; f(type; Type)g), Girards systems F (! extended with the rule (Kind; Type)) and F! (F extended with (Kind; Kind)) and the Calculus of Constructions (F! with the rule (Type; Kind)). (It requires some meta-theory to see that this version of F! is the same as the one introduced before.) The inconsistent type system, where 'Type' is a type is also a PTS ((ftypeg; ftype:typeg; f(type; Type)g) and the notion of PTS also captures logical systems like rst, second order and higher order predicate logic, as shown by [Berardi 1988]. (See also [Barendregt 199+].) In this paper we want to study the extension with -equality. First we give some motivations why this extension is interesting and why the Church-Rosser property of the combined -reduction is important. (This will hardly need any explanation.) Then we want to show what are the problems that arise when trying to prove CR for. Section 2 gives an outline of the proof. 2.1 Properties of Pure Type Systems Here we give some of the meta-theory for PTSs, mainly those theorems that will be encountered later in the Church-Rosser proof. For detailed proofs we refer to [Geuvers and Nederhof 1991] or [Barendregt 199+]. In the following, unless noted otherwise, we work in an arbitrary PTS. Proposition 2.2 (CR ) The reduction relation?!?! is Church-Rosser on T. (That is, if M?!?! M 1 and M?!?! M 2 then M 1?!?! N and M 2?!?! N for some N 2 T. (The proof follows precisely the Church-Rosser proof of -reduction on the untyped lambda terms in [Barendregt 1984].) Corollary 2.3 (Conuence of on T, CON ) If M = M 0 then M?!?! N and M 0?!?! N for some N 2 T. We shall write M # M 0 for 9N 2 T:M?!?! N & M 0?!?! N. From the form of the derivation rules we can conclude the following. Lemma 2.4 (Stripping) 1.? ` x:a:m : C )?; x:a ` M : B;? ` x:a:b : s for some B and some s 2 S such that x:a:b = C. 2.? ` MN : C )? ` M : x:a:b;? ` N : A for some A and B such that B[N=x] = C. Proposition 2.5 (Subject Reduction for, SR ) If? ` M : A and M?!?! M 0 then? ` M 0 : A. The proof of the proposition is by induction on the derivation, proving the statement simultaneously for a one step reduction in? or M. It uses Stripping (2.4) and the fact that x:a:b = x:c:d implies A = C and B = D, which holds by CON on T. We don't have in the (conv ) rule, but we do have subject reduction for. Proposition 2.6 (Subject Reduction for, SR ) If? ` M : A and M?!?! M 0 then? ` M 0 : A. The proof of this proposition is, just as for SR, by induction on the derivation, proving the statement simultaneously for a one step reduction in? or in M. In the proof one needs strengthening: Proposition 2.7 (Strengthening) If? 1 ; x:a;? 2 ` M : B with x =2 FV(? 2 ; M; B), then? 1 ;? 2 ` M : B.

4 The proof is in [van Benthem Jutting 199+]. In [Geuvers and Nederhof 1991] a proof is given for a subcollection of PTSs, the so called functional ones: A PTS is functional if the relation A is a function from S to S and the relation R is a function from S S to S. (That is, if s : s 0, s : s 00 2 A, then s 0 s 00 and if (s 1 ; s 2 ; s 3 ); (s 1 ; s 2 ; s 0 3) 2 R then s 3 s 0 3.) Both proofs use CR on T. Proposition 2.8 (Uniqueness of types, UT) In a functional PTS: If? ` M : A,? ` M : A 0, then A = A 0. The proof is by induction on the derivation. It uses CON in the sense that one needs x:a:b = x:c:d ) B = D to hold. (The proposition is false for non-functional PTSs.) 2.2 The extension with Extending the PTSs with means just replacing the conversion rule by (conv )? ` M : A? ` B : s A = B? ` M : B To distinguish the two, we write PTS for the ones with (conv ) as conversion rule and PTS for the ones with (conv ). There are many reasons for studying this extension. For one thing, the stronger -equality is quite natural, especially if we think about a PTS as representing a logic. The need for -equality also becomes apparent when we look at type systems that are used as frameworks, like LF. The completeness of the interpretation of a formal system in a signature relies on dening a mapping back, from terms in the signature to terms of the formal system, which is dened on (representants of) -equivalence classes. (See [Harper et al. 1987].) A nice consequence of CR is that the unication algorithms for the Calculus of Constructions, as discussed in [Pfenning 1991] are complete. A semantical reason for strengthening the equality is that in almost all models of type systems the rule is valid. Further CR is essential if we relate the syntax of PTSs to the semantics: The systems that are really interpreted in e.g. [Streicher 1989] and [Jacobs 1991] are not the ones as formulated above (with equality on the pseudoterms as a side condition), but with an equality judgement inside the context. If is a PTS, write = for the associated 'semantical' version of the system (with equality judgement), replacing ` by `=. The conversion rule of = is (conv 0 )? `= M : A? `= A = B : s? `= M : B where the judgement? `= A = B : s is generated by ()? `= x:a:m : x:c:d? `= N : C? `= (x:a:m)n = M[N=x] : D[N=x] ()?; x:a `= Mx : B? `= x:a:b : s if? `= x:a:mx = M : x:a:b x =2 FV(M) taking the transitive, reexive, symmetric closure, made compatible with application, - and - abstraction. In this version of the system the conversion rule can only be applied to two equal types if they are equal via a path through the well-typed terms. In the original PTS version one only claims that the types are equal as pseudoterms. If we have only -conversion (i.e. in = we don't have ()), the two versions are equivalent: If M; M 0 2 Term with M = M 0, then there is a path between them through Term (by CR on T and SR ). This is expressed by the following theorem for any PTS. Theorem 2.9? ` M : A? ` M 0 : A M = M ) ()? `= M = M 0 : A: In fact, this theorem also states that the system with equality on the pseudoterms is a 'sound' system: there would really be something wrong if? ` M; M 0 : A and M = M as pseudoterms without there being a path from M to M 0 through Term(?; A). If we extend both versions of PTSs with, we need some form of Church-Rosser to prove the equivalence of the two versions. It suces to have that if M and M 0 are of the same type in some context? and M = M 0, then M # M 0. This is precisely what will be proved, for normalizing functional PTSs. As consequences we nd that and = are equivalent (for functional and normalizing) and that CR and CON hold for =. (It is not clear how a proof of CR for = could be essentially simpler then via the proof for.) 2.3 Problems with proving CR As already remarked, the main problem with proving CR is that on the pseudoterms T it is just false. The counterexample (x:a:(y:b:y)x with A 6= B) implies that also CON on T (see 2.3) is not true, even if we restrict ourselves to well-typed terms. For the meta-theory for PTSs with this has some serious consequences. UT is not immediate anymore for functional PTSs, with = replaced by =. (One needs that x:a:b = x:c:d ) B = D.) For SR and SR the situation is also problematic: The rst requires x:a:b = x:c:d ) A = C & B = D. The second requires strengthening, the proof of which uses Church-Rosser. Our solution to this will be to prove a very weak form of Church-Rosser for reduction on T (using the counterexample to CR (!)), which will turn out to be sucient to get UT and SR. Also this key lemma will be sucient to prove strengthening (and so SR ) for functional, normalizing PTSs. Using all this, we shall prove (for functional, normalizing PTSs)? ` M; M 0 : A; M = M 0 ) nf(m) nf(m 0 )

5 Where we write nf(m) for the normal form obtained by some normalization procedure. We have as an immediate corollary CON for Term(?; A). 3 The proof of CR for functional, normalizing pure type systems In the proof of Church-Rosser we shall relate the -reduction on typed terms to the reductions on untyped lambda terms. Properties of reduction on the untyped terms will be used to obtain results about reduction in T. We therefore dene an erasure mapping from T to and give some properties for it. Then we give some properties of -reduction and equality on T, which will enable us to prove SR and SR. The counterexample of [Nederpelt 1973] shows that, if one tries to prove CR, there is a problem in the types of the -abstracted variables. We shall call these types domains: A subterm A of M is a domain if it occurs as x:a in M. (So we are not concerned with -abstractions.) The erasure map removes all domains. Denition 3.1 The map j j : T! is dened with induction on the structure of pseudoterms as follows. jxj := x; jsj := s; jx:a:m j := x:jm j; jx:a:bj := x:jaj:jbj; jmnj := jmjjnj: Here, is extended with the extra variable binder and constants s for each s 2 S. If one views x:jaj:jbj just as GjAj(x:jBj), with G some xed constant, it's easy to see that all the facts (like CR ) about -reduction in hold for. It is easy to see that if for M; M 0 2 T, jmj jm 0 j, then M and M 0 have the same 'structure' apart from the domains that may be very dierent. If jmj jm 0 j and the respective domains in M and M 0 are all equal, we say that M and M 0 are domain-equal, notation M d M 0. We have the following proposition, relating reduction in T to reduction in. Proposition 3.2 Let M and M 0 be in T. M?! M 0 ) jmj?! jm 0 j _ jmj jm 0 j; and similar for?! and so for =. jmj?!?! jm 0 j ) 9N[M?!?! N & jnj jm 0 j]: (This doesn't hold for?!?!.) Proof The rst is trivial: If the redex is erased by j j, then jmj jm 0 j and otherwise the same redex can still be done in, so jmj?! jm 0 j. The second is almost trivial; we are done if we give the proof for a one-step -reduction. As j j only erases domains, a - redex in jmj is also a -redex in M, and by evaluating it we nd N 2 T with M?! N and N M 0. This is not valid for, as is shown by the counterexample M x::y(z:p x:z)x. (This term can even be welltyped in e.g. the Calculus of Constructions: Take P x::, y:(!)!!. In Lemma 3.14 we shall see that nevertheless, if M is well-typed in the Calculus of Constructions and jmj is in -nf, then M is in -nf.) 2 The following is an immediate corollary of the counterexample to CR on T. Lemma 3.3 (Domain Lemma) If C[x:A:M] and B are in T (i.e. C is a pseudoterm with subterm x:a:m ), then Proof C[x:A:M] C[x:A:M] = C[x:B:M] C[y:B:(x:A:M)y] C[x:B:M] where y is any variable not occurring free in A or M. 2 Lemma 3.4 (Key Lemma) Let c be a variable or a sort. 1. cp 1 : : :P n = Q ) Q?!?! ~y: ~A:cQ 1 : : :Q n ~y, with Q i = P i (1 i n). 2. x:p 1 :P 2 = Q ) Q?!?! ~y: ~ A:(x:Q 1 :Q 2 )~y, with P i = Q i (i = 1; 2): Proof We only proof the rst case, since the second is totally similar. Some notation: For D 2 T and M 2 T, M D 2 T is the pseudoterm obtained by replacing all domains in M by D. For D 2 T and t 2, t +D 2 T is the pseudoterm obtained by adding D as domain to every abstraction in t. (So e.g. x:x is replaced by x:d:x.) For reasons of readibility we adapt here the convention to use capitals for pseudoterms and small characters for elements of. Let cp 1 : : :P n and Q be as in the rst case of the lemma. By CR on we nd t 1 ; : : :; t n 2 with cjp 1 j : : :jp n j?!?! ct 1 : : : t n and jqj?!?! ct 1 : : : t n. Using postponement of -reduction, we nd that jqj?!?! ~y:cq 1 : : :q n ~y?!?! ct 1 : : :t n. (Doing as many -reductions as possible, i.e. we -reduce all the -redexes that are also -redexes.) By 3.2 we nd a term ~y: ~A:cQ 1 : : : Q n ~y with Q?!?! ~y: ~A:cQ 1 : : : Q n ~y and j~y: A:cQ ~ 1 : : :Q n ~yj ~y:cq 1 : : :q n ~y. The situation is as follows. cp 1 : : : P n cjp 1 j : : :jp n j jqj ct 1 : : : t n ~y:cq 1 : : : q n ~y Q ~y: ~A:cQ 1 : : : Q n ~y

6 Take for D some closed pseudoterm (or fresh variable), then ~y: ~D:cQ D 1 : : :Q D n ~y?!?! ct +D 1 : : :t +D n and cp D 1 : : : Pn D?!?! ct +D 1 : : :t +D n. Using Lemma 3.3 we obtain (for 1 i n), P i = P D i Q D i = Q i t +D i so Q i = P i (1 i n) and we are done. 2 Using the Key Lemma we get the following important properties. Proposition 3.5 (UT for functional PTSs) In a functional PTS we have? ` M : A&? ` M : A 0 ) A = A 0. Theorem 3.6 (SR ) For a PTS, j= SR. The proofs of the proposition and the theorem are straightforward by redoing the proofs for PTS in [Geuvers and Nederhof 1991], using the Key Lemma. As corollaries of SR and the Key Lemma we nd: If? ` Q; x:p 1 :P 2 : s (s 2 S) with Q = x:p 1 :P 2, then Q?!?! x:q 1 :Q 2 with P i = Q i and similar for xp 1 : : : P n. Further, if? ` M : Q with Q = s (s 2 S), then Q?!?! s. (These are proved using the fact that a type is not a -abstraction.) We shall now turn to the proof of SR for functional, normalizing systems. Again the Key Lemma is used and, as said, we also need some form of strengthening to prove SR. First we state another lemma, which is required for strengthening. Lemma 3.7 In a functional normalizing PTS : )? ` D : s? ` D 0 : s 0 ) s s 0 : D = D 0 There are essentially two ways to prove this lemma: It can be proved directly (it requires some sublemmas), but also by rst adding strengthening as a rule to the system, that is we have an extra derivation rule (streng)? 1; x:a;? 2 ` M : B? 1 ;? 2 ` M : B if x =2 FV(? 2; M; B). In the second case one has to redo the proof for SR (straightforward) and prove SR (using the rule (streng)). Then the proof of CR and CON can be done in the same way as will be done here (in ) From CON one then proves that Lemma 3.7 holds in the system without the (streng) rule and so CR and CON hold in the system without (streng). The direct proof involves some sublemmas. We give them here without a detailed proof. Sublemma 3.8?; x:d ` M : C;? ` D 0 : s (s 2 S); D = D 0 then?; x:d 0 ` M : C Sublemma 3.9? ` B : s;? ` B 0 : s 0 ; B = B 0 ; B in nf then s s 0. The proof of the rst is by changing everywhere in the derivation tree of?; x:d ` M : C the declaration x : D into x : D 0 : We introduce x as x : D 0 (with the rule (var) or (weak)) and if x is introduced with the (var) rule, we immediately apply (conv ) to conclude?; x:d 0 ` x : D. The proof of the second is by induction on B, using the rst sublemma and the Key Lemma. Now Lemma 3.7 easily follows. Using 3.7 we can prove a weak form of strengthening for functional normalizing PTS, which is sucient to prove SR and which also implies strengthening itself. The proof uses also the Key Lemma and it's corollaries. Lemma 3.10 In a functional, normalizing PTS :? 1 ; x:a;? 2 ` M : B x =2 FV(? 2 ; M) )? 1;? 2 ` M : B 0 for some B 0 = B: Proposition 3.11 (SR ) For a functional, normalizing PTS, j= SR. Proof The proof is by proving simultaneously the case for a one step reduction in the context or in the subject. The only interesting case is when? ` x:a:mx : C with x =2 FV(M) and we have to prove? ` M : C. By the Stripping Lemma (2.4), we nd a term B with x:a:b = C and?; x:a ` Mx : B. Again with Stripping Lemma we nd a term y:d:e with?; x:a ` M : x:d:e, E[x=y] = B and D = A. By Lemma 3.10 we nd that?; x:a ` M : F with F = y:d:e = x:a:b = C. Applying (conv ) we conclude?; x:a ` M : C. 2 The next lemmas will establish the proof of CON on Term(?; A) for functional normalizing Pure Type Systems. So suppose we work in such a PTS. Lemma 3.12? ` M:A? ` M 0 :A 0 A = A 0 jmj jm 0 j M; M 0 in -nf 9 >= >; ) M d M 0 (For the denition of d, see the remarks after Denition 3.1.) Proof M and M 0 have the same structure (apart from the domains), say M = x 1 :A 1 : : : x n :A n :N and M 0 = x 1 :A 0 1 : : :x n :A 0 n:n 0, with N and N 0 not abstractions. From the type of M and M 0 we conclude that A i = A 0 i. Now compare from left to right all domains in N and N 0. Say B occurs as zr 1 : : :R q (y 1 :E 1 : : :y p :E p :x:b:p ) in N and B 0 occurs as zr 0 1 : : : R 0 q(y 1 :E 0 1 : : :y p :Ep:x:B 0 0 :P 0 ) in N 0 and for all domains to the left of B (respectively B 0 ) we are already done. (This implies that

7 R i = R 0 i for all i and E i = E 0 i for all i.) We look at the types of z; zr 1 ; : : :; zr 1 : : : R q in the derivation tree and compare them with the types of z; zr 0 1; : : :; zr 0 1 : : :R 0 q in the other derivation tree. Notice that they are pairwise -equal. This implies that the types of y 1 :E 1 : : :y p :E p :x:b:p and y 1 :E 0 1 : : :y p :Ep:x:B 0 0 P 0 are -equal, so B = B 0. 2 Lemma 3.13? ` A:s A in -nf A = C x =2 FV(C;?) 9 >= ) x =2 FV(A): >; Proof The proof is by induction on the structure of A. For A a variable or a sort it's trivial. For A x:a 1 :A 2, we are done by induction hypothesis. Suppose now A is an application term and x 2 FV(A). Then x is only free in domains of A. (Note that jcj = jaj?!?! nf(jaj), and in untyped lambda calculus -reductions do not remove any free variables, so x =2 FV(jAj).) Say B is the leftmost domain of A in which x occurs free, say in the subterm zr 1 : : : R q (y 1 :E 1 : : : y p :E p :y:b:p ). Then there is a type for z in which x is not free (z is declared in the context or left to B), so there is a type for zr 1 : : :R q in which x is not free, so B = E, for some E in which x is not free. Now by induction hypothesis, x =2 F V (B). 2 Lemma 3.14 For M 2 Term, if M in -nf, then jmj in -nf. Proof Suppose jm j is not in -nf. Then there is an -redex in jm j, which is not an -redex in M, say x:jn jx is the rst such. Then x 2 FV(N), but x =2 FV(jN j), so x is only free in domains of N. Say B is the leftmost domain in which x is free, and say B occurs in the subterm zr 1 : : : R q (y 1 :E 1 : : : y p :E p :y:b:p ). The type of z does not have x as a free variable in it. (If z is abstracted in the context or left from the abstraction over x, then not by variable convention and if z is abstracted right from x, then not by the assumption that B is the leftmost domain containing x.) With an argument similar to that in the proof of 3.13, there is a type B 0 with B = B 0, and x =2 FV(B 0 ). By 3.13: x =2 FV(B). 2 Lemma 3.15 (CON for types) Let s; s 0 2 S.? ` A:s? ` B:s 0 A = B A; B in -nf 9 >= >; ) A B: Proof By induction on the structure of A, using the Key Lemma, 3.12 and If A x:a 1 :A 2, then B = x:b 1 :B 2 with A 1 = B 1 and A 2 = B 2 (by Key Lemma). By induction hypothesis A 1 B 1 and A 2 B 2. If A xp 1 : : :P n, then B = xq 1 : : :Q n with P i = Q i (by Key Lemma.) Now, the types of xp 1 : : :P i and xq 1 : : :Q i in the derivations of? ` A:s resp? ` B:s 0 are pairwise -equal. Further, all P i and Q i are in -nf, so, by 3.14, all jp i j and jq i j are, so jp i j jq i j for all i. We can apply 3.12 to conclude that P i d Q i for all i and so A d B (all respective domains in A and B are -equal.) By induction hypothesis (comparing the respective domains in A and B from left to right) we conclude that A B. 2 Theorem 3.16 (CON ) )? ` M:A? ` M 0 :A ) M # M = M 0 M 0 : Proof Dene N := nf(m); N 0 := nf(m 0 ). We prove N N 0 and we are done. By SR and SR we nd? ` N:A and? ` N 0 :A. By 3.14, jnj and jn 0 j are in normal form, so jnj jn 0 j. By 3.12, N d N 0 : All respective domains in N and N 0 are -equal. By CON for types (3.15), all respective domains in N and N 0 are syntactically equal (), so N N Discussion We have proved CON for terms in a xed context of a xed type, but only for functional normalizing PTS. This immediately implies CR on Term. We have also seen that conuence for well-typed terms of dierent types doesn't hold. (And the same for welltyped terms in dierent contexts; take? and? 0 such that? ` x(y : A:y) : Type and? 0 ` x(y : B:y) : Type.) We think that, using the work of [van Benthem Jutting 199+], who gives an analysis of typing in PTSs, these results can be extended to arbitrary normalizing type systems. The most interesting extension, however, seems to be the one to non-normalizing type systems, like. First because the proof given here relies very heavily on the normalization, which makes the CR theorem a higher order property, where we believe it is essentially combinatoric. Second, because from CON on Term(?; A) in (with (conv )) we hope to get CON on Term(?; A) for an arbitrary PTS, by imitating the reduction steps in in the other PTS, using the terminality of in the category PTS. This would also require SR for an arbitrary PTS. (Here we only have a proof of SR for normalizing systems.) Because of the restriction to normalizing systems, we need to prove normalization of -reduction without using the Church-Rosser property. This may look problematic but in practice it isn't. For example for the Calculus of Constructions, the strong normalization proof in [Geuvers and Nederhof 1991] for the system with (conv ) can be adapted to a proof of strong normalization for the system with (conv ). In that

8 paper a reduction preserving map from Term(CC) to Term(F!) is dened. This mapping can easily be extended to CC with (conv ) such that also - reductions are preserved and all the required properties of the mapping stil hold (using the Key Lemma.) We conjecture here the general theorem that, if a PTS is (strongly) normalizing, then the PTS is. If we look at the Church-Rosser property from a point of view as to how to compute the common reduct, we see that the situation is really a bit more complicated then for untyped lambda calculus. In untyped lambda calculus, if M?!?! M 1 and M?!?! M 2, a common reduct of M 1 and M 2 can be found using complete developments. (See [Barendregt 1984].) Here one has to do something more, namely reducing the domains: Consider e.g. M := x:a:(y:b:y)x, M 1 := x:a:x and M 2 := y:b:y. There are no residuals of the -redex in M 2, nor are there any residuals of the -redex in M 1, so we have a complete development of the set containing both redexes, but M 1 6 M 2. (They would have been in the untyped case.) We still have to unify A and B. Acknowledgements We would like to thank Anne Salvesen for pointing out some mistakes in an earlier version of this paper. References [Barendregt 1984] H.P. Barendregt, The lambda calculus: its syntax and semantics, revised edition. Studies in Logic and the Foundations of Mathematics, North Holland. [Harper et al. 1987] R. Harper, F. Honsell and G. Plotkin, A framework for dening logics. Proceedings Second Symposium on Logic in Computer Science, (Ithaca, N.Y.), IEEE, Washington DC, pp [Jacobs 1991] B.P.F. Jacobs, Categorical type theory. Ph.D. thesis, University of Nijmegen, The Netherlands. [Nederpelt 1973] R.P. Nederpelt, Strong normalization in a typed lambda calculus with lambda structured types. Ph.D. thesis, Eindhoven Technological University, The Netherlands. [Pfenning 1991] F. Pfenning, Unication and antiunication in the Calculus of Constructions. Proceedings Sixth Symposium on Logic in Computer Science, (Amsterdam, the Netherlands), IEEE, Washington DC, pp [Salvesen 1989] A. Salvesen, The Church-Rosser Theorem for LF with reduction. Notes of a talk presented at the BRA-Logical Frameworks meeting, Antibes [Streicher 1989] Th. Streicher, Correctness and completeness of a categorical semantics of the Calculus of Constructions. Ph. D. thesis, University of Passau, Germany. [Barendregt 199+] H.P. Barendregt, Typed lambda calculi. In Abramski et al. (eds.), Handbook of Logic in Computer Science, Oxford Univ. Press, to appear. [van Benthem Jutting 199+] L.S. van Benthem Jutting, Typing in Pure Type Systems. To appear in Information and Computation. [Berardi 1988] S. Berardi, Towards a mathematical analysis of the Coquand-Huet calculus of constructions and the other systems in Barendregts cube. Dept. Computer Science, Carnegie-Mellon University and Dipartimento Matematica, Universita di Torino, Italy. [Coquand 1991] Th. Coquand, An algorithm for testing conversion in type theory. In Huet and Plotkin (eds.), Logical Frameworks, Cambridge Univ. Press. [van Daalen 1980] D.T. van Daalen, The language theory of AUTOMATH. Ph.D. thesis, Eindhoven Technological University, The Netherlands. [Geuvers and Nederhof 1991] J.H. Geuvers and M.J. Nederhof, A modular proof of strong normalization for the calculus of constructions. Journal of Functional Programming, vol 1 (2), pp

On Equivalence and Canonical Forms in the LF Type Theory (Extended Abstract) Robert Harper and Frank Pfenning Department of Computer Science Carnegie

On Equivalence and Canonical Forms in the LF Type Theory (Extended Abstract) Robert Harper and Frank Pfenning Department of Computer Science Carnegie On Equivalence and Canonical Forms in the LF Type Theory (Extended Abstract) Robert Harper and Frank Pfenning Department of Computer Science Carnegie Mellon University August 30, 1999 Abstract Decidability

More information

Abstract In usual type theory, if a function f is of type! 0 and an argument a is of type, then the type of fa is immediately given to be 0 and no men

Abstract In usual type theory, if a function f is of type! 0 and an argument a is of type, then the type of fa is immediately given to be 0 and no men Canonical typing and -conversion Fairouz Kamareddine y Department of Computing Science 17 Lilybank Gardens University of Glasgow Glasgow G1 8QQ, Scotland email: fairouz@dcs.glasgow.ac.uk and Rob Nederpelt

More information

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 Introduction to Type Theory February 2008 Alpha Lernet Summer School Piriapolis, Uruguay Herman Geuvers Nijmegen & Eindhoven, NL Lecture 5: Higher Order Logic and the Calculus of Constructions 1 Church

More information

2 G. Barthe and M.H. S rensen second-order typed -calculus la Church, which was invented independently by Girard (1970) and Reynolds (1974). An exampl

2 G. Barthe and M.H. S rensen second-order typed -calculus la Church, which was invented independently by Girard (1970) and Reynolds (1974). An exampl J. Functional Programming 1 (1): 1000, January 1993 c 1993 Cambridge University Press 1 Domain-Free Pure Type Systems Gilles Barthe INRIA Sophia-Antipolis 2004 Route des Lucioles, BP 93, 06902 Sophia-Antipolis

More information

Justifying Algorithms for βη-conversion

Justifying Algorithms for βη-conversion Justifying Algorithms for βη-conversion Healfdene Goguen AT&T Labs, 180 Park Ave., Florham Park NJ 07932 USA hhg@att.com. Abstract. Deciding the typing judgement of type theories with dependent types such

More information

Lazy Strong Normalization

Lazy Strong Normalization Lazy Strong Normalization Luca Paolini 1,2 Dipartimento di Informatica Università di Torino (ITALIA) Elaine Pimentel 1,2 Departamento de Matemática Universidade Federal de Minas Gerais (BRASIL) Dipartimento

More information

Computer Science at Kent

Computer Science at Kent Computer Science at Kent New eta-reduction and Church-Rosser Yong Luo Technical Report No. 7-05 October 2005 Copyright c 2005 University of Kent Published by the Computing Laboratory, University of Kent,

More information

EXTENDED ABSTRACT. 2;4 fax: , 3;5 fax: Abstract

EXTENDED ABSTRACT. 2;4 fax: , 3;5 fax: Abstract 1 Syntactic denitions of undened: EXTENDED ABSTRACT on dening the undened Zena Ariola 1, Richard Kennaway 2, Jan Willem Klop 3, Ronan Sleep 4 and Fer-Jan de Vries 5 1 Computer and Information Science Department,

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

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

Programming Languages and Types

Programming Languages and Types Programming Languages and Types Klaus Ostermann based on slides by Benjamin C. Pierce Subtyping Motivation With our usual typing rule for applications the term is not well typed. ` t 1 : T 11!T 12 ` t

More information

Some Recent Logical Frameworks

Some Recent Logical Frameworks Some Recent Logical Frameworks Randy Pollack LFCS, University of Edinburgh Version of September 13, 2010 Outline Edinburgh Logical Framework (ELF) (LICS 1987) Reminder by Example Some Problems with ELF

More information

Modularity of Confluence: A Simplified Proof

Modularity of Confluence: A Simplified Proof 1 Modularity of Confluence: A Simplified Proof Jan Willem Klop 1,2,5,6 Aart Middeldorp 3,5 Yoshihito Toyama 4,7 Roel de Vrijer 2 1 Department of Software Technology CWI, Kruislaan 413, 1098 SJ Amsterdam

More information

Candidates for Substitution

Candidates for Substitution Candidates for Substitution Healfdene Goguen hhg@dcs.ed.ac.uk James McKinna jhm@dcs.ed.ac.uk Laboratory for Foundations of Computer Science Department of Computer Science The King s Buildings, University

More information

Sequent Combinators: A Hilbert System for the Lambda Calculus

Sequent Combinators: A Hilbert System for the Lambda Calculus Sequent Combinators: A Hilbert System for the Lambda Calculus Healfdene Goguen Department of Computer Science, University of Edinburgh The King s Buildings, Edinburgh, EH9 3JZ, United Kingdom Fax: (+44)

More information

Pure Type System conversion is always typable

Pure Type System conversion is always typable Pure Type System conversion is always typable Vincent Siles, Hugo Herbelin To cite this version: Vincent Siles, Hugo Herbelin. Pure Type System conversion is always typable. Journal of Functional Programming,

More information

Bridging Curry and Church s typing style

Bridging Curry and Church s typing style Bridging Curry and Church s typing style Fairouz Kamareddine a,, Jonathan P. Seldin b,, J.B. Wells a a School of Maths and Computer Sc., Heriot-Watt Univ., Edinburgh, UK b Maths and Computer Sc., Univ.

More information

Rewriting for Fitch style natural deductions

Rewriting for Fitch style natural deductions Rewriting for Fitch style natural deductions Herman Geuvers, Rob Nederpelt Nijmegen University, The Netherlands Eindhoven University of Technology, The Netherlands bstract Logical systems in natural deduction

More information

Γ is usually left implicit: ϕ

Γ is usually left implicit: ϕ Types Summer School Gothenburg Sweden August 2005 Type Systems Herman Geuvers Radboud University Nijmegen, NL Lecture 2: Higher Order Logic and Type Theory The original motivation of Church to introduce

More information

Mechanizing Metatheory in a Logical Framework

Mechanizing Metatheory in a Logical Framework Under consideration for publication in J. Functional Programming 1 Mechanizing Metatheory in a Logical Framework Robert Harper and Daniel R. Licata Carnegie Mellon University (e-mail: {rwh,drl}@cs.cmu.edu)

More information

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

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms Alonzo Church (1903-1995) Lambda Calculus 2 λ-calculus : syntax Grammar for terms : t, u ::= x (variable) t u (application) λx.t (abstraction) Notation : Application is left-associative so that t 1 t 2...

More information

Equality is typable in Semi-Full Pure Type Systems

Equality is typable in Semi-Full Pure Type Systems Equality is typable in Semi-Full Pure Type Systems Vincent Siles, Hugo Herbelin To cite this version: Vincent Siles, Hugo Herbelin. Equality is typable in Semi-Full Pure Type Systems. Logic In Computer

More information

The Call-by-Need Lambda Calculus

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

More information

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

Dependent Types and Explicit Substitutions

Dependent Types and Explicit Substitutions NASA/CR-1999-209722 ICASE Report No. 99-43 Dependent Types and Explicit Substitutions César Muñoz ICASE, Hampton, Virginia Institute for Computer Applications in Science and Engineering NASA Langley Research

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

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

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012 1 λ Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky Radboud University Nijmegen March 5, 2012 2 reading Femke van Raamsdonk Logical Verification Course Notes Herman Geuvers Introduction to

More information

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

een wetenschappelijke proeve op het gebied van de

een wetenschappelijke proeve op het gebied van de Logics and Type Systems een wetenschappelijke proeve op het gebied van de wiskunde en informatica proefschrift ter verkrijging van de graad van doctor aan de Katholieke Universiteit Nijmegen, volgens besluit

More information

Strong Normalization with Singleton Types

Strong Normalization with Singleton Types Electronic Notes in Theoretical Computer Science 70 No 1 (2002) URL: http://wwwelseviernl/locate/entcs/volume70html 19 pages Strong Normalization with Singleton Types Judicaël Courant 1 LRI, CNRS UMR 8623

More information

A Linearization of the Lambda-Calculus and Consequences

A Linearization of the Lambda-Calculus and Consequences Boston University OpenBU Computer Science http://open.bu.edu CAS: Computer Science: Technical Reports 1996-08-19 A Linearization of the Lambda-Calculus and Consequences Kfoury, A.J. Boston University Computer

More information

A BRIEF INTRODUCTION TO TYPED PREDICATE LOGIC

A BRIEF INTRODUCTION TO TYPED PREDICATE LOGIC A BRIEF INTRODUCTION TO TYPED PREDICATE LOGIC Raymond Turner December 6, 2010 Abstract Typed Predicate Logic 1 was developed to o er a unifying framework for many of the current logical systems, and especially

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

Every formula evaluates to either \true" or \false." To say that the value of (x = y) is true is to say that the value of the term x is the same as th

Every formula evaluates to either \true or \false. To say that the value of (x = y) is true is to say that the value of the term x is the same as th A Quick and Dirty Sketch of a Toy Logic J Strother Moore January 9, 2001 Abstract For the purposes of this paper, a \logic" consists of a syntax, a set of axioms and some rules of inference. We dene a

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

Supplementary Notes on Inductive Definitions

Supplementary Notes on Inductive Definitions Supplementary Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 29, 2002 These supplementary notes review the notion of an inductive definition

More information

Explicit Convertibility Proofs in PTSs

Explicit Convertibility Proofs in PTSs Explicit Convertibility Proofs in Pure Type Systems Floris van Doorn 1 Herman Geuvers 2 Freek Wiedijk 2 1 Carnegie Mellon University 2 Radboud University Nijmegen LFMTP 2013 Pure Type Systems (1) Pure

More information

Reducibility proofs in λ-calculi with intersection types

Reducibility proofs in λ-calculi with intersection types Reducibility proofs in λ-calculi with intersection types Fairouz Kamareddine, Vincent Rahli, and J. B. Wells ULTRA group, Heriot-Watt University, http://www.macs.hw.ac.uk/ultra/ March 14, 2008 Abstract

More information

HOAS by example What is a Formal System? A Simply Typed Framework What Does it Mean? Canonical LF References HOAS. Randy Pollack

HOAS by example What is a Formal System? A Simply Typed Framework What Does it Mean? Canonical LF References HOAS. Randy Pollack HOAS Randy Pollack Version of November 2, 2011 Outline 1 HOAS by example 2 What is a Formal System? 3 A Simply Typed Framework 4 What Does it Mean? 5 Canonical LF Judgement Forms and Rules Hereditary Substitution

More information

Clausal Presentation of Theories in Deduction Modulo

Clausal Presentation of Theories in Deduction Modulo Gao JH. Clausal presentation of theories in deduction modulo. JOURNAL OF COMPUTER SCIENCE AND TECHNOL- OGY 28(6): 1085 1096 Nov. 2013. DOI 10.1007/s11390-013-1399-0 Clausal Presentation of Theories in

More information

On the Standardization Theorem for λβη-calculus

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

More information

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

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

Investigation of Prawitz s completeness conjecture in phase semantic framework

Investigation of Prawitz s completeness conjecture in phase semantic framework Investigation of Prawitz s completeness conjecture in phase semantic framework Ryo Takemura Nihon University, Japan. takemura.ryo@nihon-u.ac.jp Abstract In contrast to the usual Tarskian set-theoretic

More information

Programming Languages Fall 2013

Programming Languages Fall 2013 Programming Languages Fall 2013 Lecture 11: Subtyping Prof Liang Huang huang@qccscunyedu Big Picture Part I: Fundamentals Functional Programming and Basic Haskell Proof by Induction and Structural Induction

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

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge

Mathematical Synthesis of Equational Deduction Systems. Marcelo Fiore. Computer Laboratory University of Cambridge Mathematical Synthesis of Equational Deduction Systems Marcelo Fiore Computer Laboratory University of Cambridge TLCA 2009 3.VII.2009 Context concrete theories meta-theories Context concrete theories meta-theories

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

Introduction to λ-calculus

Introduction to λ-calculus p.1/65 Introduction to λ-calculus Ken-etsu FUJITA fujita@cs.gunma-u.ac.jp http://www.comp.cs.gunma-u.ac.jp/ fujita/ Department of Computer Science Gunma University :Church 32, 36, 40; Curry 34 1. Universal

More information

Chapter 1 A computational interpretation of forcing in Type Theory

Chapter 1 A computational interpretation of forcing in Type Theory Chapter 1 A computational interpretation of forcing in Type Theory Thierry Coquand and Guilhem Jaber Abstract In a previous work, we showed the uniform continuity of definable functionals in intuitionistic

More information

Models of Computation,

Models of Computation, Models of Computation, 2010 1 Induction We use a lot of inductive techniques in this course, both to give definitions and to prove facts about our semantics So, it s worth taking a little while to set

More information

Recursive equations in higher-order process calculi

Recursive equations in higher-order process calculi Theoretical Computer Science 266 (2001) 839 852 www.elsevier.com/locate/tcs Recursive equations in higher-order process calculi Mingsheng Ying a; ;1, Martin Wirsing b a State Key Laboratory of Intelligent

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

Mathematical Logic IV

Mathematical Logic IV 1 Introduction Mathematical Logic IV The Lambda Calculus; by H.P. Barendregt(1984) Part One: Chapters 1-5 The λ-calculus (a theory denoted λ) is a type free theory about functions as rules, rather that

More information

A polytime proof of correctness of the Rabin-Miller algorithm from Fermat s Little Theorem

A polytime proof of correctness of the Rabin-Miller algorithm from Fermat s Little Theorem A polytime proof of correctness of the Rabin-Miller algorithm from Fermat s Little Theorem Grzegorz Herman and Michael Soltys November 24, 2008 Abstract Although a deterministic polytime algorithm for

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

On Equivalence and Canonical Forms in the LF Type Theory

On Equivalence and Canonical Forms in the LF Type Theory On Equivalence and Canonical Forms in the LF Type Theory ROBERT HARPER and FRANK PFENNING Carnegie Mellon University Decidability of definitional equality and conversion of terms into canonical form play

More information

arxiv: v3 [cs.pl] 15 May 2011

arxiv: v3 [cs.pl] 15 May 2011 A Step-indexed Semantic Model of Types for the Call-by-Name Lambda Calculus arxiv:1105.1985v3 [cs.pl] 15 May 2011 Abstract Step-indexed semantic models of types were proposed as an alternative to purely

More information

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION

KRIPKE S THEORY OF TRUTH 1. INTRODUCTION KRIPKE S THEORY OF TRUTH RICHARD G HECK, JR 1. INTRODUCTION The purpose of this note is to give a simple, easily accessible proof of the existence of the minimal fixed point, and of various maximal fixed

More information

Functional Database Query Languages as. Typed Lambda Calculi of Fixed Order. Gerd G. Hillebrand and Paris C. Kanellakis

Functional Database Query Languages as. Typed Lambda Calculi of Fixed Order. Gerd G. Hillebrand and Paris C. Kanellakis Functional Database Query Languages as Typed Lambda Calculi of Fixed Order Gerd G. Hillebrand and Paris C. Kanellakis Department of Computer Science Brown University Providence, Rhode Island 02912 CS-94-26

More information

A general method to prove the normalization theorem for first and second order typed λ-calculi

A general method to prove the normalization theorem for first and second order typed λ-calculi Under consideration for publication in Math. Struct. in Comp. Science A general method to prove the normalization theorem for first and second order typed λ-calculi Venanzio Capretta and Silvio Valentini

More information

Introduction to Type Theory

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

More information

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

Krivine s Intuitionistic Proof of Classical Completeness (for countable languages)

Krivine s Intuitionistic Proof of Classical Completeness (for countable languages) Krivine s Intuitionistic Proof of Classical Completeness (for countable languages) Berardi Stefano Valentini Silvio Dip. Informatica Dip. Mat. Pura ed Applicata Univ. Torino Univ. Padova c.so Svizzera

More information

Traditional and Non Traditional lambda calculi

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

More information

The Minimal Graph Model of Lambda Calculus

The Minimal Graph Model of Lambda Calculus The Minimal Graph Model of Lambda Calculus Antonio Bucciarelli 1 and Antonino Salibra 2 1 Université Paris 7, Equipe PPS, 2 place Jussieu, 72251 Paris Cedex 05, France buccia@pps.jussieu.fr, 2 Università

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

The Dierential Lambda-Calculus

The Dierential Lambda-Calculus The Dierential Lambda-Calculus Thomas Ehrhard and Laurent Regnier Institut de Mathématiques de Luminy, C.N.R.S. U.P.R. 9016 ehrhard@iml.univ-mrs.fr and regnier@iml.univ-mrs.fr July 17, 2003 Abstract We

More information

DALI: An Untyped CBV Operational Semantics and Equational Theory. for Datatypes with Binders (Technical Development)

DALI: An Untyped CBV Operational Semantics and Equational Theory. for Datatypes with Binders (Technical Development) DALI: An Untyped CBV Operational Semantics and Equational Theory for Datatypes with Binders (Technical Development) Emir Pasalic, Tim Sheard?, Walid Taha?? Oregon Graduate Institute and Chalmers University

More information

Notes on Logical Frameworks

Notes on Logical Frameworks Notes on Logical Frameworks Robert Harper IAS November 29, 2012 1 Introduction This is a brief summary of a lecture on logical frameworks given at the IAS on November 26, 2012. See the references for technical

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

λ 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

Boolean Algebra and Propositional Logic

Boolean Algebra and Propositional Logic Boolean Algebra and Propositional Logic Takahiro Kato September 10, 2015 ABSTRACT. This article provides yet another characterization of Boolean algebras and, using this characterization, establishes a

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

1 Introduction A general problem that arises in dierent areas of computer science is the following combination problem: given two structures or theori

1 Introduction A general problem that arises in dierent areas of computer science is the following combination problem: given two structures or theori Combining Unication- and Disunication Algorithms Tractable and Intractable Instances Klaus U. Schulz CIS, University of Munich Oettingenstr. 67 80538 Munchen, Germany e-mail: schulz@cis.uni-muenchen.de

More information

2 M. Hasegawa thus strengthens the claim that Girard translation is the canonical translation from intuitionistic logic to linear logic. This seems to

2 M. Hasegawa thus strengthens the claim that Girard translation is the canonical translation from intuitionistic logic to linear logic. This seems to Under consideration for publication in J. Functional Programming 1 Girard Translation and Logical Predicates Masahito Hasegawa Research Institute for Mathematical Sciences, Kyoto University Kyoto 606-8502

More information

Open Proofs and Open Terms: a Basis for Interactive Logic

Open Proofs and Open Terms: a Basis for Interactive Logic Open Proofs and Open Terms: a asis for Interactive Logic Herman Geuvers 1 and G. I. Jojgov 2 1 University of Nijmegen, The Netherlands herman@cs.kun.nl 2 Eindhoven University of Technology, The Netherlands

More information

Parameterizations and Fixed-Point Operators on Control Categories

Parameterizations and Fixed-Point Operators on Control Categories Parameterizations and Fixed-Point Operators on Control Categories oshihiko Kakutani 1 and Masahito Hasegawa 12 1 Research Institute for Mathematical Sciences, Kyoto University {kakutani,hassei}@kurims.kyoto-u.ac.jp

More information

Böhm trees, Krivine machine and the Taylor expansion of ordinary lambda-terms

Böhm trees, Krivine machine and the Taylor expansion of ordinary lambda-terms Böhm trees, Krivine machine and the Taylor expansion of ordinary lambda-terms Thomas Ehrhard and Laurent Regnier Institut de Mathématiques de Luminy CNRS and Université de la Méditerranée UMR 6206 Thomas.Ehrhard@iml.univ-mrs.fr

More information

{ exp may be translated to exp {a named explicit -calculus{ using an extension of the continuation-passing style translation; { the CPS translation ma

{ exp may be translated to exp {a named explicit -calculus{ using an extension of the continuation-passing style translation; { the CPS translation ma Explicit substitutions for the -calculus? Gilles Barthe 1 Fairouz Kamareddine 2 Alejandro Ros 2 1 CWI, P.O. Box 94079, 1090 GB Amsterdam, the Netherlands, email gilles@cwi.nl 2 University of Glasgow, Department

More information

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF Origin

More information

A Terminating and Confluent Linear Lambda Calculus

A Terminating and Confluent Linear Lambda Calculus A Terminating and Confluent Linear Lambda Calculus Yo Ohta and Masahito Hasegawa Research Institute for Mathematical Sciences, Kyoto University Kyoto 606-8502, Japan Abstract. We present a rewriting system

More information

A Behavioural Model for Klop s Calculus

A Behavioural Model for Klop s Calculus Replace this file with prentcsmacro.sty for your meeting, or with entcsmacro.sty for your meeting. Both can be found at the ENTCS Macro Home Page. A Behavioural Model for Klop s Calculus Mariangiola Dezani-Ciancaglini

More information

FIXED POINTS AND EXTENSIONALITY IN TYPED FUNCTIONAL PROGRAMMING LANGUAGES

FIXED POINTS AND EXTENSIONALITY IN TYPED FUNCTIONAL PROGRAMMING LANGUAGES FIXED POINTS AND EXTENSIONALITY IN TYPED FUNCTIONAL PROGRAMMING LANGUAGES a dissertation submitted to the department of computer science and the committee on graduate studies of stanford university in

More information

THE A-CALCULUS IS c-incomplete

THE A-CALCULUS IS c-incomplete THE JOURNAL OF SYSTOLIc LoGIc Volume 39, Number 2, June 1974 THE A-CALCULUS IS c-incomplete G. D. PLOTKIN?1. Introduction. The w-rule in the A-calculus (or, more exactly, the AK-fg, 7 calculus) is MZ =

More information

Computability via the Lambda Calculus with Patterns

Computability via the Lambda Calculus with Patterns Computability via the Lambda Calculus with Patterns Bodin Skulkiat (Corresponding author) Department of Mathematics, Faculty of Science Chulalongkorn University, Bangkok, Thailand Tel: 66-89-666-5804 E-mail:

More information

From syntax to semantics of Dependent Type Theories - Formalized

From syntax to semantics of Dependent Type Theories - Formalized RDP 2015, Jun. 30, 2015, WCMCS, Warsaw. From syntax to semantics of Dependent Type Theories - Formalized by Vladimir Voevodsky from the Institute for Advanced Study in Princeton, NJ. I will be speaking

More information

Intersection Types and Lambda Theories

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

More information

A general method for proving the normalization theorem for first and second order typed λ-calculi

A general method for proving the normalization theorem for first and second order typed λ-calculi Math. Struct. in Comp. Science (1999), vol. 9, pp. 719 739. c 1999 Cambridge University Press Printed in the United Kingdom A general method for proving the normalization theorem for first and second order

More information

Komponenten- und Service-orientierte Softwarekonstruktion

Komponenten- und Service-orientierte Softwarekonstruktion Komponenten- und Service-orientierte Softwarekonstruktion Vorlesung 5: Combinatory Logic Synthesis Jakob Rehof LS XIV Software Engineering TU Dortmund Sommersemester 2015 SS 2015 J. Rehof (TU Dortmund)

More information

Constructive approach to relevant and affine term calculi

Constructive approach to relevant and affine term calculi Constructive approach to relevant and affine term calculi Jelena Ivetić, University of Novi Sad, Serbia Silvia Ghilezan,University of Novi Sad, Serbia Pierre Lescanne, University of Lyon, France Silvia

More information

Typing untyped λ-terms, or Reducibility strikes again!

Typing untyped λ-terms, or Reducibility strikes again! University of Pennsylvania ScholarlyCommons IRCS Technical Reports Series Institute for Research in Cognitive Science December 1995 Typing untyped λ-terms, or Reducibility strikes again! Jean H. Gallier

More information

Boolean Algebra and Propositional Logic

Boolean Algebra and Propositional Logic Boolean Algebra and Propositional Logic Takahiro Kato June 23, 2015 This article provides yet another characterization of Boolean algebras and, using this characterization, establishes a more direct connection

More information

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di Compositionality in SLD-derivations and their abstractions Marco Comini Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica Universita di Pisa Corso Italia 40 56125 Pisa Italy fcomini levi meog@di.unipi.it

More information

Intersection types and domain operators

Intersection types and domain operators Theoretical Computer Science 316 (2004) 25 47 www.elsevier.com/locate/tcs Intersection types and domain operators Fabio Alessi a, Mariangiola Dezani-Ciancaglini b;, Stefania Lusin c a Dipartimento di Matematica

More information

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

Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees Information and Computation 178, 1 11 (2002) doi:101006/inco20022907 Intersection and Singleton Type Assignment Characterizing Finite Böhm-Trees Toshihiko Kurata 1 Department of Mathematics, Tokyo Metropolitan

More information

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

The λ-calculus and Curry s Paradox Drew McDermott , revised The λ-calculus and Curry s Paradox Drew McDermott drew.mcdermott@yale.edu 2015-09-23, revised 2015-10-24 The λ-calculus was invented by Alonzo Church, building on earlier work by Gottlob Frege and Moses

More information

Typed 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

Massimo Marchiori. Abstract. One of the key results in the eld of modularity for Term

Massimo Marchiori. Abstract. One of the key results in the eld of modularity for Term Modularity of Completeness Revisited Massimo Marchiori Department of Pure and Applied Mathematics University of Padova Via Belzoni 7, 35131 Padova, Italy max@hilbert.math.unipd.it Abstract. One of the

More information

Mode checking in the Concurrent Logical Framework

Mode checking in the Concurrent Logical Framework Mode checking in the Concurrent Logical Framework Jorge Luis Sacchini Iliano Cervesato Frank Pfenning Carsten Schürmann August 2014 CMU-CS-14-134 CMU-CS-QTR-123 School of Computer Science Carnegie Mellon

More information