Top Banner
15

Comparing λ-calculus translations in sharing graphs

May 13, 2023

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Comparing λ-calculus translations in sharing graphs

Comparing �-calculus translations inSharing Graphs ?Andrea Asperti1 and Cosimo Laneve21 Dip. di Matematica, P.za di Porta S. Donato, 5, 40127 Bologna, Italy.2 INRIA Sophia Antipolis, 2004 Route des Lucioles BP 93, 06902 Valbonne, France.Abstract. Since Lamping's seminal work [Lam90] on optimal graph re-duction techniques for the �-calculus, several di�erent translations basedon the same set of control operators (sharing graphs) have been proposedin the literature [GAL92a, GAL92b, AL93a, As94]. In this paper we clar-ify the correspondence between all these translations, passing throughthe so called bus-notation [GAL92a]. Indeed all the sharing graph en-codings turn out to be equivalent modulo the way of counting bus levels.1 IntroductionIn [Lam90], Lamping proposed a complex graph reduction technique for the�-calculus that was optimal in the sense of L�evy [Le78]. Lamping's approachwas revisited in [GAL92a], where a restricted set of control nodes and reductionrules was proved su�cient for the implementation. In [GAL92b] Gonthier-Abadi-L�evy pointed out a strong analogy between optimal reductions and Linear Logic[Gi86]. In particular, the optimal implementation of �-calculus is actually a re-�nement of Girard's proof-net representation. This re�nement just provides alocal implementation of the non-linear operations over shared data (nets intoboxes), which in proof-nets are performed as a single, global step. By their en-coding of Linear Logic in sharing graphs, and some encoding of �-calculus inLinear Logic, a third (slightly di�erent) translation was implicitly obtained. Thisencoding has been used (and explicited) in [AL93a], in the much more generalcase of Interaction Systems.At the same time of [GAL92b], Asperti proposed yet another and sensiblydi�erent translation of �-calculus into sharing graphs [As94]. This latter transla-tion is strongly connected to the dynamic algebra interpretation of Linear Logic[Re92, DR93] (a relation that has been recently formalized in [ADLR94]).Up to now, no correspondence has been established in the literature betweenall these di�erent translations. In this paper we prove that such di�erences maybe explained, up to minor syntactic details, by the way of counting the nesting ofboxes into proof-nets. Precisely, the innermost box into a proof-net may be con-sidered as a box at \depth 0" or a box at \depth n", if there are n outer boxes.In order to formalize this intuition, we shall use a further sharing graph imple-mentation of �-calculus: the so-called bus-notation [GAL92a]. The bus notation? Partially supported by the ESPRIT Basic Research Project 6454 - CONFER.

Page 2: Comparing λ-calculus translations in sharing graphs

2was introduced with the aim of reducing the number of interaction rules betweencontrol nodes. This is achieved by considering edges as set of wires (buses) andan n-indexed control node as a�ecting the n-th wire only. The above conventionsfor counting nestings of boxes are re ected into the two ways of counting wires:\from the left" or \from the right". So, if we have k + 1 wires in the bus, anda node on a wire, this node can be seen as an operator at level n (assuming nwires on the right) or k � n (when counting from the left).The two di�erent choices underlie respectively the translations in [As94] and[GAL92b], which therefore are mapped onto the same sharing graph in the busnotation. This also explains why exactly the same set of rewriting rules worksin both cases.We remark that this work could have been written in the framework of proofnets [Gi86]. Indeed the results presented here could be transposed to proof netswithout any di�culty. We choose to stick to �-calculus for simplicity sake.We warn the reader that some general knowledge of the literature (in partic-ular [GAL92a] and [As94]) is a prerequisite for understanding this paper.2 Sharing GraphsIn [GAL92a] it was proved that Lamping's original set of operators (nodes)needed for the optimal implementation of �-calculus could be reduced to only�ve (indexed) control nodes, described in the following picture:(erasing) (croissant) (bracket) (fan)(root) n n nActually, only three of them (fan, croissant and bracket) are really important.The fan node represents sharing (or duplication), while croissant and bracketsare needed for the correct interaction of fans during the reduction. In Lamping'soriginal intuition, brackets and croissants must surround fans, implicitly de�ningtheir scope. Two di�erent kinds of \brackets" are needed, since they propagate inopposite directions. This is essentially equivalent to consider brackets and crois-sants as delimiting the extent of the box of Linear Logic (recall that the boxis just a sort of global bracket surrounding a datum that can be duplicated orerased) (see [GAL92a, GAL92b]). This relation was furtherly stressed in [As94],where a tight relation between croissant, bracket and the two categorical oper-ations associated with the comonad \!" of Linear Logic was proved.Erasing nodes are needed in the case of lambda abstractions over variablesnot appearing in the body of the function; until we do not consider garbagecollection rules, these nodes have no operational e�ect.In [AL93a] it was shown that all these control nodes could be considered asan abstract set of operators for implementing sharing in virtually every class ofhigher order rewriting systems. This suggested the name of \sharing graphs",that we shall adopt in the following.

