Is the Optimal Implementation Ineﬃcient? Elementarily Not ∗

Sharing graphs are a local and asynchronous implementation of lambda-calculus beta-reduction (or linear logic proof-net cut-elimination) that avoids useless duplications. Empirical benchmarks suggest that they are one of the most eﬃcient machineries, when one wants to fully exploit the higher-order features of lambda-calculus. However, we still lack conﬁrming grounds with theoretical solidity to dispel uncertainties about the adoption of sharing graphs. Aiming at analysing in detail the worst-case overhead cost of sharing operators, we restrict to the case of elementary and light linear logic, two subsystems with bounded computational complexity of multiplicative exponential linear logic. In these two cases, the bookkeeping component is unnecessary, and sharing graphs are simpliﬁed to the so-called “abstract algorithm”. By a modular cost comparison over a syntactical simulation, we prove that the overhead of shared reductions is quadratically bounded to cost of the naive implementation, i.e. proof-net reduction. This result generalises and strengthens a previous complexity result, and implies that the price of sharing is negligible, if compared to the obtainable beneﬁts on reductions requiring a large amount of duplication. 1998


Intelligence of sharing graphs
Redundancy and non-locality.An ideal implementation of a functional programming language aims at satisfying two properties: sharing, i.e. to avoid the duplication of work, and locality, i.e. to be parallelisable on architectures with multiple computing agents.Although these properties are not orthogonal, a prerequisite for both is a fine-grained implementation of material duplication.Consider the λ-calculus and take for instance the β-redex T = (λx.M )(λy.N ) and assume that x occurs k + 1 times in M .In the λ-term M { λy.N x } obtained by reducing it, we have k new copies of N , and then, k additional copies of any redex in it.Also, such a reduction step cannot be fired in parallel with any reduction in N .To solve this kind of problems, we may consider switching to graph reduction.At the time

17:2
Is the Optimal Implementation Inefficient?Elementarily Not of writing, the technique is employed for instance in the Glasgow Haskell Compiler, namely by the STG-machine at its core [21], whilst its essence dates back to the early seventies [24].
The key idea can be formalised with proof-nets of linear logic (LL), where T can be expressed as in Figure 1a.With respect to the syntax tree of T we notice: the explicit connection of the λ-link with its variable x; a ?-link connecting the k + 1 occurrences of x in M ; a box (the dotted square) around the argument of the application (the @-link), to mean λy.N is a duplicable term.Such information can be equivalently formalised by associating the boxing depth to each link -e.g. the rightmost λ-link has index 1.Now, a linear-β reduction step rewrites Figure 1a to Figure 1b.The box is now shared, thus reductions in N can be performed without duplicating it.Unfortunately, this is still quite unsatisfactory.Indeed, if an occurrence of x, which is represented in the figure as a premiss of the topmost contraction ?-link, appears in argument position within M , i.e. it is linked to a @-link, then we have a "virtual β-redex".In particular, this @-link and the λ-link will form a redex, once we reduce the exponential redex between the ?-link and the promotion !-link.The problem is that firing the latter entails the duplication of the whole box, and thus the loss of sharing benefits.

