hi jc : K jc - Universidade do Minho

0 downloads 0 Views 193KB Size Report
respectively. The use of explicit constructors for each form of N. -terms makes inductive reasoning on the structure of N.-terms easier. Hereafter we make no.
Sequent Calculi for the Normal Terms of the  - and  -Calculi ? Lus Pinto1 and Roy Dyckho2 1

Departamento de Matematica, Universidade do Minho, Portugal

2

Computer Science Division, University of St Andrews, Scotland

[email protected] [email protected]

Abstract. This paper presents two sequent calculi, requiring no clausal form for types, whose typable terms are in 1-1 correspondence with the normal terms of the  - and  -calculi. Such sequent calculi allow no permutations in the order in which inference rules occur on derivations of typable terms and are thus appropriate for proof search. In these calculi proof search can be performed in a root-rst fashion and type conversions are solely required in axiom formation. 1

The  -calculus

The  -calculus 6, 9] is a theory extending the simply typed -calculus 1] with rst-order  -types, i.e. with dependent types. It is the type system of the Edinburgh Logical Framework (LF) 6], a logic for presenting logics, and it is the basis of Elf 7, 8], a language giving to types an operational interpretation similar to that given to formulae in logic programming. The  -calculus essentially corresponds to the P system of the -cube 1] and it is also closely related to the  -fragment of AUTPI 2]. The categories of expressions in the  -calculus are the following:  ::= hi j  c : K j  c : A (signatures) ; ::= hi j ; c : A (contexts) K ::= Type j x : A:K (kinds) A ::= c j x : A:A j x : A:A j AN (types) N ::= c j x j x : A:N j NN (terms) where x and c range over denumerable sets of variables and constants respectively. Types of the form cN1 :::Nn, where c is a constant and the Ni 's are terms, are called atomic. The judgment forms of the  -calculus are: `  sig (signature judgments) ` ; context (context judgments) ; ` K kind (kind judgments) ; ` A:K (type judgments) ; ` N :A (term judgments) ?

Funded by Centro de Matematica da Universidade do Minho, Portugal.

We follow 9] (p. 315) for the inference rules for these judgments. See also 9] (p. 313) for the basic meta-theory of the  -calculus. For each category of expressions: a  -normal form is an expression containing no  -redexes, i.e. containing no subexpressions of the form ( x : A:N1)N2  the conversion relation on expressions, written as = , is the congruence closure of the one step  -reduction each expression e is  -convertible to a unique  -normal form e. We say that  types a term N when, for some type A, context ; and signature  , ; ` N : A is derivable. In this paper we address the proof search problem for  : the problem of, given a signature  , a context ; and a type A, nding all the  -normal terms N such that ; ` N : A is derivable in  . The  -calculus is not a good basis for solving this problem: it does not have the immediate subformula property (in the rule E for term judgments, types (formulae) occurring in the premisses might not occur as immediate subformulae of a formula in the conclusion) it allows the typing of non- -normal terms and, owing to the presence of the rule conv, permutations of inference rules in derivations of typable terms (at the level of term judgments) are allowed, even for  -normal terms. We propose instead the sequent calculus  as a basis for proof search in the  -calculus. The calculus  , for which the immediate subformula property holds, types a set of terms that is in 1-1 correspondence with the set of  -normal terms typable in  and each term typable in  admits (at the level of term judgments) no permutations of inference rules in its derivations. In order to show adequacy of  for the  -normal terms of  , we rst develop the intermediate natural deduction calculus  . , which does not have the immediate subformula property but types exactly the typable  -normal terms of  by means of derivations allowing no permutations of inference rules. Then, by using the notation in 4] for a sequent calculus, having origins in 5] and deriving exactly the normal natural deductions of rst-order intuitionistic logic, we arrive at the sequent calculus  , for which the immediate subformula property holds. The typable long  -normal terms of  (as dened in 6]) can be captured by imposing a simple constraint in one of the rules of  .  a sequent calculus for typing them can be obtained by similarly constraining one of the rules of . The ideas used in devising the calculus  can be extended to richer type theories. Considering the natural deduction system  , an extension of  with  -types essentially corresponding to the calculus  presented in 7], and applying techniques similar to those involved in developing  , we obtain the sequent calculus  which constitutes a good basis to search for the typable normal terms of  . 2

