On Explicit Substitutions and Names (Extended ... - Semantic Scholar

Report 3 Downloads 72 Views
On Explicit Substitutions and Names (Extended Abstract) Eike Ritter and Valeria de Paiva ? School of Computer Science, University of Birmingham

Abstract. Calculi with explicit substitutions have found widespread ac-

ceptance as a basis for abstract machines for functional languages. In this paper we investigate the relations between variants with de Bruijnnumbers, with variable names, with reduction based on raw expressions and calculi with equational judgements. We show the equivalence between these variants, which is crucial in establishing the correspondence between the semantics of the calculus and its implementations.

1 Introduction Explicit substitution calculi (or -calculi for short) rst appeared in a seminal paper by Abadi et al. [1]. The basic idea is that instead of having substitutions as a meta-level operation, as in traditional -calculus, we should make them part of the object-level calculus. The advantages of this approach are twofold. Firstly, it makes it possible to design much more ecient abstract machines as we are allowed to delay substitutions, and secondly it makes it much easier to prove them correct since the calculus and its implementation are closer. There are several variants of calculi with explicit substitutions. Some of these variants are geared towards semantics [15], [3], others are derived with implementations in mind [9], [8], [2]. Rather than listing all variants, we explain in this paper what we take to be the principal di erences between them. This way we describe what appears at rst sight as various \design choices" for lambdacalculi. But we then justify why we have to develop calculi for each possible choice if we want to prove semantics and syntax equivalent. Moreover, by using the context handling of type theory as a guide, we are able to de ne a con uent calculus with explicit substitutions and names|something that Abadi et al. were not able to do.

1.1 Equations rst versus Reductions rst There are two main approaches when de ning typed -calculi with or without explicit substitutions. The rst one, in the spirit of Martin Lof's type theory [10], de nes the calculus with equations-in-context. Reduction is then a derived ? Research

supported under the EPSRC project no. GR/L28296, x-SLAM: The Explicit

Substitutions Linear Abstract Machine.

notion, obtained by orienting the equations. The second approach considers the set of typed terms as a subset of the set of raw terms, and hence reduction is de ned on raw terms, which are not necessarily well-formed. Equality is now the derived notion, namely it is the symmetric and transitive closure of the relation generated by the reduction rules. The rst approach is required when giving semantics to -calculi because only well-formed objects have a meaning. The second approach avoids the need to check for well-formedness during reduction, which is incorporated in the rst approach. As a consequence, this approach is well-suited for implementations, but a semantics for terms can only be given by showing the equivalence of this presentation to the Martin Lof-style presentation. Whereas this equivalence is easy to prove in the case of the simply-typed -calculus (and hence it is not really necessary to di erentiate between the two approaches in this case), the di erence becomes crucial as soon as we add, for example, dependent types [14]1 . This di erence becomes crucial again when we consider calculi with explicit substitutions. This paper presents calculi for both approaches and shows their equivalence (see section 3). This is because we want to connect the implementation, which is based on the second approach, with the semantics, which is based on the rst approach.

1.2 Typed versus untyped calculi There are typed and untyped calculi with explicit substitutions, both of which are presented already in [1]. The typing rules enforce two di erent restrictions: rstly, they eliminate expressions with misuse of variables, e.g., ones where we try to substitute two di erent terms for the same variable simultaneously. Secondly, they ensure that the only well-typed -terms are the ones of the simply-typed -calculus.

1.3 Names versus de Bruijn numbers Another important kind of choice the designer of a explicit substitution calculus can make concerns the di erence between variable names and de Bruijn numbers. De Bruijn numbers were initially considered, as an implementational trick for Automath: instead of using variables like x; y; z de Bruijn proposed to use natural numbers (that correspond to the binding level of the variable), in such a way that a class of -congruent terms correspond to a single syntactic object. Hence two expressions with variable names are -equivalent if and only if the corresponding terms with de Bruijn numbers are syntactically equal. More than simply an implementational trick, de Bruijn numbers are helpful when de ning the semantics of the calculus in question. The point is that a de Bruijn-number n corresponds exactly to the n-th projection An      A1 !An . 1 The equivalence proofs can still be done [6], but some of the required properties of the type

theories, like con uence and subject reduction, are very hard to establish.

There is a trade-o between a version of the calculus with de Bruijn numbers and a version with names. Expressions with variable names are much easier to read. The di erence becomes apparent even for relatively small terms (e.g., compare the expressions x:(yz:x)(z:x) and :(::3)(:2)). The main drawback of the version with names is the need to identify terms which only di er in the name of bound variables: the semantics of terms can only be de ned modulo -equivalence. This complicates the de nition of the syntax signi cantly, as the de nition of -equivalence is rather involved (see section 3). On the other hand, -conversion is not needed for the version with de Bruijn numbers, and the absence of -equivalence makes this better suited for implementations. So a judicious use of both versions seems the best option: for the presentation of results in the meta-theory, the version with names is used, and for implementations one uses de Bruijn-terms to handle variable access. Of course a good implementation keeps the variable names as extra information during reduction so that terms can be printed with names rather than with de Bruijn numbers.

1.4 Iterated Substitutions The fourth choice concerns the need (or not) for composition of substitutions. The precursor of the -calculus, Curien's -calculus [5], was designed to capture environment machines and had no notion of iterated substitutions. This is rather restrictive, as nested substitutions arise in several situations: during reduction to normal form rather than weak head normal form, when modelling sharing in environment machines, when modelling instantiation in theorem provers, and as the counterpart of composition in the categorical semantics of calculi. The -calculus was developed by Abadi et al. [1] with these applications in mind. Iterated substitutions seem to us an essential part of any -calculus.

Summing up Summarising, it seems to us that the rst \design choices" are not choices at all. We must have both the equations-in-context and the reductions- rst versions, both the typed and untyped versions and both the de Bruijn and the names versions, as our goal is the implementation of abstract machines. It also seems essential to have composition of substitution for the reasons outlined above. Explicit weakening or not is, as far as this paper is concerned, a matter of taste. The paper is structured as follows. We de ne our calculus of explicit substitutions and equations in context in the next section. Next we discuss issues relating binding operations and -equivalences in explicit substitutions calculi. We prove the necessary syntactical properties (con uence and normalisation) of our calculus and then we examine the equivalence between the versions of the -calculus with typed and untyped reduction rules. We conclude by brie y discussing implementations and applications, which are mostly future work.

2 A calculus with equational judgements In this section we present (with minor modi cations) Martin-Lof's -calculus with explicit substitutions. This calculus is the -calculus by Abadi et al. but with names and equations-in-context. Tasistro [15] describes this calculus and gives ample motivation about the form of the judgements and their interpretation. 2

2.1 Well-formed expressions We start by presenting raw expressions and de ning the judgements for wellformed expressions and then give a few intuitions about the calculus. De nition 1 Raw Expressions. The types of the -calculus with names are base types and function types A ) B . The raw expressions of the calculus are given by the following grammar: t ::= x j x : A:t j tt j f  t f ::= hi j hf; t=xi j f ; f We call expressions of the rst kind terms and expressions of the second kind substitutions3 . Moreover, we write htn =xn ; : : : ; t1 =x1 i for h   hhhi; tn =xn i; tn?1 =xn?1 i; : : : ; t1 =x1 i. We identify terms which are identical up to change of bound variables. Because not only the -abstraction but also the explicit substitution f  t binds variables, the de nition of bound variable is signi cantly more complex than in the -calculus; for a precise de nition of the notion of bound variable and of -equivalence see Section 3. Judgements for well-formed expressions require an additional kind of raw expressions, namely contexts. Such a context is a list x1 : A1 ; : : : ; xn : An of assignments of a type to a variable. (Contexts are called environments in [1].) We call a context well-formed if no variable occurs twice in it. From now on we tacitly assume contexts to be well-formed. We denote the empty context, which is the special case of n = 0, by [ ]. Note that contexts are lists rather than multisets; in other words the order is relevant. This approach generalises to dependent type theory and is compatible with categorical semantics. Because contexts like x : A; y : B and y : B; x : A are not identi ed, there is an explicit representation of the exchange rule. This avoids problems with the existence of normal forms of substitutions; for details see Section 4. We have two judgements for the well-formedness of raw expressions, namely ? ` t : A, the usual \t is a term of type A in context ? ", and ? ` f : . The last judgement should be interpreted as \f is an (explicit) substitution for variables in  where the free variables of the terms to be substituted are contained in ? ". Such a substitution roughly corresponds to a list of substitutions in the calculus. We call any context ? 0 arising from ? by deleting some assignments xi : Ai a subcontext ; in that case we write ? 0  ? and call ? an extension of ? 0 . 2 We use the term -calculus as a generic term for any variant of the calculi presented in [1]. 3 Note in particular the existence of an explicit substitution operator, denoted by , which