Sharing and locality.
Sharing graphs [19,13,4] include instead, by their very design, the solution to these problems of duplication.Back to our example, instead of performing the duplication of the lowermost box, we can apply the "triggering" rule (t) shown in Figure 1b-c.This introduces a link of a new kind +⟩, called mux (multiplexer), that has k + 1 premisses and index 1 as the content of the box.Muxes perform duplications of boxes in a local, link-by-link way, following the approach introduced by interaction nets [18].For instance, the +⟩-link in the example can duplicate the λ-link only, by the (d + ⊸) rule in Figure 1c-d.This allows N being kept shared, whilst copies of the λ-link can now independently interact with @-links in M .Also, from the (d + ⊸) rule originates a sort of co-sharing link, the negative mux with kind -⟩ and the same index, which implements sharing of contexts (outputs), instead of terms (inputs).In addition to the case of λ-links, there is one duplication for each other link (@, !, ?), but it is applicable only when the mux faces its principal port, i.e. its conclusion, depicted by an outgoing arrow.This makes duplication lazy -it is performed only when a mux obstructs the formation of other redexes.The life of a +⟩-link may end in two ways: by being merged into it, when it reaches the premiss of a ?-link, or by annihilating with a facing -⟩-links (i.e. the facing pair of links reduces to the identity).But positive muxes may also need to swap with negative ones, i.e. they duplicate each other.Therefore, we mark muxes with the index inherited from the exponential redex, e.g. 1 in our running example, so we can distinguish two kinds of redexes with two opposite muxes: annihilation when indices are equal, swap when they are different.In general, we would also need a supplemental mechanism or information tracking, the so-called "oracle", which manages indexes, as a local implementation of digging and dereliction of LL.But this is not the case for proof-nets for terms typed in the elementary and light variants of LL (ELL and LLL) [12,6].They are obtained by a restriction on usual exponential boxes that makes indices immutable by definition.Hence, for their sharing implementation we can simply consider the so-called abstract algorithm of sharing graphs (ASG).Thanks to muxes, the sharing graph G that is the normal form of T is a (possibly enormously) compressed representation of the proof-net T we would have obtained by ordinary cut-elimination.To retrieve T from G, we need the read-back (RB) -a set of additional rewriting rules for sharing graphs, which unlatch muxes to let them freely duplicate downwardly, i.e. from the root of the term to its inputs.

Efficiency of sharing graphs
Question.The possible benefits of sharing were astonishingly evident from the very first sequential implementations of sharing graphs.For example, in the normalisation of λ-terms benchmarks of BOHM [3] recorded polynomial times, against traditional languages (Caml Light and Haskell) [4, Ch. 10] requiring exponential times.But sharing and locality may come with a price.What is the price of sharing graphs?To answer this question, very recently broadly surveyed by Asperti [1], we first need the notion of cost.We cannot use the number of β steps, since, even though they are a reasonable [23] measure for the λ calculus [9], in sharing graphs whole families of redexes are reduced simultaneously, (and this is the reason why they realise the Lévy optimal reduction [20]).Nor can we use the number of such parallel β-steps, since it would be an enormously parsimonious measure.Indeed, a polynomial number of family reductions in the size s of a term may hide a concrete cost bigger than a tower of exponentials of s, caused by the oracle rules [5] or by the local duplication rules [2].Therefore, a study of the complexity of sharing graphs is necessarily limited by the state of the art to take the form of a comparison to some existing reduction system, i.e. by the approach of "ICC in the small" [10], and to use a cost measure based on standard rewriting theory -counting the size of sub-graphs that are erased/introduced at each step.Hence, to employ a reasonable measure we are possibly renouncing to parsimoniousness.
⊳ In Section 4.1 we shall define two cost functions for ASG and EPN reductions.
A first partial answer.In the only previous contribution which tackled the complexity study of ASG [7], Baillot, Coppola and Dal Lago exploited the implicit computational complexity of (the affine variants of) ELL and LLL.The cost of the cut-elimination of a proof-net N with maximum boxing index d is related respectively by a Kalmar elementary function in the size of N and rank d, in ELL, or by a polynomial function in the size of N and degree d, in LLL.
By means of a quantitative semantical tool [8] inspired by the geometry of interaction [11], the authors proved that the cost of a normalisation with sharing graphs of ELL and LLL proof-nets remains in the two aforementioned complexity classes.But they were not able to

17:4
Is the Optimal Implementation Inefficient?Elementarily Not give any explicit bound to the overhead that sharing graphs might introduce in the worst case -for instance, when it becomes less effective, since the reduction does not require a relevant amount of duplications.Moreover, the technical approach hardly seems adaptable to prove a similar result for the more general case featuring the "oracle".
Contributions.We study the complexity of reducing (proof-nets representing) λ-terms typed in the elementary or light linear logic and relate it to the cost of naive reduction.In particular, we give a worst-case bound of the cost of sharing reduction as a quadratic function in the cost of the naive reduction.Three are the axis along which this paper improves the previous literature [7]: Strength.We give a clear bound to the overhead of sharing reduction.2. Generality.Our analysis considers strategy-agnostic reductions of arbitrary length, instead of normalisation, and includes the read-back rules (which are sub-optimal).In this way we get a more uniform, and perhaps fairest, complexity comparison.3. Scalability.The technical approach bases on a quantitative extension of an elegant syntactical simulation between sharing graphs and proof-nets; this provides modularity for our complexity analysis, and appears to give room for further investigations also about more general cases.
⊳ The complexity bound is obtained in Sections 4.2 and 4.3.Detailed proofs are omitted for lack of space, but can be found in an extended version available on authors' websites.