Page 3: Comparing λ-calculus translations in sharing graphs

3The rules governing the interactions between control operators are drawn inFigure 1. We shall also explicitly consider two \proper nodes", for applicationj � 1ji j � 1i ji i i j jiji

ii j i jj i iiij ij ii ij j + 1iji ii ij i iii j ji

j + 1 j + 1Fig. 1. The control rules (0 � i < j)and lambda abstraction. @�(abstraction) (application)The abstraction and application nodes are ternary nodes, i.e. they are connectedto three edges. In particular, in the case of abstraction nodes, one edge pointsto the root, one to the body of the function, and the third one to the boundvariable. Thus, bound variables are supposed to be explicitly connected to theirbinders (an idea that goes back 7to Bourbaki).As shown in [GAL92a], application and lambda nodes are not actually nec-essary, since from the operational point of view they can be assimilated to fan.Note in particular that the interaction between an application and an abstrac-tion amounts to connect the root of the application to the root of the body ofthe function, and the bound variable to the argument of the application.For the sake of clarity, we prefer to keep the distinction; however we shallnot explicitly draw the interaction rules between proper operators and controlnodes, that are exactly the same as for fans.

Page 4: Comparing λ-calculus translations in sharing graphs

43 The box representationThe somewhat puzzling number of di�erent translations of �-calculus in sharinggraphs is actually due to a double level of indeterminacy. Accepting the fact thatthe main problem is the optimal encoding of the box of Linear Logic [GAL92b],the �rst and evident choice is about di�erent encodings of �-calculus in LinearLogic. Up to now, two possible encodings have been investigated in the literature,respectively based on the type isomorphismsD �=!(D( D) andD �= (!D)( D.The �rst one is adopted in [GAL92a], since it was closer to Lamping's originalapproach. The second one, is suggested by the \traditional" embedding of in-tuitionistic implication by means of linear implication [Gi86]. Both choices giverise to optimal implementations, due to the optimal implementation of the un-derlying Linear Logic (and many other encodings of �-calculus into Linear logicwould work as well). This level of indeterminacy in the translation is quite clear,and, actually is orthogonal to the subject of the paper. In the following we shallnot consider it: in order to �x the ideas, we shall work with the more familiartype isomorphism D �= (!D)( D.The second and more important choice is about the representation of thebox in sharing graph. The translation function of [As94] is the function G inFigure 2(a) 3. Remark that, according to the de�nition of Gn, the box on theargument of the application is raised of one level w.r.t. the surrounding world.In [GAL92b] the box is \simulated" by adding a bracket of index 0 in front of0 0G0(M)G(M) = F(M)(b)(a)Fig. 2. The translation functions G and Fits principal port (leaving the box at the same level of the context). This choiceis described by the translation function F of Figure 4.Note that the operational behaviour is sensibly di�erent in the two cases.In particular, in [As94], the (external) control operators which are propagatinginside the box are at a lower level than the (operators inside the) box. The con-trary happens in [GAL92b] where the square bracket of index 0 on the principal3 Warning: in Figures 3 and 4, when the implementation of �xM is de�ned, we haveassumed that x 2 fv(M). The case x 62 fv(M) follows by connecting an erasing nodeto the port of the abstraction representing the bound variable.

Page 5: Comparing λ-calculus translations in sharing graphs

5nGn(x) = � n nnGn(M ) Gn+1(N )Gn(MN ) =Gn(�xM ) = Gn(M )n @ nFig. 3. The implementation of [As94]1F(x) = 1F(M) F(N)F(MN) = 01 1F(�xM) = 0F(M)0 @ 0�Fig. 4. The implementation of [GAL92b]port of the box has the e�ect to raise the level of incoming control operators,avoiding their con ict with inner operators proper to the box. Due to this con-sideration, it can appear a bit surprising that exactly the same set of rewritingrules works in both cases. Moreover, apart the above informal discussion on theidea underlying the two box representations (i.e. their di�erent ways to avoidcon icts), there is a priori no much evidence of a formal correspondence betweenthem.This is the main problem we shall address in this paper; to this purpose, weneed to recall an interesting and odd notation, introduced in [GAL92a]: the busnotation.4 The bus notationA more explicit graph notation is obtained by interpreting edges in the systemsG(M ) and F(M ) as buses, namely set of wires. In this view, an i-indexed nodeis considered as an operator acting on the wire at depth i. For instance:

Page 6: Comparing λ-calculus translations in sharing graphs

6i becomes ijij j ii becomesi becomeswhere j - means a bus of width j. The rules governing the interaction of controlnodes in the bus notation are depicted in Figure 5. Remark that no interactionFig. 5. The interactions of control nodes in the bus notationbetween croissants or brackets on di�erent wires is de�ned. This because the busnotation eliminates such commutations. Nevertheless it is not clear how muchit is gained in e�ciency with buses, since interactions of fans are no more localbut concern every wire of the bus.5 The bus notation of the translation FTrying an encoding ad literam through buses of the translation F , we imme-diately realize that we cannot �x a priori the dimension of the bus. This is incontrast with what happens in [GAL92a] where the bus has always dimension3; we shall come back soon to this point. For the moment, after having �xedsome wire \0", we shall suppose to have an in�nite numbers of wires at its left.The resulting translation is de�ned by the function BF in Figure 6 (note thatBF (M ) is exactly the bus-counterpart of F(M )). Remark that BF(M ) uses a�nite number of wires. This number depends on the syntactical structure of theterm; precisely we exactly need an extra-wire at the left every time we have a(nested) application. Alternatively we may add an index to the translation F ,mimicking the de�nition of G. This index expresses now the number of extra-wires required to the left of the term (see Figure 10).

Page 7: Comparing λ-calculus translations in sharing graphs

7� @BF(x) =BF(�xM) = BF(M) BF(N)BF (M)BF(MN) =1 1 1

1 111Fig. 6. The bus encoding of the function FThe reader will have probably noted another di�erence w.r.t. to [GAL92a]:the dimension of the bus at the root of the term is di�erent from its dimensionat free variables (in particular, it augments of 1). However, this is merely aconsequence of the di�erent encoding of �-calculus in Linear Logic and we shallnot furtherly discuss this point.It is possible to avoid the in�nite (or, in any case, growing) number of wiresneeded during the translation by introducing suitable operators (square brackets)on the leftmost wire. The resulting translation BFGAL is described in Figure 7.Remark that, in BFGAL, the bus has always dimension two at the root of a (sub)term, and 3 at its free variables. This is actually the way followed in [GAL92a].The main di�erence with [GAL92a] is in the rule for the application, since BFGALputs a box in the second argument of the application, whilst in [GAL92b] it wason the rule for abstraction. The purpose of the two brackets added on the leftmostwire is exactly that of \absorbing" and \recreating" the extra-wire required bythe box.The correspondence between BF and BFGAL is established by Theorem 10below. Few preliminary properties about BFGAL are required. We say that a nodeis at level n if, once �xed the direction for counting wires, the node is located onthe n-th wire.Proposition1. Let us �x a right-to-left numbering of wires. In the translationBFGAL, the nodes located on the leftmost wire never change the level of othernodes through interactions.This is an immediate consequence of the shape of the rules in Figure 5.Proposition2. Let G be a graph obtained by evaluating �-terms translated ac-cording to BFGAL. Only brackets may appear on the leftmost wires of G. Moreoversuch nodes will always remain on the leftmost wire till they disappear.

Page 8: Comparing λ-calculus translations in sharing graphs

8@BFGAL(M)BFGAL(�xM) = BFGAL(M) BFGAL(N)BFGAL(x) = BFGAL(MN) =�Fig. 7. The translation function BFGALAlso this property is immediate because it is true initially, and it is obviouslypreserved by the reduction rules in Figure 5.Let a deadlock be two nodes, one in front of the other, that do not interact,namely no rule of Figure 5 applies. Remark that Proposition 2 guarantees theabsence of deadlocks on the leftmost wires of BFGAL(M ) or graphs obtained by itsevaluation. Indeed, the nodes on leftmost wires are brackets and two brackets,one in front of the other, can be simpli�ed by the second rule of Figure 5.De�nition3. The graphs obtained by evaluating BF (M ) and BFGAL(M ) arerelated by the following function {:{ { : BF(M ) ! BFGAL(M ) is de�ned by structural induction. It is immediatewhen M is a variable or an abstraction. When M =M 0M 00, let {0 and {00 themappings on the graphs for M 0 and M 00. Let us de�ne { for the nodes andthe wires which aren't in the domains of {0 and {00. The application node, thecontrol nodes at level 0 or 1 and the wires at level 0 of BF (M ) are mappedinto the corresponding nodes of BFGAL(M ). The wire at level k, k � 1, of thebus departing from the second argument of the application node of BF(M )is mapped onto a path of BFGAL(M ) traversing the bracket at level 1. Thewires at level 2 representing free variables of BF (M 00) are mapped onto thepath traversing the bracket and outgoing from the right-branch. Those atlevel k, k � 3 are mapped onto the path traversing the bracket and outgoingthe left-branch;{ Suppose to have established a correspondence { between a graph G obtainedby evaluating BF (M ) and a graph G0 resulting from BFGAL(M ) and let G0 )F 0. If this reduction involves a bracket on the leftmost wire, then the samecorrespondence { relates G and F 0. Otherwise the redex contracting G0 ) F 0has a counter-image in G (namely it is a redex of the same type). Let G) F

Page 9: Comparing λ-calculus translations in sharing graphs

9be the contraction of such a redex. The mapping {0 between F and F 0 isde�ned by changing { according to the redex �red.Lemma4. The correspondence { of De�nition 3 between the evaluations of BF (M )and of BFGAL(M ) is well-de�ned.Proof: Suppose to have a correspondence { between G and G0 obtained fromBF(M ) and BFGAL(M ), respectively, and such that there is a bijection betweenredexes not involving brackets on the leftmost wires of G0.Therefore a rewriting not involving the leftmost wire may be performed bothin G and G0. A rewriting, let us say r, involving the leftmost wire concerns onlyG0. But r does not modify { for the following reasons:1. r does not change the level of nodes located on wires di�erent from theleftmost (by Proposition 1);2. r does not duplicate the nodes on wires di�erent from the leftmost (since,by Proposition 2, there are only brackets on leftmost wires).Remark. We recall that, in sharing graphs, brackets and croissants are usedonly with the purpose to guarantee the correct matching of fans and abstrac-tions/applications (namely guaranteeing their correct interaction). Observe thatLemma 4 implies that such matchings are performed in the same way both inBF and BFGAL.An immediate consequence of the foregoing lemma is stated by the followingcorollary.Corollary5. The implementations BF(M ) and BFGAL(M ) always reduce inter-actions of application-abstraction nodes and between fans which are in corre-sponding positions of the graphs, where the correspondence is �xed by the func-tion { of De�nition 3.Therefore the interactions of fans and applications/abstractions is completelyunsensible to the removal of leftmost brackets in BFGAL(M ). Corollary 5 �xes asyntactic correspondence between BF (M ) and BFGAL(M ) which is quite strong,since it ensures that the amount of sharing performed by fans is the same both inBF(M ) and BFGAL(M ). Below we show that this correspondence is also semantics,where with \semantics" we mean the interpretation of a sharing graph G, namelythe �-term associated to G. To this aim we recall from [GAL92a] the notion ofconsistent path, which is the basic brick for the semantics of sharing graphs.De�nition6. Let a context be a term generated by the following grammar:a ::= 2 j � �a j � �a j ha; biThe semantics of control nodes is given by relations on sequences of contexts asdescribed by the following picture:The semantics of abstraction and application nodes may be de�ned in terms offans, by using the equations in Figure 9.Let ' be a path into a sharing graph (with the bus notation). We say that' is consistent if

Page 10: Comparing λ-calculus translations in sharing graphs

10a bha; bi 2ca bj ia c� � b a b cj ia c� � bFig. 8. The semantics of control nodes@ ij j i �j i j i==Fig. 9. The interpretation of application and abstraction nodes in terms of fans1. every (edge of every) wire of ' is labeled by a context;2. every pair of consecutive wires satisfy the constraints in Figure 8.De�nition7. Let G be a sharing graph (in the bus notation). Let Rij be therelation on pairs (d; d0), where d and d0 are sequence of contexts, and (d; d0) 2 Rijif and only if there exists a consistent path ' connecting the root nodes i andj and such that the context at i is d and the context at j is d0. The contextsemantics of G, denoted C(G), is the set of relations Rij, where i and j are rootnodes.Theorem8. The context semantics of BF(M ) and BFGAL(M ) is invariant bysharing graph reductions. Namely, let G be a sharing graph obtained by evaluatingBF (M ) or BFGAL(M ), if G) G0 then C(G) = C(G0).Proof: Because the rewriting rules of Figure 5 do not change the initial and�nal contexts of consistent paths traversing the redexes.In [GAL92a] the semantics of a sharing graph is de�ned by reading-back theB�ohm-tree of a �-term. This tree is obtained by taking only the consistent pathsroot-to-root 4. The following lemma states that these paths are the same bothin BF (M ) and BFGAL(M ), up-to some brackets on leftmost wires of paths inBFGAL(M ), which nevertheless do not a�ect consistency.4 In the more general setting of proof-nets, we may take the execution formula asthe semantics of a proof net. This is obtained by the consistent paths root-to-root(see [DR93, ADLR94]).

Page 11: Comparing λ-calculus translations in sharing graphs

11Lemma9. For every root-to-root consistent path in BFGAL(M ), the correspond-ing path in BF (M ) { where the \correspondence" is �xed by { in De�nition 3 {is root-to-root and consistent, and vice versa.Proof: Let ' be a consistent path in BFGAL(M ) and be its counter-imageaccording to the embedding of Lemma 4. Remark that we are considering everyconsistent path, not only those starting and �nishing at root-nodes. The case ofroot-to-root consistent paths follows easily. We assume that, for every section ofthe bus in BFGAL(M ), the corresponding section in BF(M ) has a strictly largerwidth. This may be easily obtained by taking enough wires \on the left" in theencoding BF(M ).We prove, by induction on the length of , that ' is consistent. In particular,if the width of ' at a given section is k and the width of at the correspondingsection is n (n � k) then1. the context of the i-th wire, 0 � i < k � 1 is the same both in ' and ;2. the context of ' of the (k � 1)-th wire is h� � � han�1; an�2i � � �ak�1i and thecontext of the i-th wire of , k � 1 � i � n � 1, is ai.Remark: since we are taking paths ' which are images, according to {, ofpaths in BF (M ), ' never terminates at a bracket on the leftmost wire. Thebasic case has two subcases: (a) when ' is a bus in between two nodes whicharen't brackets on the leftmost wires (and ' does not traverse any other node)and (b) when ' traverses exactly one bracket on the leftmost wire. These twocases are easy and left to the reader.When = 0 � u, let '0 be the (consistent) path corresponding to 0 andw be the image of u. If w is a single edge (it does not traverse a bracket onthe leftmost wire) u terminates at a node which is not on the leftmost wire,the statement of the induction is easy. Indeed the decision how to lengthen '0depends on the context at the wire where it is placed the �nal node of '0 (whichcannot be a bracket on the leftmost wire, by de�nition of { { see De�nition 3 {).Otherwise w = w0 �w00 and let b be the bracket on the leftmost wire traversedby w. There are two subcases:1. w0 enters from the principal port of the bracket. Since the width of the busu is greater than the corresponding width of w lengthening 0, the contextlabeling the leftmost edge of w0, let us say the k-th, must have the shapeha; bi. Hence, by hypothesis, b must mark the k-th wire of u and a storesthe contexts of u at wires k + 1, k + 2, etc. It is clear that '0 � w0 may beconsistently lengthened with w00.2. w0 enters from an auxiliary port of the bracket. This case is an easy conse-quence of the inductive hypothesis.The vice versa may be proved in the same way.Theorem10. The implementations BFGAL(M ) and BF are syntactically and se-mantically equivalent. This equivalence is up-to brackets on leftmost wires, whichare inessential.Proof: immediate consequence of Lemma 4 and Lemma 9.

Page 12: Comparing λ-calculus translations in sharing graphs

126 The correspondence of F and GThe correspondence between F and G will be proved by reasoning again on thebus-notation. The main idea underlying our proof is: instead of counting levelsfrom right to left, we shall count them from left to right. The application ofthis criterion to the function BF gives BF;r, which is described in Figure 10 (weassume BF;r(M ) = BF;r0 (M )).� @jBF ;rj (x) = jBF ;rj (�xM) = j BF ;rj (M)BF ;rj (MN) =BF ;rj (M)j j BF ;rj+1(N)jjFig. 10. The translation BF ;rOn the other hand, the bus interpretation of G, namely BG, is illustrated inFigure 11 (as usual BG(M ) = BG0 (M )). Observe that, in the de�nition of BG ,wires are actually counted from the left to the right. We mean that, as far asbuses are concerned, the translation G implicitly uses a dual criterion w.r.t. Ffor counting levels.Remark also that BF;r di�ers from BG only for the presence of some extra-brackets at the root of the argument of an application and on bound variables.The relation between BF;r and BG may be �xed in a way similar to the corre-spondence �xed in Section 5. By mimicking De�nition 3, it is possible to de�nea mapping | from the evaluation of BG(M ) to the evaluation of BF;r(M ) whichforgets about the brackets on the rightmost wires of the implementation BF;rand of their interaction (we leave to the reader the formalization of the details).Lemma11. The above correspondence | between the evaluations of BG(M ) andof BF;r(M ) is well-de�ned.Establishing the above lemma is less obvious than for Lemma 4, because of thepresence of applications and abstractions on rightmost wires (in the situationof Lemma 4, there were only brackets on leftmost wires). In particular, what

Page 13: Comparing λ-calculus translations in sharing graphs

13� @BGj (x) = j 1j 1BGj (�xM) = BGj (M)j 1BGj (MN) = j 1 j 1BGj (M) BGj+1(N)j 1 j 1Fig. 11. The bus interpretation of the translation Gcould invalidate the lemma is the eventual presence of a deadlock between abracket and an abstraction (or application) node on the rightmost wire. Such acon�guration is forbidden by the following proposition.Proposition12. Never a bracket is in front of an abstraction or an applicationon the rightmost wires of graphs obtained evaluating BF;r(M ).Remark. This property has been already proved for the general setting of Inter-action Systems (see Lemma 8.13 in [AL94]).Proof: We prove by induction on the length of the derivation BF;r(M ) )� Gthat1. on the rightmost wires there are only abstraction, applications or brackets;2. there is always a bracket in front of a bound port of an abstraction or thesecond argument of an application;3. if on a 0-level wire there is a sequence of brackets, such a sequence maybe simpli�ed to a single bracket (by �ring instances of the second rule ofFigure 5) which is in front of a bound port of an abstraction or the secondargument of an application.Items 1, 2 and 3 are clearly true for BF;r(M ). Let us check the inductive step.That is BF;r(M ) )� G0 ) G. The interesting case is when G0 ) G is dueto the interaction of an application m and an abstraction n. Then, according tothe de�nition of the rewriting rule, the bus entering on the output port of m isconnected with the body of n and the bus entering into the bound port of n isconnected with the second argument of m. Let u and w be these new connections,respectively.

Page 14: Comparing λ-calculus translations in sharing graphs

14Now remark that the bracket which, by induction hypothesis, is in front ofthe bound port of n interacts with the bracket on the second argument of m, afterthe reduction m-n. Therefore, as far as the wire 0 of w is concerned, properties1, 2 and 3 do not change after �ring m-n. The properties 1, 2 and 3 follows easilyby induction for the wire 0 of u. It is not necessary to check the other wires,since the rewriting G0 ) G does not modify them.The statement of the lemma follows immediately from 1, 2 and 3.Lemma 14 gives a strong syntactic correspondence between the implementa-tions BG and BF;r. This relation may be lifted to the semantics, by showing theexistence of a bijection between root-to-root consistent paths in BG and BF;r.Lemma13. For every root-to-root consistent path in BF;r(M ), the correspond-ing path in BG(M ) { where the \correspondence" is �xed by | { is root-to-rootand consistent, and vice versa.The proof of this lemma is omitted, in order to meet the space requirements.Anyway the proof is similar to the one of Lemma 9, apart some di�culties due tothe presence of abstractions and applications on rightmost wires. These problemsare accommodated by means of Proposition 12.Lemma 11 and Lemma 13 imply:Theorem14. The implementations BG and BF;r are syntactically and seman-tically equivalent. This equivalence is up-to brackets on rightmost wires, whichare inessential.Remark. The above correspondence and the bus notation de�nitely clarify thatthe propagation of a control operator inside a box is the same both for F and forG. The criterion adopted for counting wires is the unique reason for the operatorsthat are propagating inside a box are at a lower level than the (nodes of) thebox in G, whilst it is the contrary in F .7 ConclusionsIn this paper we have shown the correspondence between several di�erent trans-lations of �-calculus into sharing graphs that have been proposed in the liter-ature. We did it by passing through the so called bus notation [GAL92a], andshowing that, apart from some syntactical details, the main di�erence is in thedi�erent way of reading levels of wires in the bus: from left-to-right, or fromright-to-left.Another source of di�erence of the translations is due to di�erent encodingsof �-calculus into Linear Logic, based on di�erent type isomorphisms (this topiclooks quite clear, and it has not been really addressed in this paper). Then, theseveral translations can be essentially classi�ed as follows.By this work, we get some evidence in favour of Asperti's translation, sinceit uses the minimal number of operators. However, it seems possible that the ad-ditional information provided by the extra-operators of other translations could

Page 15: Comparing λ-calculus translations in sharing graphs

15isomorphism right-to-left bus left-to-rightD �= (!D)( D [AL93a] this paper [As94]D �=!(D( D) [GAL92b] [GAL92a]Fig. 12. Classi�cation of translationsbe of some theoretical and even practical use (for instance in trying to solve thewell known and crucial problem of accumulation of control operators).References[As94] A. Asperti. Linear Logic, Comonads, and Optimal Reductions. To appear inFundamenta Informaticae, Special Issue devoted to Categories in Computer Sci-ence. 1994.[AL93a] A. Asperti, C. Laneve. Optimal Reductions in Interaction Systems. Proc. ofthe 4th Joint Conference on the Theory and Practice of Software Development,TAPSOFT'93, Orsay (France). April 1993.[AL94] A. Asperti, C. Laneve. Interaction System 2: The practice of optimal reduc-tions. May 1993. A revised version of this paper may be got by anonymous ftp atcma.cma.fr as �le pub/papers/cosimo/newIS2.ps.Z.[ADLR94] A. Asperti, V. Danos, C. Laneve, L. Regnier . Paths in the �-calculus:three years of communications without understandings. Proc. of the 9th AnnualSymposium on Logic in Computer Science (LICS 94), Paris 1994.[DR93] V. Danos, L. Regnier. Local and asynchronous beta-reduction. Proc. of the 8thAnnual Symposium on Logic in Computer Science (LICS 93), Montreal. 1993.[Gi86] J. Y. Girard. Linear Logic. Theoretical Computer Science, 50. 1986.[GAL92a] G. Gonthier, M. Abadi, J.J. L�evy. The geometry of optimal lambda reduction.Proc. of the 19th Symposium on Principles of Programming Languages (POPL 92).1992.[GAL92b] G. Gonthier, M. Abadi, J.J. L�evy. Linear Logic without boxes. Proc. of the7th Annual Symposium on Logic in Computer Science (LICS'92). 1992.[Lam90] J. Lamping. An algorithm for optimal lambda calculus reductions. Proc. ofthe 17th Symposium on Principles of Programming Languages (POPL 90). SanFrancisco. 1990.[Le78] J.J.Levy. R�eductions correctes et optimales dans le lambda-calcul. Th�ese de doc-torat d'�etat, Universit�e de Paris VII. 1978.[Re92] L. Regnier. Lambda Calcul et R�eseaux. Th�ese de doctorat, Universit�e Paris VII.1992.