The Natural Deduction Calculus  .

The  . -calculus is a natural deduction calculus for typing exactly the  -normal terms typable in  . Before dening this calculus, we introduce two intermediate

calculi, 1 and 2, used in showing adequacy of  . for the typable  -normal terms of  . In the  -calculus derivability of type judgments depends upon derivability of term judgments. The rst intermediate calculus 1 removes this form of dependency. The only dierence between 1 and  is that the former allows the extra judgment form ; N : A for typing terms. Judgments of this new form are called main judgments. The inference rules for main judgments are shown in Fig. 1 they are the rules obtained from the  -rules for term judgments where each term judgment ; ` N : A is replaced by a main judgment ; N : A. ` ; context c : A 2

;

` ; context x : A 2 ; ax axc v ; c:A ; x:A ;x : A1 N : A2 N1 : x : A1 :A2 ; N2 : A1 E ; N1 N2 : N2 =x]A2 ; x : A1 :N : x : A1 :A2 I ; N : A1 ; ` A2 : Type A1 = A2 conv ; N : A1

Fig. 1. The

1 -rules for main

judgments.

Proposition 1. ; ` N : A is  -derivable i ; ` N : A and ; N : A are

1-derivable. Proof. Routine structural induction. t u The motivation to add a new term judgment form is to make easier the denition of the calculi  . and  (presented later) and relating them to  . The derivable judgments of these two calculi are the same as those of 1 except for main judgments. The second intermediate calculus, 2 , is dened as 1 except for the I rule which is replaced by the rule ;

;x : A1 N : A2 x : A1:N : x : A1 :A2 I :

In this rule the type annotating the abstracted variable is required to be  normal, although arbitrary types may be used in contexts. A term N is said to be type normal if all the types annotating abstracted variables in N are  -normal. Observe that  -normal terms are type normal. The following proposition shows that 2 types exactly the typable type normal terms of  . Proposition 2. If N is a type normal term, ; N : A is 1-derivable i ; N : A is 2-derivable. Proof. Observing that replacement in contexts of types by types convertible to them is admissible in 1 , both implications may then be proved by routine inductions. t u

Lemma 1 shows completeness of a class of derivations for main judgments, where the use of the rule conv is constrained. Roughly, the rule conv need not be used immediately below introduction steps (instances of I  ) nor need it be used immediately above elimination steps (instances of E ). A conversion redex of rank (N n) of a 2 -derivation D of a main judgment ; 0 N 0 : A0 is a subderivation D0 of D, ending in a main judgment ; N : A, where either: i) the last step of D0 is an elimination step immediately preceded in its main premiss (left premiss) by n  1 instances of conv or ii) the last n  1 steps of D0 are instances of conv, immediately preceded by an introduction step. A 2 -derivation of ; 0 N 0 : A0 with no conversion redexes is called conversion normal. Given ranks (N1  n1) and (N2  n2) of conversion redexes, we say that (N1  n1) is smaller than (N2  n2) if: N1 is a proper subterm of N2  or N1 and N2 are the same term and n1 < n2 .

Lemma 1. If ; N : A is 2-derivable, then it is derivable in 2 by means of a conversion normal derivation. Proof. Suppose that D is a derivation of ;

redex D0 of rank (N1 N2  n) having the form: ;

N : A containing a conversion-