Intuitionistic elementary and light logics
We start by introducing proof-nets of ELL and LLL.We define first the two intuitionistic and weakening-free logics by a levelled sequent calculus inspired by the approach of Guerrini, Martini and Masini [15], which represents a typing system for λI terms.The absence of weakening in λI will remove a considerable technical overhead that have no impact on the complexity question (in the literature [7, for instance] garbage collection is indeed quite commonly postponed at the end) nor on the proof technique.On the other hand, this will greatly ease the exposition of ASG and their complexity analysis, since it removes reduction rules and entails the uniqueness of the root in sharing graphs.Then, we give the translation of sequent proofs in levelled proof-nets, that are directed hypergraphs where every (occurrence of a) formula is a vertex and every inference rule is a directed hyperedge (called link) that goes from the premisses of the rule to its conclusions.Axioms and cuts correspond instead to a direct plugging of the two sub-proofs.Finally, we will present cut-elimination as reduction of proof-nets.

Sequent calculus and typed lambda terms
Definition 1 (Logics and typing).Given L a set of literal symbols, the formulas of ELL and LLL are built from the following grammar.
A levelled formula is a pair T n where T is a formula and n ∈ N. Given a set V of variables, the set of terms is defined from the standard definition of the Λ calculus: (a) Common rules: axiom, cut, abstraction, application by constraining abstraction so that it bounds at least one occurrence (i.e.x must appear as a free variable of t in order to write λx.t).The sequent calculus of the first-order, weakening-free, intuitionistic fragment of ELL and LLL is defined in Figure 2 and represents a type assignment system for the Λ I calculus.
Remark 2 (LLL ⊂ ELL).Observe that § cannot appear in ELL formulas and that the light version of the (!) rule is an instance of the elementary one.Moreover, any proof π of LLL can be encoded in ELL by using the logical modality !instead of §.For this reason and the sake of simplicity, in the rest of the paper we shall refer only to the elementary version.

Proof-nets
Definition 3 (Elementary proof-nets).Given a set of vertices, a link is a directed hyperedge, i.e. a triple (V κ n u), where: u is a vertex called conclusion, V is a non empty sequence of vertices called premisses, κ is a label called kind, n ∈ N is called level.Depending on the kind of a link l, a polarity is assigned to each of its vertices, i.e. an element of {ι, o} (input and output), and the arity may be fixed, i.e. the number of vertices of l.In order to keep a better correspondence with the underlying λ-calculus, the kinds of links will correspond to the syntactical construct associated to the rule and not to the corresponding logical connective.Also, links are depicted so that positioning follows the input/output computational interpretation, o above, ι below; whilst arrows orientation follows the prooftheoretical viewpoint, premisses inward, conclusions outward.
A proof-net of the fragment of ELL of our interest, to which we shall simply refer to as an elementary proof-net (EPN), is the hyper-graph N obtained by the translation ⟦π⟧ of some sequent proof π, as inductively defined as follows.Let R be the last rule of π, assume its shape to be as in one of Figures 2a, 2b, and 2d.Also, let π 1 , π 2 respectively be the sub-proofs of π (if any) whose conclusions are the leftmost and rightmost premisses of R. Then the translation of π is given by the case analysis in Figure 3.There we assume that ⟦π 1 ⟧ , ⟦π 2 ⟧ are disjoint, and also that, except when otherwise depicted, both are disjoint from the vertices introduced by the inductive steps (i.e.new vertices are "fresh").Although we shall label vertices with their names, in the picture we used formulas to ease the reading and stress the correspondence with the sequent proof.Is the Optimal Implementation Inefficient?Elementarily Not The conclusions of ⟦π⟧ are the vertices corresponding to formulas appearing in the sequent proved by πinput vertices stand for formulas on the left-hand side of the sequent, output ones for those on the right-hand side.The set of the conclusions of N ∈ EPN is called its interface and denoted by iface(N ); any vertex of N not in iface(N ) is an internal vertex of N , and the corresponding set is denoted by int(G).
Remark 4 (λ-terms).The input-output relation allows to associate a λ-term to a proof-net -if we erase exponential links, we essentially obtain the syntax tree of the term.

