Quick viewing(Text Mode)

Linear Higher-Order Pre-Unification

Linear Higher-Order Pre-Unification

Linear Higher-Order Pre-Unification

Iliano Cervesato and Frank Pfenning∗ Department of Carnegie Mellon University Pittsburgh, PA 15213-3891 {iliano|fp}@cs.cmu.edu

Abstract for pre-unification in a linear λ-calculus which conser- vatively extends the ordinary simply-typed λ-calculus We develop an efficient representation and a pre- and could be used directly for the above languages. unification in the style of Huet for the linear An example will shed some light on the novel issues →−◦&> λ-calculus λ which includes intuitionistic func- brought in by linearity. A rewrite rule r : t1 =⇒ t2 is → −◦ tions ( ), linear functions ( ) , additive pairing (&), applicable to a t if there is an instance of t1 in and additive unit (>). Applications lie in proof search, t; then, applying r has the effect of replacing it with programming, and logical frameworks based on lin- t2 (assume t1 and t2 ground, for simplicity). This is ear type theories. We also show that, surprisingly, a often formalized by writing t = t˜[t1], where the rewrit- similar pre-unification algorithm does not exist for cer- ing context t˜ is a term containing a unique occurrence tain sublanguages. of a hole ([ ]) so that replacing the hole with t1 yields t. We can then express r as the parametric transition T [t1]=⇒T[t2], where T is a standing for a 1 Introduction context. The applicability of r toatermt reduces to the problem of whether t and the higher- Linear logic [10] enriches more traditional logical for- order (Tt1), where T is viewed as a func- malisms with a notion of consumable resource, which tional variable, are unifiable. Traditional higher-order provides direct means for expressing and reasoning unification does not take into consideration the linear- about mutable state. Attempts at mechanizing this ity constraint that exactly one occurrence of t1 must be additional expressive power led to the design of several abstracted away from t. Indeed, matching (Tt1)with logic programming languages based on various frag- (ct1 t1) has four solutions: ments of linear logic. The only new aspect in the T ←− λx. c t1 t1 T ←− λx. c x t1 operational semantics of most proposals, such as Lolli T ←− λx. c x x T ←− λx. c t1 x [15], Lygon [12] and Forum [22], concerns the man- agement of linear context formulas [3]. In particular, But the first match in the box does not have any hole the instantiation of logical variables relies on the tra- (the variable x) in it while the second contains two. ditional unification , in their first- or higher- Linear unification, on the other hand, returns correctly order variants, depending on the language. More re- only the two unboxed solutions. This means also that cent proposals, such as the language of the linear log- the natural encoding of a rewrite system based on ical framework LLF [2,4]andthesystemRLF [17], rewriting contexts in the logical framework in LF is introduce linearity not only at the level of formulas, unsound, while it would be adequately represented in but also within terms. Consequently, implementations LLF . of these languages must solve higher-order The introduction of linear term languages in LLF on linear terms in order to instantiate existential vari- and RLF has been motivated by a number of ap- ables. In this paper we present a complete algorithm plications. Linear terms provide a statically check- ∗ able notation for natural deductions [17] or sequent This work was supported by NSF Grant CCR-9303383. The derivations [4] in substructural . In the realm of second author was supported by the Alexander-von-Humboldt- Stiftung when working on this paper, during a visit to the De- programming languages, linear terms naturally model partment of Mathematics of the Technical University Darmstadt. computations in imperative languages [4] or

This extended abstract has been accepted at the Twelfth Annual Symposium on Logic in Computer Science - LICS’97,Warsaw, Poland, June 29th – July 2nd 1997. Types: A ::= a Terms: M ::= c | x | A1 → A2 | λx:A. M | M1 M2 (intuitionistic functions) ˆ | A1 −◦ A 2 | λx:A. M | M1 ˆM2 (linear functions) | A1 & A2 |hM1,M2i|fst M | snd M (additive pairs) |> |hi (additive unit) Signatures: Σ ::= ·|Σ,c:A Contexts: Γ ::= ·|Γ,x:A

Figure 1. Syntax of λ→−◦&>

of moves in games [2]. When we want to specify, manip- the simply-typed variant of the term language of LLF ulate, or reason about such objects (which is common and shares similarities with the calculus proposed in in logic and the theory of programming languages), [1]. Its theoretical relevance derives from the fact that then internal linearity constraints are critical in prac- it is the largest linear λ-calculus that admits unique tice (see, for example, the first formalizations of cut- long βη-normal forms. elimination in linear logic and type preservation for The principal contributions of this work are: (1) Mini-ML with references [4]). a first solution to the problem of linear higher-order Differently from the first-order case, higher-order → unification, currently a major obstacle to the imple- unification in Church’s simply typed λ-calculus λ is mentation of logical frameworks and logic program- undecidable and does not admit most general unifiers ming languages relying on a linear higher-order term [11]. Nevertheless sound and complete (although possi- language; (2) the definition of a new representation bly non-terminating) procedures have been proposed in technique for generic λ-calculi that permits both sim- order to enumerate solutions [18]. In particular, Huet’s ple meta-reasoning and efficient implementations; (3) pre-unification algorithm [16] computes unifiers in a the elegant and precise presentation of an extension of non-redundant manner as constraints and has there- Huet’s pre-unification procedure as a system of infer- fore been adopted in the implementation of higher- ence rules. More details on the topics covered in this order logic programming languages [23]. Fragments of → extended abstract can be found in the technical reports λ of practical relevance for which unification is de- [6] and [5]. cidable and yields most general unifiers have also been discovered. An example are Miller’s higher-order pat- Our presentation is organized as follows. In Sec- →−◦&> terns [21], that have been implemented in the higher- tion 2, we define λ andgiveanequivalent order constraint logic programming language Elf [25]. formulation better suited for our purposes. The Unification in the context of linear λ-calculi has re- pre-unification algorithm is the subject of Section 3. ceived limited attention in the literature and, to our We study the unification problem in sublanguages of →−◦&> knowledge, only a restricted fragment of a multiplica- λ and hint at the possibility of a practical im- tive language has been treated [19]. Unification in λ→ plementation in Section 4. In order to facilitate our with linear restrictions on existential variables has been description in the available space, we must assume the studied in [26]. reader familiar with traditional higher-order unifica- tion [16] and linear logic [10]. In this extended abstract, we investigate the unifi- cation problem in the linear simply-typed λ-calculus λ→−◦&>. We give a pre-unification procedure in the style of Huet and discuss the new sources of non- 2 A Linear Simply-Typed λ-Calculus determinism due to linearity. Moreover, we show that no such algorithm can be devised for linear sublan- guages deprived of > and of the corresponding con- structor. λ→−◦&> corresponds, via a natural extension This section defines the simply-typed linear λ- of the Curry-Howard , to the fragment of calculus λ→−◦&> (Section 2.1) and presents an equiva- intuitionistic linear logic freely generated from the con- lent formulation, S→−◦&> (Section 2.2), which is more nectives →, −◦ ,&and>, which constitutes the propo- convenient for describing and implementing unifica- sitional core of Lolli [15] and LLF [4]. λ→−◦&> is also tion.