takes a substitution f and a term t and returns a term f t. 

De nition 2 Typing Judgements. The inference rules for the judgements ? ` t : A and ? ` f :  are as follows: (i) On terms:

?; x : A; ?

?; x : A t : B ? t: A B ? s: A ? f :   t: A x : A ? x : A:t : A B ? ts : B ? f t: A `

0

`

`

`

)

)

`

`

`

`

`



(ii) On substitutions: ?

` hi

: ? (? 0

0



? ) ?? f :f;t=x : ?; xt: :AA ? f :?? f ; g ?: ? g : ? `

` h

`

i

`

0

`

0

`

00

00

The new syntax is best explained by relating the terms with explicit substitutions to terms with the usual implicit substitution of the simply-typed -calculus. The basic idea is that a substitution ? ` f : y : B 4 in the -calculus corresponds to a list of terms t = (t1 ; : : : ; tn ) such that ? ` ti : Bi in the -calculus. Moreover, the operation  models explicit substitution: a term f  t in the calculus corresponds to a term t[ti =xi ] (with the simultaneous substitution of all terms ti for xi in t) in the -calculus. The operations \;" and \h ; i" model sequential and parallel composition of substitutions respectively. If ? ` f : (x : A) and x : A ` g :  and f and g correspond to the lists t and s respectively, then the substitution f ; g corresponds to the list (s1 [t=x]; : : : ; sm [t=x]) and hence models sequential composition of the substitutions f and g. The substitution hi acts not only as the identity substitution in the sense that the term hi  t corresponds to t but also as weakening: If ? ` t : A and ? 0 is an extension of ? then the term ? 0 ` hi  t : A corresponds to the -term ? 0 ` t : A in the extended context ? 0 .

2.2 Equations and Reductions Now we turn to the equations-in-context, which are judgements ? ` f = g :  and ? ` t = s : A. This notion of equality is sometimes called judgemental equality. If a judgement ? ` f = g :  can be stated for any contexts ? and  such that ? ` f :  implies ? ` g : , we will write f = g for ? ` f = g : . Similarly, if a judgement ? ` t = s : A can be stated for any context ? and type A such that ? ` t : A implies ? ` s : A, we will write t = s for this judgement. In section 5 we will relate this version of the calculus to a version with equations derived from reduction de ned on raw terms.