Definition 5 (Boxes).
The level of a vertex v is denoted as (v), and we shall write the same for a link, meaning the level of its premiss(es).The maximum level of links in N is written ∂(N ).A box of level n in N ∈ EPN is a sub-graph B of N whose links and vertices have level not smaller that n and that is maximal with respect to inclusion.The ι conclusion v of B is called its principal door, whilst the o conclusions u 1 , . . ., u k auxiliary doors.We shall then denote B as (u 1 , . . ., u k ⟨⟨B⟩⟩ v).Boxes are depicted with dotted squares.

Definition 6 (Paths).
A path from u 0 to u k in a graph G is a sequence of vertices (u 0 , . . ., u k ) for which there is a sequence of links l 0 , . . ., l k−1 such that u i ≠ u i+1 and u i belongs to both the vertices of l i and those of l i+1 , for any 0 ≤ i < k − 1.A downward path is a path such that: u i is not the first premiss of a λ-link and is an o-vertex of l i+1 ; and u i+1 is an ι-vertex of l i+1 , for any 0 ≤ i < k − 1.If these holds, then (u k , . . ., u 0 ) is an upward path from u k to u 0 .We shall write u ∼ v when there is a path from u to v, u ↝ v when there is a downward one, v ↝ u when u ↝ v.A rooted path is a downward path starting from the o-conclusion of G.
Remark 7 (Boxes).Auxiliary doors of a box B are always premisses of an exponential link, and that B is always connected: there exists a path between any two of its vertices.Also, boxes properly nest: given two distinct boxes, either they are completely disjoint, or one is included into the other.Our definition of box is slightly different from the standard one, as it is does not include vertices with exponential formulas, but just take the interior of the box.

Abstract sharing graphs
We introduce abstract sharing graphs (ASG) and their reduction, and recall their most important qualitative properties as an implementation of EPN.

Syntax and computation
Definition 11 (Sharing and read-back reductions).The sharing reduction is the graphrewriting relation → ASG given by the context closure of the following reduction rules.Logical (⊸), (!), (t), defined in Figures 4a and 5a.On unary contractions, (!) = (D).Duplication (d + ⊸), (d - ⊸), (d!), (d?), respectively defined in Figures 5c, 5d, 5e, and 5f.Muxes (a), (s), defined in Figure 5b.The read-back reduction → RB is obtained from the mux interaction rules and the followings.Read-back duplication (r + ⊸), (r?), (m), defined in Figures 5g and 5h.The RB-normal form of a graph G is called its read-back and written R(G).The reduction → ASGR is the union of → ASG and → EPN .The set ASG of abstract sharing graphs is obtained by the closure of EPN with respect to → ASGR .

Implementation of EPN
Sharing graphs with ASG and RB reductions represent a well-behaved rewriting system.→ ASG is locally confluent.→ RB and → ASGR are confluent.All three are strongly normalising, and the last two have normal forms in EPN [16, Thm.s 4, 11.i and 11.ii (for MELL)].The traditional way of normalising proofs or terms with sharing graphs maximises the amount of sharing by postponing duplication as much as possible, thus performing first an ASG-normalisation and then an RB one.This gives a correct implementation of EPN reduction and a complete implementation of EPN normalisation.
Proof.We refer to the original proof for λ-calculus [13], or the more syntactic one for MELL [16,Thm. 13].

17:8
Is the Optimal Implementation Inefficient?Elementarily Not

(f) Duplication of contraction
(g) Duplication of application If instead we consider → ASGR , sharing graphs can be shown to be more generally complete with respect to the whole EPN-reduction (not just normalisation).It suffices to prioritise RB redexes, thus enforcing exhaustive duplications of boxes.

Cost measures
We define two cost functions C ASG and C EPN , respectively for the ASG and EPN reductions.
Both measures are essentially equivalent to the size of the rewriting operations required.However, to ease the presentation without affecting fairness, only C EPN is formally defined as such, whilst C ASG has been accurately hand tuned.