2 λ con λ lvar λ ivar Γ; ·`Σ,c:A c : A Γ; x:A `Σ x : A Γ,x:A;·`Σ x:A

λ unit (No elimination rule for >) Γ; ∆ `Σ hi : >

Γ; ∆ `Σ M : A Γ; ∆ `Σ N : B Γ; ∆ `Σ M : A & B Γ; ∆ `Σ M : A & B λ pair λ fst λ snd Γ; ∆ `Σ hM,Ni : A &B Γ; ∆ `Σ fst M : A Γ; ∆ `Σ snd M : B ` 0 00 Γ; ∆,x:A Σ M :B Γ; ∆ `Σ M : A −◦ B Γ; ∆ `Σ N : A λ llam λ lapp 0 00 Γ; ∆ `Σ λxˆ :A. M : A −◦ B Γ; ∆ , ∆ `Σ M ˆN : B

Γ,x:A;∆`Σ M : B Γ; ∆ `Σ M : A → B Γ; ·`Σ N :A λ ilam λ iapp Γ; ∆ `Σ λx:A. M : A → B Γ; ∆ `Σ MN:B

Figure 2. Typing in λ→−◦&>

2.1 Basic Formulation this judgment are displayed in Figure 2. Deleting the terms that appear in them results in the usual rules for The linear simply-typed λ-calculus λ→−◦&> extends the (→−◦&>) fragment of intuitionistic linear logic, →−◦ > Church’s λ→ with the three type constructors −◦ ( mul- ILL & [15], in a style formula- →−◦ > →−◦ > tiplicative arrow), & (additive product)and>(additive tion. λ & and ILL & are related by a form of unit), derived from the identically denoted connectives the Curry-Howard isomorphism. Note that the inter- of linear logic. The language of terms is augmented ac- actions of rules λ unit and λ lapp can flatten distinct →−◦ > cordingly with constructors and destructors, devised proofs to the same λ & term. from the natural deduction style inference rules for The reduction semantics of λ→−◦&> is given by the these connectives. Although not strictly necessary at transitive and reflexive of the congruence rela- this level of the description, the inclusion of intuition- tion built on the following β-reduction rules: istic constants will be convenient in the development of fst hM, Ni−→M (λxˆ :A. M)ˆN −→ [ N/x]M the discussion. Figure 1 presents the resulting gram- snd hM, Ni−→N (λx:A. M) N −→ [ N/x]M mar in a tabular format that relate each type construc- → →−◦ > tor (left) to the corresponding term operators (center), Similarly to λ , λ & enjoys a number of highly with constructors preceding destructors. As usual, we desirable properties [2]. In particular, since every ex- rely on signatures and contexts to assign types to con- tension (for example with ⊗ and multiplicative pairs) stants and free variables, respectively. Here x, c and introduces commutative conversions, it is the largest a range over variables, constants and base types, re- linear λ-calculus for which strong normalization holds spectively. In addition to the names displayed above, and yields unique normal forms. We write Can(M) we will often use N, B and ∆ for objects, types and for the canonical form of the term M, defined as the contexts, respectively. η-expansion of its β-normal form. For reasons of effi- The notions of free and bound variables are adapted ciency, we will often refer to the weak head-normal form from λ→. As usual, we identify terms that differ only of a term M, written M,thatdiffersfromCan(M)by in the name of their bound variables and write [M/x]N the possible presence of redices in the arguments of for the capture-avoiding of M for x in the applications. Notice that x corresponds to the η-long term N. Contexts and signatures are treated as mul- form of the variable x. In the following, we will insist tisets; we promote “,” to denote their union and omit in dealing always with fully η-expanded terms. We call writing “·” when unnecessary. Finally, we require vari- a term of base type atomic. ables and constants to be declared at most once in a context and in a signature, respectively. 2.2 The Spine Calculus The typing judgment for λ→−◦&> has the form ` Γ; ∆ Σ M : A Unification algorithms base a number of choices on where Γ and ∆ are called the intuitionistic and the the nature of the heads of the terms to be unified. The linear context, respectively. The inference rules for head is immediately available in the first-order case,