D1 0 N1 : A ; ` x : A1 :A2 : Type A0 = x : A1 :A2 conv ; N1 : x : A1 :A2 ; ; N1 N2 : N2 =x]A2

D2 N2 : A1 E

Since A0 = x : A1:A2 , A0 must be of the form x : A01:A02, where both A01 = A1 and A02 = A2 and thus N2=x]A02 = N2=x]A2. We can now replace D0 by the following derivation D00 : ;

D2 0 D1 0 0 ; N2 : A1 T1 A0 1 = A1 conv ; N2 : A1 N1 : x : A1 :A2 E ; N1 N2 : N2 =x]A02 T2 N2 =x]A02 = N2 =x]A2 conv ; N1 N2 : N2 =x]A2

where T1 and T2 are derivations of the type judgments ; ` A01 : Type and ; ` N2=x]A2 : Type respectively. Conversion redexes in D00 have ranks no bigger than (N1 N2  n ; 1). t u The  -normal terms of  are in 1-1 correspondence with the N . -terms dened by the following grammar:

N . ::= x : A:N .jan(N .. ) N .. ::= var(x)jconst(c)jap(N ..  N .) where, as before, x, c and A range over variables, constants and  -normal types respectively. The use of explicit constructors for each form of N . -terms makes inductive reasoning on the structure of N . -terms easier. Hereafter we make no distinction between an N . -term and its corresponding  -normal term.

The forms of judgment of  . are those of  , together with two new term judgment forms: one for N . -terms, written as ; . N . : A, and the other for N ..-terms, written as ; . . N .. : A. The rules for deriving the two new forms of judgment are presented in Fig. 2. The rules for deriving the other forms of judgment are the same as those of  . In deriving term judgments of the two new forms, conversions on types cannot be used arbitrarily, they are conned to the rule switch, where an interchange between the two new term judgment forms takes place. ` ; context c : A 2

` ; context x : A 2 ; ax axc v ; . . const(c) : A ; . . var(x) : A ; x : A1 . N . : A2 ; . . N1.. : x : A1 :A2 ; . N2. : A1 I E ; . . ap(N1..  N2. ) : N2. =x]A2 ; . x : A1:N . : x : A1 :A2 ; . . N .. : A ; ` A0 : Type A = A0 switch ; . an(N .. ) : A0

Fig. 2. The

 . -rules

for terms.

Lemma 2. Let N be a  -normal term and let ;

` N : A be  -derivable. Then: (i) ; . N : A is  . -derivable and (ii) if N is not of the form x : A1 :N1, then there exists a type A0 such that: A = A0 holds and ; ` A0 : Type and ; . . N : A0 are  . -derivable.

Proof. Suppose N is a  -normal term and so, in particular, a type normal term, and suppose ; ` N : A is derivable in  . Therefore, ; N : A has a 2 derivation D, which, by Lemma 1, we may assume to be conversion normal. The proof now follows by induction on the structure of N . For example, case N = N1 N2 and D consists of n  1 conv steps preceded by an elimination step, i.e., D has the form: ;

N1 : x : A1 :A2 ; N2 : A1 E ; N1 N2 : N2 =x]A2 .. n ; 1 conv . ;

steps

N1 N2 : A3

;

; ` A : Type A3 = A conv N1 N2 : A

By the I.H., there exists a type A0 ,  -convertible to x : A1 :A2 and thus needs to be of the form x : A01 :A02 with A01 = A1 and A02 = A2 , such that ; ` A0 : Type and ; . . N1 : A0 are  . -derivable. The construction ; . . N1 : x : A01 :A02 ; . N2 : A01 E ; . . ap(N1  N2 ) : N2 =x]A02

proves (ii) and the construction below (where D0 represents the previous construction) proves (i). D0 ; . . ap(N1  N2 ) : N2 =x]A02 ; ` A : Type N2 =x]A02 = A switch ; . an(ap(N1  N2 )) : A

Lemma 3. The rules

; . N. : A ; ` N. : A

and

; . . N .. : A ; ` N .. : A

t u

are admissible.

Proof. By simultaneous structural induction on N . and N .. .

t u

Theorem 1.  . types exactly the  -normal typable terms of  , i.e., (i) if N is  -normal and ; ` N : A is  -derivable, then ; . N : A is  . -derivable (ii) if ; . N . : A is  . -derivable, then N . is  -normal and ; ` N . : A is  -derivable. Proof. Immediate from the two lemmas before.

t u

The calculus  . can with a minor change type exactly the long  -normal typable terms of  : it suces to constrain applications of the switch rule to the cases where the types in the  -conversion premiss are atomic. 3

The Sequent Calculus 

The calculus  requires a new set of terms, the set of M -terms, dened by the following grammar:

M ::= x : A:M j(x Ms)j(c Ms) Ms ::= ]jM :: Ms The 1-1 correspondence between the sets of M -terms and N . -terms can be shown by using the mutual inverse mappings : M ! N . and : N . ! M dened as follows: : M ;! N. 0 : N..  Ms ;! N. 0 .. ( x : A:M )=def x : A: (M ) (N  ])=def an(N .. ) ((xMs))=def 0 (var(x)Ms) 0 (N .. M :: Ms)=def 0(ap(N .. (M )) Ms) : N. ;! M 0 : N..  Ms ;! M . . 0 ( x : A:N )=def x : A: (N ) (var(x) Ms)=def (x Ms) (an(N .. ))=def 0 (N ..  ]) 0 (ap(N .. N . ) Ms)=def 0 (N .. (N . ):: Ms)

The calculus  is obtained from  by adding two new term judgment forms: one for typing M -terms, written as ; =) M : A and called M -sequents, A Ms : A and called Msand the other for typing Ms-terms, written as ; ;! sequents. In an Ms-sequent the types above and on the RHS of the arrow are called respectively its selected type and its main type. The selected type A1 of A1 Ms : A may be thought of as a type, inhabited w.r.t. an Ms-sequent ; ;! 2 ; , from which the inhabitant Ms of A2 can be found. The  -rules for deriving the two forms of sequents are shown in Fig. 3. ` ; context ; ` A : Type A1 = A ax A1 ] : A ; ;! M )=x]A2 Ms : A ; =) M : A1 ; (;! ; x : A1 =) M : A2 L R :A1 :A2 ; x;! M :: Ms : A ; =) x : A1 :M : x : A1 :A2 A1 Ms : A c : A 2 A1 ; ;! ; ;! Ms : A x : A1 2 ; sel 1 sel s c ; =) (c Ms) : A ; =) (x Ms) : A

Fig. 3. The

 -rules

for sequents.

Lemma 4. The following rules are admissible: ; =) M : A ; . (M ) : A (i)

A1 Ms : A ; . . N .. : A1 ; ;! (ii) ; . 0 (N ..  Ms) : A

A1 Ms : A ; . N . : A (iii) ; . . N .. : A1 ; ;! (iv) . 0 .. ; =) (N ) : A ; =) (N  Ms) : A

Proof. The admissibility of the rules (i) and (ii) is proved by simultaneous struc-

tural induction on M and Ms, respectively, following essentially the proof of Prop. 3 of 4]. For example, the transformation below proves the case where Ms = ]. ` ; context ; ` A : Type A1 = A ax A1 ] : A ; ;!

# ; . . N .. : A1 ; ` A : Type A1 = A switch ; . an(N .. ) : A

The admissibility of the rules (iii) and (iv) is proved by simultaneous structural induction on N . and N .. , respectively, following essentially the proof of Prop. 4 of 4]. For example, in case N . = an(N .. ) the following transformation proves the result.

; . . N1.. : A1 ; ` A : Type A1 = A switch ; . an(N1.. ) : A #

` ; context ; ` A : Type A1 = A ax A1 ] : A ; ;! ; . . N1.. : A1 (iv) ; =) 0 (N1..  ]) : A

Theorem 2.  . derives ; . N . : A i  derives ; =) (N . ) : A.

t u

Proof. The if part follows immediately from (iii) of the lemma before. The other implication follows from (i) of the lemma before, together with the identity ( (N . )) = N . . t u The proof search problem for  can now be stated as the problem of, given a signature  , a context ; and a type A, nding all M -terms such that ; =) M : A is  -derivable. A similar result may be obtained when  -normal terms are replaced by long  -normal terms and in the calculus  the constraint of allowing only atomic types as the main types of select rules (sels and selc ) is imposed. A method to search for all M -terms such that ; =) M : A is  derivable can be guided by the structure of A: the rule R is used to decompose A into a type A1 (which needs to be atomic if select rules require atomic types as main types) then a type A2 is selected either from the signature or from the context and a search focused on A2 is started (i.e., by repeatedly applying L to A2 and the type subformulae generated from A2) for an inhabited type convertible to A1 . 4

The Natural Deduction Calculi  and  .

The calculus  essentially corresponds to the  -calculus of 8]. The class of types A of  includes all types of  and allows types of the form x : A:A called sigma types. The unessential dierence between  and  is that in the latter calculus the constructor of type families is not considered. We have an overloaded use of A for the types of  and for the types of   however at any use of A it should be clear which class of types we want to refer to. A similar overloading is used for the other categories of expressions. The terms N of  are those of  together with the new forms (N N ), fst(N ) and snd(N ) of terms. A  -term of the form fst((N1  N2 )) or of the form snd((N1  N2)) is called a -redex. For the categories of terms, types and kinds: a  -normal form is an expression containing no  -redexes and no redexes the conversion relation on expressions, written as = , is the congruence closure of the one step  -reduction each expression e is  -convertible to a unique  -normal form e. The forms of judgment of  are the same as in  (where the classes of  -objects are viewed as the corresponding classes of  -expressions). The

inference rules of  are obtained from the inference rules of  by: adding the rules in Fig. 4 (for well-formed sigma types and for typable terms of the new forms) and replacing the conversion rule so that it allows for  -convertibility. ; ` A1 : Type ; x : A1 ` A2 : Type  ; type ; ` x : A1 :A2 : Type ; ` N1 : A1 ;x : A1 ` A2 : Type ; ` N2 : N1 =x]A2 I ; ` (N1  N2 ) : x : A1:A2 ; ` N : x : A1:A2 ; ` N : x : A1 :A2  E ; ` fst(N ) : A1 1 ; ` snd(N ) : fst(N )=x]A2 2 E