Definition 16 (Size and variations).
The size of a graph G, written #G, is the sum of the cardinality of the set of its vertices and the sum of the arities of its links.We remark that for a box (u 1 , . . ., u k ⟨⟨B⟩⟩ v), all of its doors, principal and auxiliary ones, belong to the sub-graph B and are accounted by #B.Given M a metric on a graph G, e.g. the size of G or of some set of sub-graphs, and ρ a reduction step, ∆(ρ) denotes M (ρ(G)) − M (G).

Definition 17 (EPN-reduction cost).
The cost C EPN (ρ) of a EPN-reduction step ρ on a levelled proof-net N is defined as the size of the symmetric difference between the vertices and links of N and those of ρ(N ).Namely, the cost of a given rule is computed in Table 1a.The cost of a reduction sequence ρ is the sum of the costs of each step it is composed of.Definition 18 (ASG-and RB-reduction costs).The cost C ASG (σ) and C RB (σ) of a ASG-or RB-reduction step σ is given in Table 1b.

Unshared simulation
Our complexity comparison is directly founded on the most natural correspondence between sharing graphs and proof-nets: a syntactical simulation.Given a proof-net P , any ASG reduction sequence σ on P can be simulated by a EPN sequence ρ on the same P .Since the only difference between the two rewriting systems is the style of duplication, local or global, respectively, σ(P ) and ρ(P ) may greatly differ in the number of copies of some subgraphs.To understand precisely the relationship between σ(P ) and ρ(P ), we shall employ an intermediate reduction system -the unshared graphs (UG) [16].Let us taste the main intuitions employing the example that we began to consider in Section 1.1 and Figure 1.
The key feature of UG is the fact that the exponential redex in Figure 1b   (a) Classic reduction rules.In the case of (D), k + 1 is the number of premisses of the ?-link, and B is the box enclosed by the !-link.
Sharing and read-back rules.j + 1, k + 1 and l + 1 respectively are the number of premisses of the ?-link, the first and the second *⟩-link, where involved. of one k-ary mux of Figure 1c).Have a peek at Figure 6.The new links are called lifts, and play the mere role of markers for the presence of muxes in corresponding sharing graphs.In particular, their propagation along the graph does not affect any other link, and if we erase them we simply obtain a proof-net.For instance, the (dλ) step in Figure 1c-d, can be simulated by k + 1 propagation steps that reach Figure 1e, that is the unfolding of Figure 1d.Similarly, any reduction step inside N (which is shared) needs to be performed k + 1 times in N i .Yellow arrows illustrate such unfolding relation.

Unshared graphs
Definition 19 (Unshared reduction and graphs).The unshared reduction is the rewriting relation → UG obtained from → ASG by replacing the (t) rule with (tD), defined in Figure 6.The unshared read-back → UR is the restriction of RB-reduction to UG (i.e.muxes are unary).The union of these two relations is written as UGR.An unshared graph UG-graph for short, is either a levelled proof-net, or the reduct of an unshared graph via UG-or UR-reduction.

Unfolding and simulating sharing graphs in unshared graphs
Definition 20 (Sharing morphism).A sharing morphism M is a surjective homomorphism on hypergraphs [17] from UG to ASG that preserves the kind and level of links.We say that G ∈ ASG unfolds to U ∈ UG, written G ↪ U , if there is a sharing morphism M such that M(U ) = G.We shall use the same notation to relate vertices and links: if v ∈ V (G) and 17:11 We call μ and μ′ an unfolded simulation of σ and σ′ , respectively, and write σ ↪ μ and σ′ ↪ μ′ .

Simulating sharing graphs into proof-nets
Definition 22 (Lift erasure).The lift erasure is the function ↦ that maps a U ∈ UG to the N ∈ EPN obtained by equating any two vertices u, v for which there is (u *⟩ v) ∈ L(U ).The function is extended to let it map vertices and links of U to those of N .

Quantitative unshared simulation
Given two simulating reduction sequences on the same proof-net, σ of ASG and ρ of EPN, we can compare C ASG (σ) to C EPN (ρ), finding a quadratic bound.In order to do so, we shall bring the unshared simulation up to a quantitative level, so that these two costs can be expressed as two different cost measures on unshared reduction, thus allowing a direct comparison.