3 and still discernible in λ→ since every η-long normal λ→−◦&> to terms in S→−◦&>, and vice versa [6]. Space term has the form constraints do not allow presenting this mapping and the proofs of soundness and completeness for the re- λx1 :A1. ...λxn:An.tM1 ...Mm spective typing derivations. We instead describe it by where the head t is a constant or a variable and means of examples by giving the translation of the β- (tM1 ...Mm) has base type. The usual parentheses reduction rules of λ→−◦&> into S→−◦&>: saving conventions hide the fact that t is indeed deeply hU, V i·(π S) −→ U · S buried in the of application and therefore not 1 S h U, V i·(π S) −→ V · S immediately accessible. A similar notational trick fails 2 S →−◦ > ( λxˆ :A. U) · (V ˆ; S) −→ [ V/x]U ·S in λ & since on the one hand a non-atomic term S (λx:A. U) · (V ; S) −→ S [ V/x]U ·S can have several heads (e.g. c1 and c2 in hc1,c2i), pos- →−◦ > sibly none (e.g. hi), and on the other hand destructors The trailing spine in the reductions for S & is a can be interleaved arbitrarily in an atomic term (e.g. consequence of the fact that this language reverses the →−◦ > fst ((snd c)ˆxy)). nesting order of λ & destructors. The structure of The spine calculus S→−◦&> [6] permits recovering roots in the spine calculus makes one more β-reduction both efficient head accesses and notational convenience. rule necessary, namely: →−◦&> Every atomic term M of λ is written in this (H · S) · nil −→ S H · S presentation as a root H · S,whereHcorresponds →−◦ > As for λ & , we insist on terms being in η-long to the head of M and the spine S collects the se- form. Consequently, roots have always base type and so quence of destructors applied to it. For example, do the target types in the spine typing judgment. The M =(tM ...M ) is written U = t · (U ; ...U ;nil) 1 m 1 m β-reduction rules above preserve long forms so that η- in this language, where “;” represents application, nil expansion steps never need to be performed [6]. We identifies the end of the spine, and U is the translation i write Can(U)andU, respectively, for the canonical of M . Application and “;” have opposite associativ- i form and the weak head-normal form of the term U ity so that M is the innermost subterm of M while 1 with respect to these reductions. U1 is outermost in the spine of U. This approach was suggested by an empirical study of higher-order logic programs based on λ→ terms [20] and is reminiscent 3 Linear Higher-Order Unification of the notion of abstract B¨ohm trees [14]; its practi- cal merits in our setting are currently assessed in an In this section, we define the unification problem experimental implementation. The following grammar for S→−◦&> (Section 3.1), show a few examples (Sec- →−◦ > describes the syntax of S & : we write construc- tion 3.2), describe a pre-unification algorithmalaHuet ` →−◦ > tors as in λ & , but use new symbols to distinguish for it (Section 3.3), and discuss new sources of non- a spine operator from the corresponding term destruc- determinism introduced by linearity (Section 3.4). tor. Terms: U ::= H · S Spines: S ::= nil 3.1 The Unification Problem | λx:A. U | U; S | ˆ | →−◦&> λx:A. U Uˆ; S Two S terms U1 and U2 are equal if they |h i|| U1,U2 π1Sπ2Scan be β-reduced to a common term V .Bystrong |hi normalization and the Church-Rosser [6], it Heads: H ::= c | x | U suffices to compute Can(U1) and Can(U2)andcheck whether they are syntactically equal (modulo renaming We adopt the same syntactic conventions as in λ→−◦&> of bound variables). We have the following equality and often write V for terms in S→−◦&>.Termsareal- judgments for terms and spines, respectively: lowed as heads in order to construct β-redices. Indeed, ` ` normal terms have either a constant or a variable as Γ; ∆ Σ U1 = U2 : A Γ; ∆ Σ S1 = S2 : A>a their heads. The typing judgments for terms and spines The types can be omitted altogether if we assume the are denoted Γ; ∆ `Σ U : A and Γ; ∆ `Σ S : A>B two objects in every we start from to have respectively, where the latter expresses the fact that the same type. We do not show the deduction rules given a head H of type A,therootH·Shas type B. for these judgments. The interested reader can extract For reasons of space, we omit the typing rules for these them from the non-flexible cases in Figures 4 or con- judgments [6], although they will indirectly appear in sult [5]. the inference system for pre-unification. Equality checking becomes a unification problem There exists a structural translation of terms in as soon as we admit objects containing logical vari-

4 Equation systems: Ξ ::= ·|Ξ,(Γ; ∆ ` U1 = U2 : A) | Ξ, (Γ; ∆ ` S1 = S2 : A>a)

Flex-flex systems: Ξff ::= ·|Ξff,(Γ; ∆ ` F1 · S1 = F2 · S2 : a) Substitutions: Θ ::= ·|Θ,U/F Pools: Φ ::= ·|Φ,F:A

Figure 3. Syntax of Equations