Fig. 4. Rules of

 .

We now dene the  . -calculus for the typable  -normal terms of  , which can also be regarded as an extension of  . with sigma types. The term categories of  . are N . and N .. , dened as: N . ::= x : A:N . j(N . N . )jan(N .. ) N .. ::= var(x)jconst(c)jap(N ..  N .)jfst(N .. )jsnd(N .. ) As in  , N . -terms can be regarded as a new notation for the  -normal terms of  : they are in 1-1 correspondence. In what follows we identify a  -normal term and its corresponding N . -term. The forms of judgment of  . are the same as those of  . . The rules for deriving them are those of  . with the following exceptions: the rule  type in Fig. 4 is allowed the rule switch of  . is replaced by the new rule switch in Fig. 5, which allows for  -convertibility instead of allowing solely  convertibility and the other rules in Fig. 5 for N . and N .. term judgments are also allowed in  . . ; . . N .. : A ; ` A0 : Type A = A0 switch ; . an(N .. ) : A0 ; . N1. : A1 ; x : A1 ` A2 : Type ; . N2. : N1. =x]A2 I ; . (N1  N2 ) : x : A1:A2 ; . . N .. : x : A1:A2  E ; . . N .. : x : A1:A2 ; . . fst(N .. ) : A1 1 ; . . snd(N .. ) : fst(N .. )=x]A2 2 E

Fig. 5. Rules of

 . .

Lemma 5. Let N be a  -normal term of  and let ; ` N : A be  derivable. Then,

(i) ; . N : A is derivable in  .  and (ii) if N is neither an abstraction nor a pair, then there exists a type A0 such that: A = A0 holds and ; ` A0 : Type and ; . . N : A0 are derivable in  . . Proof. This result may be proved similarly to Lemma 2, i.e., by dening conver-

sion normal derivations in  and showing their completeness for type normal terms, arguing then by induction on the structure of N . t u

; . N. : A ; . . N .. : A ; ` N . : A and ; ` N .. : A are admissible. Proof. By simultaneous structural induction on N . and N .. .

Lemma 6. The rules

t u