Share
The first step is to define introduce a labelled reduction for UG which decorates lifts: at the creation of a set of lifts we add to each of them a fresh label tracking their number and relative indices.We interpret the 0-th lift as the master one, while all the others as sharing ones.In the previous illustration in Figure 1e, we darkened master lifts.Then, given an unshared graph U being the unfolding of a sharing graph G, we can build the sharing context of a vertex v as the sequence of lift labels that are along its access path from the root of U .Its sharing context allows us to understand: if its context contains non master lifts (equivalently: "has v been previously copied in U "?); 2. how much v is shared, i.e. the product of the number of lifts in the label, for any lift in the context of v ("how many other copies of v are in U "?).The set of such shared objects is called the share, and conceptually represents the subtraction of the graph of G from that of U .In Figure 1e, we highlighted the share as a pale yellow circle.Notice that it does not include N 0 , since its sharing context include a master lift, we interpret it as a master copy of N (the stereotype).
Definition 26 (Copy identity).We enrich → UGR with the copy identity labelling (CID).It maps lifts to labels of the form x i∶k (positive) or x i∶k (negative), where x ∈ V a set of variable symbols, whilst i, k ∈ N are the current and maximal index.Given U ∈ UG and µ a (tD)-step F S C D 2 0 1 7

17:12
Is the Optimal Implementation Inefficient?Elementarily Not as in Figure 6, we set CID((v j *⟩ n u j )) = x j∶h , for any 0 ≤ j ≤ h, and for some x ∈ V not occurring in the labels of U .Labels are negated in negative lifts: if l is a positive lift with CID(l) = x j∶h and l ′ is a negative residual of l w.r.t. a lift propagation rule (dκ) or (rκ), then CID(l ′ ) = x j∶h .In any other case, labels are preserved by reduction, in particular under copying.
Definition 27 (Sharing contexts).The sharing contexts C are the strings generated by the binary concatenation operator ⋅ over labels, and including 1 as the identity element (i.e. the empty string) and 0 as the absorbing element for concatenation.We add two equations to detect whether (or not) labels are well-bracketed in a context by neutralisation, (or nullification).For any labels a ≠ b, Also, a is said positive, written a > 0, when it is empty or contains only positive labels.
A levelled sharing context, or simply an l-context, is a map γ from N to C, that is uniformly null: if for some n ∈ N we have γ(n) = 0, then γ(m) = 0 for any m ∈ N. We write (γ) n to denote the restriction of γ on n: if m = n and γ(m) ≠ 0, then (γ) n (m) = 1; otherwise (γ) n (m) = γ(m).Also, we denote with !n a the lifting of a context a at level n.Namely, if ! n a = γ then γ(n) = a, whilst γ(m) = 1 for any m ≠ n.More precisely, !n a denotes !(! n−1 a), where we set that !1 = 1, that !0 = 0, and also that !(a ⋅ b) = !a⋅ !b.We say that γ is positive, The l-context of a vertex in U ∈ UG is the context of any rooted path reaching it.
Definition 30 (Share and master).A lift labelled with x i∶k is master if i = 0, otherwise it is shared.A context a is master if a is empty or contains only master labels x 0∶m ; otherwise, it is a shared context.Finally, an l-context α is master if α(n) is master for any n ∈ N, otherwise it is shared.A vertex is shared if its l-context is so, otherwise it is master; a link is shared if it has at least one shared vertex, otherwise it is master.A share component is a non-empty, connected, and maximal (w.r.t.inclusion) sub-graph whose vertices and links are shared.The set of the share components of U ∈ UG is denoted as ShC(U ), their union is called the share, written Sh(U ).

Definition 31 (Share boundary and interior). Given
v is linked to a link other than a lift, then it is boundary-limit, written v ∈ BLSh(U ).In such a case, the boundary lift chain of v is the longest sequence of lifts that induces a path from v to the conclusion of a boundary lift.If Sh(U ) ∋ v ∉ BSh(U ) and v is a ι-vertex of a lift, then v is a pseudo-boundary vertex, the set of which is denoted by bSh(U ).If Sh(U ) ∋ v ∉ BSh(U ) ∪ bSh(U ), then v is an interior vertex, the set of which is iSh(U ).A share component having no interior vertices is a boundary component, and BShC(U ) denotes the set of such components.