ables (sometimes called existential variables or meta- or spine equation ξ can be interpreted as an equality variables), standing for unknown terms. The equalities judgment with signature Σ, Φ, where again Φ includes above, called equations in this setting, are unifiable the logical variables appearing in ξ. In the following, if there exists a substitution for the logical variables we will occasionally view an equation system Ξ as the which makes the two sides equal. These substitutions multiset of the equality judgments corresponding to its are called unifiers.Thetaskofaunification procedure equations. Finally, we write dom Θ for the domain of is to determine whether equations are solvable and, the substitution Θ and Θ ◦ Θ0 for the composition of if so, report their unifiers. As for λ→, it is undecid- substitutions Θ and Θ0, defined as usual. able whether two S→−◦&> terms can be unified, since its equational theory is a conservative extension of the 3.2 Examples equational theory for the simply-typed λ-calculus. Logical variables stand for heads and cannot replace The example given in the introduction clearly shows spines or generic terms. Therefore, the alterations to →−◦&> how linearity restricts the set of solutions found by tra- the definition of S required for unification are ditional higher-order unification in the absence of linear limited to enriching the syntax of heads with logical constructs. We can indeed rewrite this example in the variables, that we denote F , G and H possibly sub- syntax of λ→−◦&> (chosen over S→−◦&> for the sake of scripted. We continue to write U, V and S for terms clarity) as the following equation and spines in this extended language. In order to avoid confusion we will call the proper variables of S→−◦&> ·; ·`FˆM=cˆMˆM:a. parameters in the remainder of the paper. As we saw, only two of the four independent solutions The machinery required in order to state a unifica- returned by traditional higher-order unification on the → tion problem is summarized in Figure 3. We will in corresponding λ problem are linearly valid. general solve systems of equations that share the same More complex situations rule out the simple minded signature and a common set of logical variables. A so- strategy of keeping only the linearly valid solutions re- lution to a unification problem is a substitution that, turned by a traditional unification procedure on a lin- when applied to it, yields a system of flex-flex equa- ear problem. Consider the following equation, written tions that is known to be solvable. This notion sub- again in the syntax of λ→−◦&> for simplicity, sumes unifiers as a particular case. Finally, we record x:A, y : B; ·`Fˆxˆy=cˆ(G xy)ˆ(G xy):a. the types of the logical variables in use in a pool. 1 2 The parameters x and y are intuitionistic, but F uses We assume that variables appear at most once in a them as linear objects. We must instantiate F to a pool and in the domain of a substitution. Similarly to term of the form λxˆ 0 :A. ˆλy0 : B. cˆM ˆM where each contexts, we treat equation systems and pools as multi- 1 2 of the linear parameters x0 and y0 must appear either sets. We write ξ for individual equations. The context in M or in M , but not in both. Indeed, the following Γ; ∆ in an equation ξ enumerates the parameters that 1 2 four incomparable substitutions are generated: the substitutions for logical variables appearing in ξ are 0 0 0 0 not allowed to mention directly. Therefore, legal sub- F ←− λxˆ :A. ˆλy :B. c ˆ (F1ˆx ˆy ) ˆ F2 0 0 0 0 stitution terms U for a variable F : A must be typable F ←− λxˆ :A. ˆλy :B. c ˆ (F1ˆx ) ˆ (F2ˆy ) · ·` ˆ 0 ˆ 0 0 0 in the empty context, i.e. ; Σ,Φ U:Ashould be F ←− λx :A. λy :B. c ˆ (F1ˆy ) ˆ (F2ˆx ) derivable where Φ includes the logical variables appear- ˆ 0 ˆ 0 0 0 F ←− λx :A. λy :B. c ˆ F1 ˆ (F2ˆx ˆy ) ing in U. This is sometimes emphasized by denoting → an equation system Ξ as ∀Σ. ∃Φ. ∀(Ξ), where the inner Traditional unification on the analogous λ equation expression means that the context Γ; ∆ of every equa- is unitary and would return the single substitution 0 0 0 0 0 0 tion ξ is universally quantified in front of it. A term F ←− λx :A. λy : B. c (F1 x y )(F2 x y).

5 which is not linearly valid. This example also illus- the sides of a canonical equation ξ of base type can be trates one reason why linear term languages and unifi- only either rigid or flexible, we have four possibilities: cation are useful. Linearity constraints rule out certain unifiers when compared to the simply-typed formula- Rigid-Rigid Iftheheadofbothsidesofξis the same tion of the same expression, which can be used to elim- constant or parameter, we unify the spines. inate ill-formed terms early. Rigid-Flex We reduce this case to the next by swap- ping the sides of the equation. 3.3 A Pre-Unification Algorithm Flex-Rigid Consider first the equation Γ; ∆ ` F · S1 = c · S2 : a where the head c is a constant. Our adaptation of Huet’s pre-unification procedure Solving this equation requires instantiating F to →−◦&> to S is summarized in Figures 4–6. We adopt atermV that, relatively to spine S1,hascas its a structured operational semantics presentation as a head; the resulting spines are then unified as in system of inference rules, which isolates and makes the rigid-rigid case. We can construct V in two every step of the algorithm explicit. Although more manners: the first, imitation, puts c in the proper verbose than the usual formulations, it is, at least in position in V and rearranges the terms appearing this setting, more understandable and closer to an ac- in S1 in order to match the type of c. The second, tual implementation. In this subsection, we describe projection, looks for some subterm that might be the general structure of the algorithm. We will dis- instantiated, via β-reduction, to c inside S1 and in- cuss the specific aspects brought in by linearity in the stalls it as the appropriate head of V , again reshuf- Section 3.4. fling S1 to match its type. Once V has been pro- On the basis of the above definitions, a unification duced, it is substituted for every occurrence of F problem is expressed by the following judgment: in the equation system and weak head-reduction is performed. The pair V/F is added to the current Ξ \ Ξff , Θ substitution. Flex-rigid equations with a parame- where, for the sake of readability, we keep the signa- ter as their rigid head are treated similarly except ture Σ and the current variable pool Φ implicit. The that imitation cannot be applied since parameters procedure we describe accepts Σ, Φ and Ξ as input are bound within the scope of logical variables. arguments and attempts to construct a derivation X GivenanequationΓ;∆ ` F·S1 =c·S2 :a, of Ξ \ Ξff , ΘforsomeΘandΞff. This could terminate the construction of the instantiating term V in the successfully (in which case Θ is a unifier if Ξff is empty, and only a pre-unifier otherwise). It might also fail (in case of imitation is described in the upper part of which case there are no unifiers) or not terminate (in Figure 5. The judgment 0 0 ι which case we have no information). Γ ;∆ ` cB ·S2 /A⇑ S1 ,→V Given a system of weak head-normal equations Ξ to builds the constructors layer of V on the basis of be solved with respect to a signature Σ and a logical the type A of F and of the spine S2. Here, B variables pool Φ, the procedure selects an equation ξ isthetypeofc.AsVis constructed, the lo- from Ξ and attempts to apply in a bottom up fashion cal parameters bound by linear and intuitionis- one of the rules in Figure 4. If several rules are appli- tic λ-abstraction (rules fri llam and fri ilam)are cable, the procedure succeeds if one of them yields a stored in the accumulators Γ0 and ∆0 respectively. solution. If none applies, we have a local failure. The When A has the form A1 & A2 (rules fri pair1 procedure terminates when all equations in Ξ are flex- and fri pair2), V must be a pair hV1,V2i and S2 flex, as described below. must start with a projection. The subterm Vi that Well-typed equations in weak head-normal form is projected away can be arbitrary as long as it has 0 0 have a very disciplined structure. In particular, both type Ai and uses up all local parameters in Γ ;∆; sides must either be roots, or have the same top-most this is achieved by means of the variable raising term or spine constructor. Spine equations and non- judgment discussed below. When a base type is atomic term equations are therefore decomposed until eventually reached (rule fri con), the right-hand problems of base type are produced, as shown in the side c · S2 of the original equation is accessed, the uppermost and lowermost parts of Figure 4, respec- constant c is installed as the head of V and its tively. spine S is constructed by reshuffling the arguments Following the standard terminology, we call an present in S2 and inserting the local parameters atomic term H · S rigid if H is a constant or a pa- accumulated in Γ0;∆0.ThespineSis built by the rameter, and flexible if it is a logical variable. Since judgment

6 Term t raversal

Ξ \ Ξ ff , Θ Ξ, (Γ; ∆ ` U1 = V1 : A), (Γ; ∆ ` U2 = V2 : B) \ Ξff , Θ pu unit pu pair Ξ, (Γ; ∆ `hi=hi : >) \ Ξff , Θ Ξ, (Γ; ∆ `hU1,U2i =hV1,V2i : A&B)\Ξff,Θ ` \ Ξ,(Γ; ∆,x:A U =V :B) Ξff,Θ Ξ , (Γ,x:A;∆ ` U =V :B)\Ξff ,Θ pu llam pu ilam Ξ, (Γ; ∆ ` λxˆ :A. U = λxˆ :A. V : A −◦ B ) \ Ξ ff , Θ Ξ, (Γ; ∆ ` λx:A. U = λx:A. V : A → B) \ Ξff , Θ ...... Rigid−Rigid c : A in ΣΞ,(Γ; ∆ ` S1 = S2 : A>a)\Ξff,Θ pu rr con Ξ, (Γ; ∆ ` c · S1 = c · S2 : a) \ Ξff , Θ

Ξ, (Γ; ∆ ` S1 = S2 : A>a)\Ξff,Θ Ξ,(Γ,x:A;∆ ` S1 =S2 :A>a)\Ξff,Θ pu rr lvar pu rr ivar Ξ, (Γ; ∆,x:A ` x·S1 =x·S2 :a)\Ξff ,Θ Ξ, (Γ,x:A;∆ ` x·S1 =x·S2 :a)\Ξff ,Θ ...... Rigid−Flex