Theorem 3. For  -normal normal terms N of  , ; ` N : A is  derivable i ; . N : A is  . -derivable. Proof. Immediate from the two lemmas before. t u 5

The Sequent Calculus 

The calculus  requires the classes of objects dened for  and introduces a new set of terms, extending the set of M -terms dened for  , that we also call M -terms: M ::= x : A:M j(M M )j(x Ms) Ms ::= ]jM :: Msjfst(Ms)jsnd(Ms) The sets of M -terms of  and N . -terms of  are in 1-1 correspondence. This result can be shown by using the extensions : M ! N . and : N . ! M of the corresponding mappings, dened in Sec. 3, satisfying the equations: ((M1  M2)) =def ( (M1 ) (M2)) 0(N ..  fst(Ms)) =def 0 (fst(N .. ) Ms) 0 (N ..  snd(Ms)) =def 0(snd(N .. ) Ms)

((N1.  N2.)) =def ( (N1. ) (N2. )) =def 0(N ..  fst(Ms)) =def 0 (N ..  snd(Ms)) These mappings and are still mutual inverses. The forms of judgment of  are those of  , together with two new forms of judgment: one for typing M -terms, written as ; =) M : A, and the A Ms : A. The rules for deriving M other for typing Ms-terms, written as ; ;! N .. judgments are those of  together with the rules R, sels and selc of Fig. 6. The rules for deriving Ms-judgments are shown in Fig. 6. As compared to Msjudgments of  , Ms-judgments of  contain an extra object, an N .. -term. A1 In a judgment ; ;! Ms : A, the term N .. can be thought of as an inhabitant N .. 0 (fst(N .. ) Ms) 0(snd(N .. ) Ms)

of A1 under context ;  then the term Ms is an inhabitant of A, built upon the given inhabitant N .. for A1. The reason for using N .. -terms in Ms-judgments becomes apparent in the rule 2 L, for the selected type of its premiss depends upon an N .. -term. ` ; context ; ` A : Type A1 = A ax A1 ; ;! N .. ] : A

A1 ; fst;! Ms : A (N .. )

:A1 :A2 ; x;! N .. fst(Ms) : A

M )=x]A2 ; =) M : A1 ; ap(N(;! .. (M )) Ms : A L :A1 :A2 ; x;! N .. M :: Ms : A ..

1 L

(N )=x]A2 ;! .. Ms : A ; fstsnd (N ) :A1 :A2 ; x;! N .. snd(Ms) : A

2 L

; =) M1 : A1 ;x : A1 ` A2 : Type ; =) M2 :  (M1 )=x]A2 R ; =) (M1 M2 ) : x : A1:A2 A1 ;! ; const Ms : A c : A1 2 (c) ; =) (c Ms) : A

Fig. 6.

sels

A1 ;! ; var Ms : A x : A1 2 ; (x) selc ; =) (x Ms) : A

 -rules for terms.

The following lemma states for  . and  similar properties to those stated in Lemma 4 for  . and  . The main dierence is that in the second premisses of the rules (ii) and (iv) of the lemma below there is a N .. -term that was not present in the corresponding premisses of the rules of Lemma 4. However, notice that in the rules (ii) and (iv) of Lemma 4 such N .. -term is already required in their rst premisses.

Lemma 7. The following rules are admissible: ; =) M : A ; . (M ) : A (i)

A

1 ; . . N .. : A1 ; ;! N .. Ms : A (ii) ; . 0 (N ..  Ms) : A

A1 .. ;! ; . N . : A (iii) ; . . N : A1 ; N .. Ms : A (iv) ; =) (N . ) : A ; =) 0 (N ..  Ms) : A

Proof. Admissibility of the rules (i) and (ii) follows by simultaneous structural

induction on M and Ms respectively and admissibility of the rules (iii) and (iv) follows by simultaneous structural induction on N . and N .. respectively. For example, the transformation below proves the case where N .. = snd(N1.. ).

; . . N1.. : x : A2 :A3 ; . . snd(N1.. ) : fst(N1.. )=x]A3 2 E # ;

fst(N1.. )=x]A3

;! snd(N1.. ) Ms : A 2 L x:A2 :A3 ; ;! snd ( Ms ) : A .. N1

; . . N1.. : x : A2 :A3 ; =) 0 (N1..  snd(Ms)) : A

(iv)

t u

Theorem 4. . derives ; . N . : A i  derives ; =) (N .) : A.

Proof. Immediate by using the lemma before and the identity ( (N . )) = N . . t u

So the proof search problem of  is equivalent to the proof search problem of  , and in the latter calculus search may be performed as for  . 6

Conclusions and Related Work