De nition 3. The equations of the -calculus with names are as follows: (i) Equations modelling (traditional) -calculus-reductions:

(x : A:t)s = hhi; s=xi  t x : A:tx = t if x not free in t 4 We abbreviate a context x1 : A1 ; : : : ; xn    An to t[s1 =x1 ; : : : ; sn =xn ].

x : A. Similarly we write t[s=x] for

(ii) Equations for substitutions (In the third rule, y = x if y is neither a free variable nor a substitution variable in f , or y is a variable which is neither a free variable of t and f nor a substitution variable in f ) 5 : f; t=x x = t (1) f; t=y x = f x if x = y (2) f x:A:t = y:A: f; y=x t (3) f (ts) = (f t)(f s) (4) ;f = f (5) t=t (6) f ; g; t=x = f ; g; f t=x (7) f ; (g; h) = (f ; g); h (8) f (g t) = (f ; g) t (9) ? f :  = x 1 : A1 ; : : : ; x n : An ? f = f x1 =x1 ; : : : ; f xn =xn : 

h

i 

h



h

i 

i

hi

h









6



hi 

i

h





i



`

`

h





i

The rst two equations are the equations corresponding to -and -reduction in the -calculus respectively. The equation for the -rule has a term with an explicit substitution on the right hand side rather than an implicit substitution as in the -calculus. This is the place where explicit substitutions are introduced during the reduction of -terms to normal form in order to make the delay of substitution possible. The equations (1){(4) push substitutions over the constructors of -terms. The equation hf; t=xi  x = x is the one where the replacement of the term t for x actually takes place. The equations f ; (g; h) = (f ; g); h and f  (g  t) = (f ; g)  t express associativity of substitution. The last equation for substitution expresses the fact that substitution is determined by its e ect on variables. In particular, this equation causes the substitutions (x : A) ` hi : (x : A) and (x : A) ` hxi =xi i : (x : A) to be equal. This equation can be thought of as an -rule for the explicit substitutions. It is necessary for the de nition of an extensional semantics, e.g., a categorical semantics.

De nition 4 Reduction Relations. The (typed) reduction relations ? ` t ; t0 : A (over terms), and ? ` f ; f 0 :  (over substitutions) are de ned by orienting the above equations from left to right.

Again, if a reduction rule can be stated for any contexts ? ,  and types A such that ? ` f :  implies ? ` f 0 :  and ? ` t : A implies ? 0 ` t0 : A, we will write f ; f 0 and t ; t0 respectively. Before we investigate the meta-theoretical properties of this calculus, we examine -equivalence in detail in the next section.

3 -equivalence In this section we examine -equivalence in a -calculus with names, which is more complex than in the -calculus. We aim to retain the results for the -calculus, in particular we want two expressions to be -equivalent i their corresponding de Bruijn-terms are equal, 5 the substitution variables in a substitution f are all variables x occurring in an expression

g; t=x ; for a precise de nition see Section 3.

h

i

and reduction should preserve -equivalence. The latter causes problems which are not apparent in the -calculus. If we de ne -equivalence to be the smallest congruence such that x : A:t = y : A:t[y=x], then -reduction does not preserve -equivalence: the two terms (x : A:t)s and (y : A:t[y=x])s are -equivalent, but the contracta hs=xi  t and hs=yi  t[y=x] are not. Hence we have to de ne -equivalence in such a way that terms like hs=xi t and hs=yi  t[y=x] are -equivalent. This means that the substitution operator  acts as another binding operator. However, this is a di erent kind of binding from the one -abstraction provides: the substitution operator binds in any expression f  t those variables in t where there is a term contained in f which is to be substituted in t. In the example hs=xi  t, the variable x is bound by . Note that the substitution operator  does not indicate the scope nor the name of the variables that it binds. We de ne the sets of free variables and substitution variables (which are all those variables in a substitution f which are bound in a term f  t or in a substitution f ; g) by a mutual induction. The interesting cases for the free variables are FV(x : A:t) = FV(t) n fxg and FV(f  t) = FV(f ) [ (FV(t) n SV(f )). The substitution variables are de ned by SV(hi) = ;, SV(hf; t=xi) = SV(f ) [ fxg and SV(f ; g) = (SV(f ) n FV(g)) [ SV(g). A variable occurring in t is called bound in the term t if it is not a free variable in t. A variable occurring in f is called bound in f if it is neither a free variable nor a substitution variable in f . In the -calculus Curry de nes substitution before he de nes -equivalence. As the substitution has been made explicit, we only need to de ne renaming (i.e., the replacement of one variable by another) as an operation in the metatheory to state -equivalence. This de nition of renaming requires an auxiliary notion to change the name of the substitution variable x in hf; t=xi to y, i.e., we de ne an operation f fy=xg, which satis es hf; t=xi fy=xg = hf; t=yi. This name-changing substitution is given by hi fy=xg = hi; (f ; g) fy=xg = f ; (g fy=xg) if x 2 SV(g) and f ; g fy=xg = f fy=xg ; g if x 62 SV(g); hf; t=xi fy=xg = hf; t=yi and hf; t=z i fy=xg = hf fy=xg ; t=z i if x 6= y. De nition 5. We de ne the renaming of the variable x by the variable y in t or f by induction over the structure of raw expressions.

x[y=x] = y z[y=x] = z if z = x (x : A:t)[y=x] = x : A:t (z : A:t)[y=x] = w : A:t[w=z][y=x]( z = x) (tu)[y=x] = (t[y=x])(u[y=x]) (f t)[y=x] = f zi =yi [y=x] t[zi =yi ][y=x] [y=x] = f; t=z [y=x] = f [y=x]; t[y=x]=z (f ; g)[y=x] = (f zi =yi )[y=x]; (g[zi =yi ])[y=x] 6

6



hi

hi

h

f

g

f

i

h

g



i

In the second rule for -abstraction, w is equal to y if x 62 FV(t) or y 62 FV(s), otherwise w occurs neither free nor bound in t or s. In the rule for f  t, the variable zi is equal to yi if yi 62 FV(s), otherwise it is a fresh variable. The same condition applies for the case f ; g. The de nition of -equivalence can now be stated. De nition 6. We de ne -equivalence in the -calculus to be the smallest congruence relation on raw expressions including x : A:t  y : A:t[y=x] f  t  f fy=xg  t[y=x] f ; g  f fy=xg ; g[y=x]

The variable y is either x or it is not free in t, f and g nor is it contained in SV(f ). In the last two rules x is bound by  and ; respectively. Next we examine the interaction between -equivalence which is de ned on raw expressions, and the judgements. For the typing judgements, ? ` t : A means there exists an -equivalent term t0 such that ? ` t0 : A according to the rules presented in Section 2. A similar convention is adopted for all other judgements and for reduction on raw expressions. The next theorem justi es this convention. Theorem 7. Assume that t1 and t2 are two -equivalent -terms, and assume that f1 and f2 are two -equivalent substitutions. If ? ` t1 : A, then also ? ` t2 : A, and similarly if ? ` f1 : , then also ? ` f2 : . If ? ` t1 = s : A, then also ? ` t2 = s : A, and if ? ` f1 = g : , then ? ` f2 = g : . If t and s are equivalent terms in the -calculus, then they are -equivalent in the -calculus, too. The -calculus with de Bruijn numbers has no variable names and hence also no -equivalence. The intuition is that -equivalence is in fact only a consequence of the existence of names and does not a ect the -calculus in any other way. More precisely, equality modulo -equivalence in the calculus with names and equality in the -calculus with de Bruijn numbers coincide. The translation from the -calculus with names into the -calculus with de Bruijn-numbers is de ned by an induction over the derivation and replaces each variable x in a context ?; x : A; ? 0 by the length j? 0 j of the context ? 0 . For details, see [12]. The results of this section imply that Barendregt's variable convention can be adopted in the rest of this paper when we prove meta-theoretic properties. To be precise, we consider -equivalent terms to be syntactically equal, and in the sequel we assume that all bound variables occur nowhere else in a given mathematical context (e.g., neither as free variables as in x(x : A:x) nor as substitution variables as in hf; t=xi  x : A:s).

4 Con uence and Normalisation This section investigates con uence and normalisation for the (equational)

-calculus. We deduce con uence from the con uence of the simply-typed -

calculus, using a modularity argument, rst described in [7] and familiar under the name \interpretation method". The argument is well-known, here we just make an e ort to present it in its generic form. De nition 8 Modularity Properties. Assume that there is a translation [ ?] of the extended calculus into the con uent one satisfying the following modularity properties: Firstly, if t ; s in the extended system, then also [ t] ; [ s] . Secondly, for each term t in the extended system we have t ; [ t] . Thirdly, for each reduction t ; s in the con uent system there exists a reduction sequence t ; s in the extended system. In our case, this general argument works as follows. The translation [ ?] works by \carrying out the substitutions", i.e., [ hti =xi i  t] = [ t] [[[ti ] =xi ].

All reduction rules except the -rule (x : A:t)s ; hs=xi  t and the -rule x : A:tx ; t model explicit substitution. We call these rules -rules, and we  s. We expect the translation from the  -calculus denote a -reduction by t ; to the -calculus to map the redex and the contractum of a -reduction to the same -term. We obtain the modularity properties as a consequence; for details

see the technical report [12]. Note that the modularity properties do not hold for the original version of the -calculus with names. In particular, the reduction ht=x; s=yi ; hs=y; t=xi violates the rst modularity property. Formalising the argument given before to establish con uence of the calculus we obtain the desired con uence.

Theorem 9 Typed con uence. Let ? ` t : A be any well-formed -term. If t ; t1 and t ; t2 , then there exists a well-formed -term ? ` u : A such that t1 ; u and t2 ; u. Similarly, let ? ` f :  be any well-formed substitution. If f ; f1 and f ; f2 , then there exists a well-formed substitution ? ` g :  such that f1 ; g and f2 ; g.

Normalisation also arises as a consequence of the modularity properties of the translation. Because the proof consists of giving an e ective normalisation strategy, we obtain decidability of equality in the -calculus as a corollary. Theorem 10 Normalisation. Every well-formed term t and substitution f of the -calculus has a normal form, which can be e ectively computed. The normal form for a term is a normal -term, and the normal form for a substitution is a lists of normal -terms. Mellies [11] shows that strong normalisation does not hold. As a counterexample, he gives a -term which reduces to the identity but which admits a reduction sequence where a term t reduces to a term t0 which contains t as a subterm. But it is possible to show that all reduction strategies that reduce an expression rst to one in weak head-normal form (i.e., substitution is pushed under -abstraction only if the -abstraction is the outermost constructor) lead only to nite sequences of reductions [13].

5 Reduction on Raw Terms The main part of this section examines a typed calculus with reduction de ned on raw terms. At the end we mention brie y untyped calculi. Apart from the extensionality rule for substitution ? ` f ; hf xi =xi i : x : A, all reduction rules do not use typing information. Hence we omit this rule, and write ;r for the notion of reduction on raw terms given by turning all reduction rules ? ` f ; g :  except ? ` f ; hf  xi =xi i : x : A into rules f ;r u, and all reduction rules ? ` t ; s : A into rules t ;r s. For this restricted fragment, which suces for the design of abstract machines, we show in this section that reduction based on raw terms and the reduction derived from equational judgements (see Section 2) coincide. The important properties for this

proof are uniqueness of types and subject reduction, which says that well-typed expressions reduce to well-typed expressions. The same proofs that work for the simply-typed -calculus with reduction de ned on raw expressions work also for the system with explicit substititution. Now we turn to the con uence proof for the calculus based on reduction on raw terms. The proof follows the general outline established in the previous section but it does not work directly because the previous proof uses the fact that every substitution reduces to a list of terms. This is no longer true if we use reduction on raw expressions: substitutions can no longer be reduced to lists of terms in general, but only to so-called canonical forms, i.e., lists of terms with an additional weakening at the end. In particular, the substitution ht=xi; hi is a normal form if t is a normal form. The details and the adaptation of the con uence proof are given in the technical report [12]. We only cite the nal theorem. Theorem 11. Let ? ` t : A be any well-formed -term. If t ;r t1 and t ;r t2, then there exists a well-formed -term ? ` u : A such that t1 ;r u and t2 ;r u. Similarly, let ? ` f :  be any well-formed substitution. If f ;r f1 and f ;r f2 , then there exists a well-formed substitution ? ` g :  such that f1 ;r g and f2 ;r g.

Remark Curien et al. [4] showed that con uence on open terms fails for the untyped -calculus. To obtain con uence they introduce a special syntactic construction, which describes the e ect of pushing a substitution under a abstraction. (They consider a version with de Bruijn-numbers, but the idea should work as well with a calculus with variables.)

The result of good design now follows: the judgemental equality presentation of our -calculus with names is equivalent to its presentation based on reduction on raw terms. Theorem 12. The -calculus with judgemental equality is equivalent to the -calculus based on reduction on raw terms. Thus ? ` t = s : A if and only if ? ` t : A, ? ` s : A and t $ s, where $ is the equivalence relation generated by ;, and similarly for substitutions. This con uence proof can also be applied to the untyped -calculus. The reason is that the translation of explicit substitutions into list of -terms still can be done. In this way the con uence of the untyped -calculus can be lifted. Obviously, normalisation fails as any counterexample to normalisation in the untyped -calculus can be reproduced in the calculus with explicit substitutions.

6 Conclusions We examined choices for designing calculi with explicit substitutions. We presented our own version of a calculus of explicit substitutions, for the simply typed -calculus, for which we showed the equivalence between its version arising from

semantical (equations-in-context) considerations and syntactic (reduction on raw term) ones. (This equivalence is crucial in establishing the correspondence between the semantics of the calculus and its implementations.) We discussed its typed and untyped variants and the names and de Bruijn avours of the calculus. Also we proved all the necessary, standard, properties of our calculus. The proofs are also standard. This calculus contains what we take to be the essential points of our approach of using categorical type theory to inform the implementation of abstract machines. Ritter's PhD thesis is perhaps a more impressive example of the same approach, dealing with the Calculus of Constructions. But the point of the paper is to show how \inevitable" this calculus is, given our original goals. This is to be contrasted with the multitude of other explicit substitution calculi. Also it was necessary to clarify the case of the simply typed-lambda-calculus, to modify it appropriately, to deal with the linear lambda-calculus. Linearity introduces several new challenges that we are tackling at the moment.

References 1. M. Abadi, L. Cardelli, P.-L. Curien, and J.-J. Levy. Explicit substitutions. Journal of Functional Programming, 1(4):375{416, 1991. 2. R. Bloo and K.H. Rose. Preesrvation of strong normalisation in named lambda calculi with explicit substitution and garbage collection. In Proc. CSN'95|Computer Science in the Netherlands, pages 62{72, 1995. 3. C. Coquand. From semantics to rules: A machine assisted analysis. In CSL'93, volume 832 of LNCS, 1994. 4. P.-L. Curien, Th. Hardin, and J.-J.Levy. Con uence properties of weak and strong calculi of explicit substitutions. Journal of the ACM, 43:362{397, March 1996. 5. Pierre-Louis Curien. An abstract framework for environment machines (Note). Theoretical Computer Science, 82(2):389{402, 1991. 6. Herman Geuvers. Logics and Type Systems. PhD thesis, Univ. of Nijmegen, 1993. 7. Therese Hardin. Con uence results for the pure strong categorical logic CCL. -calculi as subsystems of CCL. Theoretical Computer Science, 65:291{342, 1989. 8. F. Kamareddine and A. Rios. A lambda-calculus a la de bruijn with explicit substitutions. In PLILP'95, volume 982 of LNCS, 1995. 9. P. Lescanne. From  to : a journey through calculi of explicit substitutions. POPL'94, pages 60{69, Portland, Oregon, 1994. 10. Per Martin-Lof. Intuitionistic Type Theory. Bibliopolis, Napoli, 1984. 11. P.-A. Mellies. Typed -calculi with explicit substitution may not terminate. TLCA'95, pages 328{334. LNCS No. 902, 1995. 12. E. Ritter and V. de Paiva. On explicit substitution and names. Technical report, Univ. of Birmingham, School of Computer Science, 1997. 13. Eike Ritter. Normalization for typed lambda calculi with explicit substitution. CSL'93, pages 295{304. LNCS No. 832, 1994. 14. Thomas Streicher. Correctness and Completeness of a Categorical Semantics of the Calculus of Constructions. PhD thesis, Universitat Passau, June 1989. 15. A. Tasistro. Formulation of Martin-Lof's theory types with explicit substitutions. Licenciate Thesis, Chalmers University, Dept. of Computer Science, May 1993. This article was processed using the LATEX macro package with LLNCS style