Ξ, (Γ; ∆ ` F · S2 = c · S1 : a) \ Ξff , Θ Ξ, (Γ; ∆ ` F · S2 = x · S1 : a) \ Ξff , Θ pu rf con pu rf var Ξ, (Γ; ∆ ` c · S1 = F · S2 : a) \ Ξff , Θ Ξ, (Γ; ∆ ` x · S1 = F · S2 : a) \ Ξff , Θ ...... Flex−Rigid ι F : A in Φ c:B in Σ ·; ·`cB·S2/A⇑ S1 ,→V [V/F](Ξ, (Γ; ∆ ` F · S1 = c · S2 : a)) \ Ξff , Θ pu fr con imit Ξ, (Γ; ∆ ` F · S1 = c · S2 : a) \ Ξff , (Θ,V/F)

π F:A in Φ c:B in Σ ·; ·`A⇑ S1,→V [V/F](Ξ, (Γ; ∆ ` F · S1 = c · S2 : a)) \ Ξff , Θ pu fr con proj Ξ, (Γ; ∆ ` F · S1 = c · S2 : a) \ Ξff , (Θ,V/F)

π F:A in Φ ·; ·`A⇑ S1,→V [V/F](Ξ, (Γ; ∆,x:B ` F ·S1 =x·S2 :a)) \ Ξff , Θ pu fr lvar proj Ξ, (Γ; ∆,x:B ` F ·S1 =x·S2 :a)\Ξff,(Θ,V/F)

π F:A in Φ ·; ·`A⇑ S1,→V [V/F](Ξ, (Γ,x:B;∆ ` F ·S1 = x·S2 : a)) \ Ξff , Θ pu fr ivar proj Ξ, (Γ,x:B;∆ ` F ·S1 =x·S2 :a)\Ξff,(Θ,V/F) ...... Flex−Flex pu ff Ξff \ Ξff , ·

Spine traversal Ξ \ Ξff , Θ pu nil Ξ, (Γ; ·`nil = nil : a>a)\Ξff,Θ

Ξ,(Γ; ∆ ` S1 = S2 : A1 >a)\Ξff,Θ Ξ,(Γ; ∆ ` S1 = S2 : A2 >a)\Ξff,Θ pu fst pu snd Ξ, (Γ; ∆ ` π1S1 = π1S2 : A1 & A2 >a)\Ξff,Θ Ξ, (Γ; ∆ ` π2S1 = π2S2 : A1 & A2 >a)\Ξff,Θ 0 00 Ξ,(Γ; ∆ ` U1 = U2 : A1), (Γ; ∆ ` S1 = S2 : A2 >a)\Ξff,Θ pu lapp 0 00 Ξ, (Γ; ∆ , ∆ ` U1ˆ; S1 = U2ˆ; S2 : A1 −◦ A 2 >a)\Ξff,Θ

Ξ,(Γ; ·`U1=U2:A1),(Γ; ∆ ` S1 = S2 : A2 >a)\Ξff,Θ pu iapp Ξ, (Γ; ∆ ` U1; S1 = U2; S2 : A1 → A2 >a)\Ξff,Θ

Figure 4. Pre-Unification in S→−◦&>, Equation Manipulation

0 0 ι Γ ;∆ ` B ↓ S2 ,→S and fri iapp to construct appropriate η-long argu- ments with new logical variables as heads applied by mimicking the structure of S . Notice the use 0 0 2 to the parameters in Γ ;∆. of the variable raising judgment in rules fri lapp

7 Imitation−term construction 0 Γ; ∆ ` A ↓ι S ,→ S fri con 0 ι Γ; ∆ ` cA · S /a⇑ nil ,→ c · S ι ι Γ; ∆ ` u/A1 ⇑ S,→V1 Γ; ∆ ` A2 ,→ V2 Γ; ∆ ` u/A2 ⇑ S,→V2 Γ; ∆ ` A1 ,→ V1 fri pair2 fri pair2 ι ι Γ; ∆ ` u/A1 &A2 ⇑ π1S,→hV1,V2i Γ; ∆ ` u/A1 &A2 ⇑ π2S,→hV1,V2i ι Γ; ∆,x:A ` u/B ⇑ S,→V Γ,x:A;∆ ` u/B ⇑ι S,→V fri llam fri ilam Γ; ∆ ` u/A−◦ B ⇑ ι U ˆ; S,→λxˆ :A. V Γ; ∆ ` u/A→B ⇑ι U;S,→λx:A. V ...... Imitation−spine construction fri nil Γ; ·`a↓ιnil ,→ nil

ι 0 ι 0 Γ; ∆ ` A1 ↓ S ,→ S Γ; ∆ ` A2 ↓ S ,→ S fri fst fri snd ι 0 ι 0 Γ; ∆ ` A1 & A2 ↓ π1S ,→ π1S Γ; ∆ ` A1 & A2 ↓ π2S ,→ π2S 0 0 00 0 Γ; ∆ ` B ↓ι S ,→ S Γ; ∆ ` A,→V Γ; ∆ ` B ↓ι S ,→ S Γ; ·`A,→V fri lapp fri iapp 0 00 0 0 Γ; ∆ , ∆ ` A −◦ B ↓ι U ˆ; S ,→ V ˆ; S Γ; ∆ ` A → B ↓ι U; S ,→ V ; S

Projection−term construction Γ; ∆ ` A ↓π a,→S Γ,x:A;∆ ` A↓π a,→S frp lvar frp ivar Γ; ∆,x:A ` a⇑π nil ,→ x · S Γ,x:A;∆ ` a⇑π nil ,→ x · S

π π Γ; ∆ ` A1 ⇑ S,→V1 Γ; ∆ ` A2 ,→ V2 Γ; ∆ ` A2 ⇑ S,→V2 Γ; ∆ ` A1 ,→ V1 frp pair1 frp pair2 π π Γ; ∆ ` A1 & A2 ⇑ π1S,→hV1,V2i Γ; ∆ ` A1 & A2 ⇑ π2S,→hV1,V2i π Γ; ∆,x:A ` B ⇑ S,→V Γ,x:A;∆ ` B ⇑π S,→V frp llam frp ilam Γ; ∆ ` A −◦ B ⇑ π U ˆ; S,→λxˆ :A. V Γ; ∆ ` A → B ⇑π U; S,→λx:A. V ...... Projection−spine construction frp nil Γ; ·`a↓πa,→nil

π π Γ; ∆ ` A1 ↓ a,→S Γ; ∆ ` A2 ↓ a,→S frp fst frp snd π π Γ; ∆ ` A1 & A2 ↓ a,→π1S Γ; ∆ ` A1 & A2 ↓ a,→π2S 0 00 Γ; ∆ ` B ↓π a,→S Γ; ∆ ` A,→V Γ; ∆ ` B ↓π a,→S Γ; ·`A,→V frp lapp frp iapp 0 00 Γ; ∆ , ∆ ` A −◦ B ↓π a,→Vˆ;S Γ; ∆ ` A → B ↓π a,→V;S

Figure 5. Pre-Unification in S→−◦&>, Generation of Substitutions

The construction of V inthecaseofprojection, heads (rule raise root) and the parameters ac- displayed in the lower part of Figure 5, is simi- cumulatedinΓ0;∆0 in the corresponding spines. larexceptthatitsspineSis built on the basis Notice that functional types yield new local pa- of the type A of the projected parameter (rules rameters (rules raise llam and raise ilam). The frp lvar and frp ivar). This leads to a form of spines themselves are constructed by means of the non-determinism for product types not present in judgment the case of imitation (rules frp fst and frp snd). Γ0;∆0 ` a,→S, A which builds a spine S mapping heads of type The purpose of the variable raising judgment A to roots of type a by rearranging non- 0 0 Γ ;∆ ` A,→V, deterministically the parameters present in Γ0;∆0. displayed in Figure 6, is to produce an η-long Flex-Flex Similarly to λ→, a system composed term V of type A with new logical variables as its uniquely of flex-flex equations is always solvable

8 Constructors Γ; ∆ ` a,→S, A raise root Γ; ∆ ` a,→F·S

Γ; ∆ ` A1 ,→ V1 Γ; ∆ ` A2 ,→ V2 raise unit raise pair Γ; ∆ `>,→hi Γ; ∆ ` A1 & A2 ,→hV1,V2i Γ; ∆,x:A ` B,→V Γ,x:A;∆ ` B,→V raise llam raise ilam Γ; ∆ ` A −◦ B,→λxˆ :A. V Γ; ∆ ` A → B,→λx:A. V ...... Spines raise nil ·; ·`a,→nil,a Γ; ∆ ` a,→S, B Γ; ∆ ` a,→S, B raise lapp raise iapp Γ; ∆,x:A ` a,→(xˆ;S),A−◦ B Γ,x:A;∆ ` a,→(x;S),A→B

Figure 6. Pre-Unification in S→−◦&>, Raising Variables

in S→−◦&>. Indeed, every logical variable F in it D is a derivation of the judgment J, and [Θ]Ξ for the can be instantiated to a term VF consisting of a result of applying the substitution Θ to each equation layer of constructors as dictated by the type of in Ξ. F , but with every root set to Ha ·hiˆ;nil (i.e. →−◦&> Theorem 3.1 (Soundness of linear pre-unification) Haˆhi in λ ), where Ha is a common new logical variable of type >−◦a,foreachbasetype If X :: Ξ \ Ξff , Θ and there is a substitution Θff such a. Then, after normalization, every equation ξ that the multiset of equality judgments [Θff ]Ξff has a reduces to Γξ;∆ξ ` Ha ·hiˆ;nil = Ha ·hiˆ;nil : a derivation, then [Θff ◦ Θ]Ξ is derivable.

which is linearly valid, although extensionally solv- X 2 able only if a ground substitution term for each Proof: By induction on the structure of . needed H can indeed be constructed. When this a Note that it is not difficult to generalize this pro- situation is encountered, the procedure terminates cedure to full unification (as, for example, in [27]), al- with success, but without instantiating the logical though we fail to see its practical value. variables appearing in it. The substitution con- structed up to this point, called a pre-unifier,is Theorem 3.2 (Completeness of linear pre-unification) returned. Given a system of equations Ξ and a substitution Θ The possibility of achieving an algorithmsala ` such that [Θ]Ξ has a derivation, there are substitutions 0 Huet depend crucially on flex-flex equations being Θff and Θ ,andasystemofflex-flexequationsΞff such 0 0 always solvable. If this property does not hold, as that Θ=(Θff ◦Θ)|domΘ,and[Θff ]Ξff and Ξ \ Ξff , Θ →−◦ > in some sublanguages of S & we will discuss are derivable. shortly, these equations must be analyzed with techniques similar to [18] or [21]. Proof: By induction on the structure of a multiset of derivations E~ for [Θ]Ξ excluding flex-flex equations, and The procedure we just described is not guaranteed on an appropriate measure on the image of the substi- to terminate for generic equation systems since flex- tution Θ. 2 rigid steps can produce arbitrarily complex new equa- tions. However, it is sound in the sense that if a unifier 3.4 Non-Determinism or pre-unifier is returned the system is solvable (where free variables are allowed in the second case). It is also Huet’s pre-unification algorithm for λ→ is inher- non-deterministically complete, i.e., every solution to ently non-deterministic since unification problems in the original system is an instance of a unifier or pre- this language usually do not admit most general uni- unifier which can be found with our procedure. These fiers. Indeed, when solving flex-rigid equations, we may properties are expressed by the below. De- have to choose between imitation and projection steps tailed proofs can be found in [5]. We write D :: J if and, in the latter case, we might be able to project on

9 different arguments. The presence in S→−◦&> of a lin- yond the scope of this paper (see Section 4.2 for further ear context and of constructs that operate on it gives discussion; a similar technique is used in [13]). rise to a number of new phenomena not present in λ→ unification. 4 Discussion First of all, the manner equations are rewritten in Figure 4 is constrained by the usual context man- In this section, we consider various sublanguages of agement policy of linear logic. In particular, linear →−◦&> →−◦&> heads in rigid-rigid equations are removed from the S (or equivalently λ ) obtained by elid- context prior to unifying their spines (rule pu rr lvar). ing some of the type operators and the corresponding Moreover, when simplifying equations among pairs, term constructors and destructors (Section 4.1). We the linear context is copied to the two subproblems also discuss problems and sketch solutions towards the hi efficient implementation of a unification procedure for (pu pair), and equations involving can always be →−◦&> elided (pu unit). Finally, when solving spine equa- λ (Section 4.2). tions, the linear context must be distributed among the linear operands (pu lapp)sothatitisempty 4.1 Sublanguages when the end of the spine is reached (pu nil). As expected, equations among intuitionistic operands are The omission of one or more of the type operators created with an empty linear context (pu iapp). Con- →, −◦ ,&and>and of the corresponding term con- text splitting in rule pu lapp represents a new form structs from λ→−◦&> (or S→−◦&>) results in a number of non-determinism not present in Huet’s algorithm. of λ-calculi with different properties. Standard techniques of lazy context management [3] First of all, the elision of −◦ ,&and>reduces can however be used in order to handle it efficiently λ→−◦&> to λ→. The few applicable rules in Figures and deterministically in an actual implementation. 4–5 constitute then a new presentation of Huet’s pro- A new inherent form of non-determinism arises in cedure. The combined use of inference rules and of the generation of the spine of substitution terms. Re- a spine calculus results in an elegant formulation that call that such a term V is constructed in two phases: can be translated almost immediately into an efficient first, we build its constructor layer, recording local in- implementation. tuitionistic and linear parameters in two accumulators Since linear objects in λ→−◦&> are created and con- Γ0 and ∆0, respectively, as λ-abstractions are intro- sumed by linear abstraction and application, respec- duced (first and third parts of Figure 5). Then, we tively, every sublanguage not containing −◦ is purely construct a spine on the basis of the available type intuitionistic. In particular, λ→& coincides with the informations (second and fourth quarter of Figure 5), simply-typed λ-calculus with pairs while λ→&> cor- installing a fresh logical variable as the head of ev- responds to its extension with a unit type and unit ery operand. The contents of Γ0 and ∆0 must then element. Unification in the restricted setting of higher- be distributed as if they were contexts. In particu- order patterns has been studied for these two languages lar, we must split ∆0 among the linear operands (rules in [8] and [9], respectively. The appropriate restric- fri llam and frp llam) so that, when the end of spine tions of the rules in Figures 4–6 implement a general is generated, no linear parameter is left (rules fri nil pre-unification procedure for these calculi. and frp nil). Lazy strategies are not viable in gen- The languages λ→−◦& and λ→−◦ are particularly eral this time because the heads of these operands are interesting since the natural restriction of our pre- logical variables. Therefore, we must be prepared to unification procedure is unsound for them in the fol- non-deterministically consider all possible splits. lowing sense: We cannot apply our success criterion This situation is illustrated by the equation since not all flex-flex equations are solvable in this set- ting. Consider, for example, x:A, y : B; ·`Fˆxˆy=cˆ(G1xy)ˆ(G2 xy):a. ·` discussed in Section 3.2. An imitation step instanti- x: A, y : B; Fˆx=Gˆy:a. ˆ 0 ˆ 0 ates F toatermoftheformλx :A. λy :B. cˆM1ˆM2 This equation has no solution since F must be instan- where each of the linear parameters x0 and y0 must tiated with a term that, after β-reduction, will use ex- appear either in M1 or in M2, but not in both. This plicitly x,andGto a term that must mention y.Fur- produces the four solutions presented in Section 3.2. thermore, whether a flex-flex equation has a solution An actual implementation would avoid this additional in λ→−◦& or λ→−◦ is in general undecidable, since, for non-determinism by postponing the choices between example, F ˆM1 = F ˆM2 is equivalent to the generic the four imitations. A detailed treatment of the nec- unification problem M1 = M2. The situation is clearly essary constraints between variables occurrences is be- different in λ→−◦&> where hi is always available as an

10 information sink in order to eliminate unused linear Despite these difficulties, the natural generalization parameters. However, the usual assumption that there of the notion of higher-order pattern introduced by [8] exist closed terms of every type may not be reasonable and [9] for products to the linear case, leads to a decid- in λ→−◦&>,andcaremustbetakenineachapplica- able unification problem for λ→−◦&>. On this fragment tion regarding the treatment of logical variables which (whose description is beyond the scope of the present may have no valid ground instances. In conclusion, paper), termination of the pre-unification algorithm in pre-unification procedures in the sense of Huet are not Section 3 is assured if we also incorporate an appropri- achievable in the calculi with −◦ but without >. ate occurs-check as in the simply-typed case. Branch- Finally, a restricted form of unification in the purely ing can furthermore be avoided by maintaining linear linear calculus λ−◦ has been studied in [19]. The above flex-flex equations as constraints and by using addi- counterexamples clearly apply also in this setting, but tional constraints between occurrences of parameters. we have no result about the decidability of higher-order In the first example above, the solution would be 0 0 0 unification in this fragment. F ←− λxˆ :a. cˆ(F1ˆx )ˆ(F2ˆx ) 0 0 with the additional constraint that if x occurs in F1ˆx 4.2 Towards a Practical Implementation 0 then it must be absorbed (by hi)inF2ˆx and vice versa [13]. The second equation above would simply be post- Huet’s algorithm for pre-unification in λ→ has been poned as a solvable equational constraint. Based on implemented in general proof search engines such as our experience with constraint simplification in Elf [25] Isabelle [24] and logic programming languages such as and preliminary experiments, we believe that this will λProlog [23] and shown itself to be reasonably efficient be a practical solution. In particular, the use of explicit in practice. However, the non-determinism it intro- substitutions, investigated in [7] relatively to Elf, seems duces remains a problem, especially in logic program- to provide a hook for the required linearity constraints. ming. This issue is exacerbated in λ→−◦&> due to its additional resource non-determinism during imitation and projections. 5 Conclusion and Future Work For λ→ , this problem has been addressed by Miller’s language of higher-order patterns Lλ [21], which allows In this extended abstract, we have studied the prob- occurrences of logical variables to be applied to distinct lem of higher-order unification in the context of the lin- →−◦ > parameters only. This syntactic restriction guarantees ear simply typed λ-calculus λ & . A pre-unification decidability and most general unifiers. An algorithm algorithm in the style of Huet has been presented →−◦ > that solves equations in the pattern fragment but post- for the equivalent spine calculus S & and new pones as constraints any non Lλ constraint has been sources of inherent non-determinism due to linearity →−◦ > successfully implemented in the higher-order logic pro- were pointed out. Moreover, sublanguages of λ & gramming language Elf [25]. Unfortunately, an anal- were analyzed and it was shown that pre-unification ogous restriction for λ→−◦&> which would cover the procedures are not achievable for some of them. situations arising in practice does not admit most gen- We are currently investigating the computational eral unifiers. A simple example illustrating this is properties of the natural adaptation of Miller’s higher- order patterns to λ→−◦&>. Preliminary examples show x:a; ·`Fˆx=cˆ(F1ˆx)ˆ(F2ˆx):a. that many common unifiable equations do not have which has the two most general solutions most general unifiers due to non-trivial interferences ←− ˆ 0 0 hi ←− ˆ 00 hi F λx :a. cˆ(F1ˆx )ˆ(H2 ˆ ),F2 λx :a. H2ˆ among −◦ ,&and>. However, we believe that these ←− ˆ 0 hi 0 ←− ˆ 00 hi F λx :a. cˆ(H1ˆ )ˆ(F2 ˆx ),F1 λx :a. H1ˆ problems can be solved through constraint simplifica- neither of which is an instance of the other. This situ- tion and propagation techniques in a calculus of explicit ation is common and occurs in several of our case stud- substitutions. ies. For certain flex-flex pattern equations, the set of most general unifiers cannot even be described finitely References in the language of patterns, as illustrated by x:a, y : a; ·`Fˆhx, yi = Gˆxˆy : a. [1] A. Barber. Dual intuitionistic linear logic. Techni- for which the generic solution cal Report ECS-LFCS-96-347, Laboratory for Founda- tions of Computer Sciences, University if Edinburgh, F ←− λwˆ :a&a. H ˆhH1ˆ(fst w)ˆhi,H2ˆ(snd w)ˆhii ←− ˆ ˆ h hi hii Sept. 1996. G λu:a. λv : a. H ˆ H1 ˆuˆ ,H2ˆvˆ [2] I. Cervesato. A Linear Logical Framework.PhDthe- yields one pattern substitution for each possible instan- sis, Dipartimento di Informatica, Universit`a di Torino, tiation of the new logical variable H. Feb. 1996.

11 [3] I. Cervesato, J. S. Hodas, and F. Pfenning. Efficient [16] G. Huet. A unification algorithm for typed λ-calculus. resource management for linear logic proof search. In Theoretical Computer Science, 1:27–57, 1975. R. Dyckhoff, H. Herre, and P. Schroeder-Heister, ed- [17] S. Ishtiaq and D. Pym. A relevant analysis of natural itors, Proceedings of the 5th International Workshop deduction, Dec. 1996. Manuscript. on Extensions of Logic Programming, pages 67–81, [18] D. C. Jensen and T. Pietrzykowski. Mechanizing ω- Leipzig, Germany, Mar. 1996. Springer-Verlag LNAI order through unification. Theoretical 1050. Computer Science, 3:123–171, 1976. [4] I. Cervesato and F. Pfenning. A linear logical frame- [19] J. Levy. Linear second-order unification. In work. In E. Clarke, editor, Proceedings of the Eleventh H. Ganzinger, editor, Proceedings of the Seventh Inter- Annual Symposium on Logic in Computer Science, national Conference on Rewriting Techniques and Ap- pages 264–275, New Brunswick, New Jersey, July plications, pages 332–346, New Brunswick, New Jer- 1996. IEEE Computer Society Press. sey, July 1996. Springer-Verlag LNCS 1103. [5] I. Cervesato and F. Pfenning. Linear higher-order pre- [20] S. Michaylov and F. Pfenning. An empirical study of unification, 1997. the runtime behavior of higher-order logic programs. [6] I. Cervesato and F. Pfenning. A linear spine calcu- In D. Miller, editor, Proceedings of the Workshop on lus. Technical Report CMU-CS-97-125, Department of the λProlog Programming Language, pages 257–271, Computer Science, Carnegie Mellon University, Pitts- Philadelphia, Pennsylvania, July 1992. University of burgh, PA, Apr. 1997. Pennsylvania. Available as Technical Report MS-CIS- [7] G. Dowek, T. Hardin, C. Kirchner, and F. Pfenning. 92-86. Unification via explicit substitutions: The case of [21] D. Miller. A logic programming language with higher-order patterns. In M. Maher, editor, Proceed- lambda-abstraction, function variables, and simple ings of the Joint International Conference and Sym- unification. In P. Schroeder-Heister, editor, Proceed- posium on Logic Programming, pages 259–273, Bonn, ings of the International Workshop on Extensions of Germany, Sept. 1996. MIT Press. Logic Programming, pages 253–281, T¨ubingen, Ger- [8] D. Duggan. Unification with extended patterns. Tech- many, 1989. Springer-Verlag LNAI 475. nical Report CS-93-37, University of Waterloo, Water- [22] D. Miller. A multiple-conclusion specification logic. loo, Ontario, Canada, July 1993. Revised March 1994 Theoretical Computer Science, 165(1):201–232, 1996. and September 1994. [23] G. Nadathur and D. Miller. An overview of λProlog. In [9] R. Fettig and B. L¨ochner. Unification of higher-order K. A. Bowen and R. A. Kowalski, editors, Fifth Inter- patterns in a simply typed lambda-calculus with finite national Logic Programming Conference, pages 810– products and terminal type. In H. Ganzinger, editor, 827, Seattle, Washington, Aug. 1988. MIT Press. Proceedings of the Seventh International Conference [24] T. Nipkow and L. C. Paulson. Isabelle-91. In D. Kapur, editor, Proceedings of the 11th International on Rewriting Techniques and Applications, pages 347– Conference on Automated Deduction, pages 673–676, 361, New Brunswick, New Jersey, July 1996. Springer- Saratoga Springs, NY, 1992. Springer-Verlag LNAI Verlag LNCS 1103. 607. System abstract. [10] J.-Y. Girard. Linear logic. Theoretical Computer Sci- [25] F. Pfenning. Logic programming in the LF logical ence, 50:1–102, 1987. framework. In G. Huet and G. Plotkin, editors, Logi- [11] W. D. Goldfarb. The undecidability of the second- cal Frameworks, pages 149–181. Cambridge University order unification problem. Theoretical Computer Sci- Press, 1991. ence, 13:225–230, 1981. [26] C. Prehofer. Solving Higher-Order Equations: From [12] J. Harland and D. Pym. A uniform proof-theoretic Logic to Programming. PhD thesis, Technische Uni- investigation of linear logic programming. Journal of versit¨at M¨unchen, Mar. 1995. Logic and Computation, 4(2):175–207, Apr. 1994. [27] W. Snyder and J. H. Gallier. Higher order unification [13] J. Harland and D. Pym. Resource distribution via revisited: Complete sets of transformations. Journal boolean constraints. In W. McCune, editor, Proceed- of Symbolic Computation, 8(1-2):101–140, 1989. ings of the Fourteenth International Conference on Automated Deduction — CADE-14, Townsville, Aus- tralia, July 1997. To appear. [14] H. Herbelin. S´equents qu’on calcule: de l’interpr´eta- tion du calcul des s´equents comme calcul de lambda- termes et comme calcul de strat´egies gagnantes.PhD thesis, Universit´e Paris 7, 1995. [15] J. Hodas and D. Miller. Logic programming in a frag- ment of intuitionistic linear logic. Information and Computation, 110(2):327–365, 1994. A preliminary version appeared in the Proceedings of the Sixth An- nual IEEE Symposium on Logic in Computer Science, pages 32–42, Amsterdam, The Netherlands, July 1991.

12