Reading proof-net cost and sharing cost on unshared reduction
Now we transpose C EPN and C ASG as two cost notions on UG reduction.On the proof-net side we define C EPN UG , by subtracting from C EPN the variations in the size of the internal share.The first intuition is that the #iSh(⋅) represents a buffer for the amount of duplication work that is performed in big steps by EPN and delayed in small steps by ASG.In such a way, we obtain a definition of C EPN UG that is bounded by constant on any step, including (tD).The second intuition is that a reduction inside iSh(⋅) cost up to twice the cost it would have C EPN , since we need to account not only for the usual graph-rewriting cost, but also for the duplication cost previously performed of the involved links.Finally, we define and compute another notion of cost, C BShC UG , which accounts the amount of reductions on boundary lifts in boundary share components.For the moment it only enables simplifications in the computation of C EPN UG , but it will play a crucial role later.
Definition 32 (EPN metrics on UG).Recall the notions of size and variation from Definition 16.Given U    2.
On the sharing graphs side we define C ASG UG as follows: logical redexes are accounted for only if they are a master copy; other redexes are accounted for only if the involved lift is a boundary one.Intuitively, we distribute a k + 1-ary mux duplication into k propagations of boundary lifts, and a step of another kind into the unique master copy of its redex.
Definition 35 (Cost on unshared graph).Let µ be a UGR-reduction step.The ASG-cost of µ, written C ASG UG (µ i ), is defined in the rightmost column of Table 2. Lemma 36 (Master copy).If v ∈ V (G) and V ′ ↩ v, then V ′ contains a unique master.

Comparison of the two unshared costs
Finally, we now compare C EPN UG (μ) and C ASG UG (μ), and find their difference to be bounded by C BShC UG (μ).By a mere local observation we find a linear bound in C EPN UG for the portion of C BShC UG induced by logical, duplicating, merging and annihilation rules.For the portion caused by swap rules, instead, we find a quadratic limitation.Therefore, the overhead of ASG with respect to its EPN simulation admits a quadratic bound.EPN N ′ , where ρ ↣ σ.Then C ASG (σ) ≤ q (C EPN (ρ)) where q is a quadratic function.

Conclusions
Two reflections and four questions emerge from the study we have presented.

Discussion
1.A quite positive partial answer to the efficiency of sharing graphs comes from the quadratic upper-limit to the complexity of their reductions.This is motivated by two arguments.a. Hypotheses of our complexity measurement were purposely extremely conservative.Indeed, we not only consider the read-back -an unavoidable portion of the reduction work -by directly including their rewriting rules.But we also allow these rules to be applied freely, also before the end of the β-normalisation, thus allowing duplications of redexes in a sub-optimal fashion [20].b.The worst-case overhead of sharing graphs are usually counterbalanced by other benefits.Laziness in the strategy of duplication, for instance, has shown speed-ups up to exponential size [3].Locality and asynchronicity of the computational model, moreover, allow parallelisable implementation with little effort.

Figure 2
Figure 2 Levelled sequent calculus of ELL and LLL.

Figure 3
Figure 3 Elementary proof-nets, as translated from sequent proofs.See Definition 3 and Figure 2.

Figure 5
Figure 5 ASG and RB reduction rules.

F
would be rewritten in k + 1 copies of the box (as one usually does on proof-nets), plus k + 1 unary muxes (instead

Table 1
Costs assigned to classic and sharing reductions.
it is the conclusion of a boundary lift, or it is linked by a lift to a boundary vertex.If additionally

Table 2
Metrics of UGR reduction: variation in the size of interior share, EPN-cost, variation in the number of boundary share components (Lemma 34); ASG-cost (Definition 35).Notations: µ is the reduction step, U is the net containing the redex, dκ, rκ stands for a duplication rule; if involved: h + 1 is the number of premisses of the ?-link,B is the box subnet, l, l ′ are the lifts.Also, intervals are enclosed in brackets, sets in braces.