Extending notation used in 4] for a sequent calculus capturing the rst-order intuitionistic normal deductions, based on the work of Herbelin 5] whose motivation was a type system with good normalisation properties for -terms with explicit substitutions, we have devised sequent calculi for the typable normal forms of the dependent type theories  and  . These sequent calculi are such that permutations in the order of inference rules in derivations change  term extracts and thus constitute good bases for proof search in  and  . We conjecture that these ideas extend to type theories allowing weak  -types (as opposed to the strong  -types used in  ) and sum types (as for example in theories presented in 13, 12]) by following techniques similar to those in 4] for dealing with existential quantiers and disjunction. Pym and Wallen address in 9] the proof search problem of  . They base their investigations on a sequent calculus L complete for the typable normal terms of  . This calculus L is then rened in two ways: i) indeterminates are introduced to cope with the choice of terms in the rule L, leading to the calulus U  ii) U 's search space is quotiented by observing that some permutations in its derivations leave unchanged their  -term extract and thus, when searching for typable terms, it suces to nd a representative of each of the classes so generated. Our sequent calculus  allows no permutations: any permutation in the inferences of a  -derivation changes the  -term extract. In 10, 11] Pym proposes two resolution calculi for proof search in  . Each of these calculi, besides rule I , allows a resolution rule (the resolution rule in one of the calculi being a particular case of the other resolution rule) that essentially combines instances of E and axioms. These calculi deal only with types in clausal form and their completeness relies on the fact that all types can

be put into such clausal form. The ideas employed in developing these calculi fall short when the theories considered allow types that cannot be put in the required clausal form. Using unication and resolution ideas, Dowek in 3] presents a method to nd all typable long  -normal terms of the -cube type systems, and in particular those of P , a calculus essentially corresponding to  . Again this method requires the types to be in a clausal form which makes its extension to other theories problematic. Pfenning in 7] denes the calculus  , as well as a state logic (intended to describe an interpreter of Elf) extending it. As a fragment of this state logic one may devise a sequent calculus for the typable normal terms of  very close to  : in the state logic, formulae of the form ; N1 2 A1  N2 2 A2 (called A1 immediate implications) correspond to Ms-judgements ; ;! Ms : A2 of  , N1 0 where N2 can be viewed as the composition (N1  Ms) of N1 and Ms. References 1] Barendregt, H.: Lambda calculi with types. In Abramsky, S. and Gabbay, D., eds., Handbook of Logic in Computer Science 2 (Oxford Unversity Press, 1993), 117-309 2] de Bruijn, N.: A survey of the project AUTOMATH. In Seldin, J. and Hindley, J., eds., To H. B. Curry, essays in Combinatory Logic, -calculus and formalism (Academic Press, 1980), 579-606 3] Dowek, G.: A complete proof synthesis method for the cube of type systems. J. Logic and Computation 3 (1993) 287-315 4] Dyckho, R., Pinto, L.: A permutation-free sequent calculus for intuitionistic logic Res. Rep. CS/96/9, from \http://www-theory.dcs.st-and.ac.uk/ rd/" (1996) 5] Herbelin, H.: A -calculus structure isomorphic to sequent calculus structure. In Pacholsky, L., Tiuryn, J., eds., Proc. 1994 Conf. on Comp. Sci. Logic, Springer LNCS 933 (1995) 61-75 6] Harper, R., Honsell, F., Plotkin, G.: A framework for dening logics. J. Association for Computing Machinery 40 (1993) 143-184 7] Pfenning, F.: Elf: A language for logic denition and veried metaprogramming. In Proc. 4th Symp. on Logic in Comp. Sci. (1989) 8] Pfenning, F.: Logic programming in the LF logical framework. In Huet, G., Plotkin, G., eds., Logical Frameworks, (Cambridge University Press, 1991) 149-181 9] Pym, D., Wallen, L.: Proof-search in the  -calculus. In Huet, G., Plotkin, G., eds., Logical Frameworks, (Cambridge University Press, 1991) 309-340 10] Pym, D.: Proofs, search and computation in general logic. Ph.D. thesis, University of Edinburgh (1990) 11] Pym, D.: A note on the proof theory of the  -calculus. Studia Logica 54 (1995) 175-207 12] Swaen, M.: The logic of rst order intuitionistic type theory with weak sigmaelimination. J. Symbolic Logic 56 (1991) 467-483 13] Troelstra, A., van Dalen, D.: Constructivism in mathematics: an introduction vol. 2. (North-Holland, 1988)