Factorization in Call-by-Name and Call-by-Value Calculi via Linear Logic (long version)
aa r X i v : . [ c s . L O ] J a n Factorization in Call-by-Name and Call-by-ValueCalculi via Linear Logic
Claudia Faggian and Giulio Guerrieri Universit´e de Paris, IRIF, CNRS, F-75013 Paris, France University of Bath, Department of Computer Science, Bath, UK
Abstract.
In each variant of the λ -calculus, factorization and normal-ization are two key-properties that show how results are computed.Instead of proving factorization/normalization for the call-by-name (CbN)and call-by-value (CbV) variants separately, we prove them only once,for the bang calculus (an extension of the λ -calculus inspired by linearlogic and subsuming CbN and CbV), and then we transfer the result viatranslations, obtaining factorization/normalization for CbN and CbV.The approach is robust: it still holds when extending the calculi withoperators and extra rules to model some additional computational fea-tures. The λ -calculus is the model of computation underlying functional programminglanguages and proof assistants. Actually there are many λ -calculi, depending onthe evaluation mechanism (for instance, call-by-name and call-by-value—CbNand CbV for short) and computational features that the calculus aims to model.In λ -calculi, a rewriting relation formalizes computational steps in programexecution, and normal forms are the results of computations. In each calculus,a key question is to define a normalizing strategy : How to compute a result? Isthere a reduction strategy which is guaranteed to output a result, if any exists?Proving that a calculus admits a normalizing strategy is complex, and manytechniques have been developed. A well-known method first proves factorization [5,31,19,3]. Given a calculus with a rewriting relation −→ , a strategy → l ⊆−→ fac-torizes if −→ ∗ ⊆→ l ∗ · → ¬ l ∗ ( → ¬ l is the dual of → l ), i.e. any reduction sequence can berearranged so as to perform first → l -steps and then the other steps. If, moreover,the strategy satisfies some “good properties”, we can conclude that the strategyis normalizing. Factorization is important also because it is commonly used asa building block in the proof of other properties of the how-to-compute kind.For instance, standardization , which generalizes factorization: every reductionsequences can be rearranged according to a predefined order between redexes. Two for One.
Quoting Levy [20]: the existence of two separate paradigms (CbNand CbV) is troubling because to prove a certain property—such as factorizationor normalization—for both systems we always need to do it twice . C. Faggian, G. Guerrieri
The first aim of our paper is to develop a technique for deriving factorizationfor both the CbN [5] and CbV [27] λ -calculi as corollaries of a single factorizationtheorem, and similarly for normalization. A key tool in our study is the bangcalculus [12,16], a calculus inspired by linear logic in which CbN and CbV embed. The Bang Calculus.
The bang calculus is a variant of the λ -calculus where anoperator ! plays the role of a marker for non-linear management: duplicability anddiscardability. The bang calculus is nothing but Simpson’s linear λ -calculus [30]without linear abstraction, or the untyped version of the implicative fragmentof Levy’s Call-by-Push-Value [20], as first observed by Ehrhard [11].The motivation to study the bang calculus is to have a general frameworkwhere both CbN and CbV λ -calculi can be simulated, via two distinct transla-tions inspired by Girard’s embeddings [15] of the intuitionistic arrow into linearlogic. So, a certain property can be studied in the bang calculus and then auto-matically transferred to the CbN and CbV settings by translating back.This approach has so far mainly be exploited semantically [21,11,12,16,10,8],but can be used it also to study operational properties [16,29,14]. In this paper,we push forward this operational direction. The Least-Level Strategy.
We study a strategy from the literature of linear logic[9], namely least-level reduction → l , which fires a redex at minimal level—the level of a redex r is the number of ! under which the redex appears.We prove that the least-level reduction factorizes and normalizes in the bangcalculus, and then we transfer the same results to CbN and CbV λ -calculi (forsuitable definitions of least-level in CbN and CbV), by exploiting properties oftheir translations into the bang calculus. A single proof suffices. It is two-for-one!Or even better, three-for-one.The rewriting study of the least level strategy in the bang calculus is basedon simple techniques for factorization and normalization we developed recentlywith Accattoli [3], which simplify and generalize Takahashi’s method [31]. Subtleties of the Embeddings.
Transferring factorization and normalization re-sults via translation is highly non-trivial, e.g. in CPS translations [27]. Thisapplies also to transferring least-level factorizations from the bang calculus tothe CbN and CbV λ -calculi. To transfer the property smoothly, the translationsshould preserve levels and normal forms, which is delicate, in particular for CbV.The embedding of CbV into the bang calculus defined in [16,29] does not preservelevels and normal forms (see Remark 16). As a consequence, the CbV transla-tion studied in [16,29] cannot be used to derive least-level factorization or any normalization result in a CbV setting from the corresponding result in the bangcalculus.Here we adopt the refined CbV embedding of Bucciarelli et al. [8] whichdoes preserve levels and normal forms. While the preservation of normal formsis already stressed in [8], the preservation of levels is proved here for the firsttime, and it is based on non-trivial properties of the embedding. actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 3 Beyond pure.
Our second aim is to show that the developed technique for thejoined factorization and normalization of CbN and CbV via the bang calculusis robust . We do so, by studying extensions of all three calculi with operators(or, in general, with extra rules) which model some additional computationalfeatures, such as non-deterministic or probabilistic choice. We then show thatthe technique scales up smoothly, under mild assumptions on the extension.
A Motivating Example.
Let us illustrate our approach on a simple case, which wewill use as running example. De’ Liguoro’ and Piperno’s CbN non-deterministic λ -calculus Λ cbn ⊕ [23] extends the CbN λ -calculus with an operator ⊕ whose reduc-tion models non-deterministic choice : ⊕ ( t, s ) rewrites to either t or s . It admits astandardization result, from which if follows that the leftmost-outermost reduc-tion strategy (noted → lo β ⊕ ) is complete : if t has a normal form u then t → lo β ⊕∗ u . In[22], de’ Liguoro considers also a CbV variant Λ cbv ⊕ , extending with an operator ⊕ the CbV λ -calculus. One may prove standardization and completeness—again—from scratch, even though the proofs are similar.The approach we propose here is to work in the bang calculus enriched withthe operator ⊕ , it is denoted by Λ ! ⊕ . We show that the calculus satisfies least-level factorization from which it follows that the least-level strategy is complete , i.e. if t has a normal form u , then t → l β ! ⊕∗ u . The translation then guaranteesthat analogous results hold also in Λ cbn ⊕ and Λ cbv ⊕ . The Importance of Being Modular.
The bang calculus with operators is actuallya general formalism for several calculi, one calculus for each kind of computa-tional feature modeled by operators. Concretely, the reduction → consists of −→ β ! (which subsumes CbN −→ β and CbV −→ β v ) and other reduction rules −→ ρ .We decompose the proof of factorization of → in modules, by using the modular approach recently introduced by the authors together with Accattoli[4]. The key module is the least-level factorization of → β ! , because it is wherethe higher-order comes into play—this is done, once for all. Then, we considera generic reduction rule −→ ρ to add to −→ β ! . Our general result is that if −→ ρ has‘good properties’ and interacts well with −→ β ! (which amounts to an easy test,combinatorial in nature), then we have least-level factorization for −→ β ! ∪ −→ ρ .Putting all together, when −→ ρ is instantiated to a concrete reduction (suchas → ⊕ ), the user of our method only has to verify a simple test (namely Propo-sition 34), to conclude that −→ β ! ∪ → ⊕ has least-level factorization. In particularfactorization for −→ β ! is a ready-to-use black box the user need not to worryabout—our proof is robust enough to hold whatever the other rules are. Finally,the embedding automatically give least-level factorization for the correspondingCbV and CbN calculi. In Section 7, we illustrate our method on this example. Subtleties of the Modular Extensions.
In order to adopt the modular approachpresented in [4] we need to deal with an important difficulty which appears whendealing with normalizing strategies and that it is not studied in [4].
C. Faggian, G. Guerrieri
A normalizing strategies select the redex to fire usually through a propertysuch as being a least level redex or being the leftmost-outermost (shortened toLO) redex—normalizing strategies are positional .The problem is that the—in general— if → = → β ∪ → ρ , then → lo reductionis not the union of → lo β and → lo ρ . I.e., the normalizing strategy of the compoundsystem is not obtained putting together the normalizing strategies of the com-ponents. Let us explain the issue on our running example → β ⊕ , in the familiarcase of leftmost-outermost reduction. Example 1.
Let us first consider head reduction with respect to β (written → h β )and with respect to β ⊕ (written → h β ⊕ ). Consider the term s = ( II )( x ⊕ y ), where I = λx.x . The subterm II (which is a β -redex) is in head position wheneverwe consider the reduction → β or its extension → β ⊕ . So s → h β I ( x ⊕ y ) and s → h β ⊕ I ( x ⊕ y ). Conversely, given t = ( x ⊕ y )( II ) the head position is occupiedby ( x ⊕ y ), which is a ⊕ -redex, but not a β -redex. Therefore, ( II ) is not thehead-redex in t , neither for β nor for β ⊕ . Otherwise stated: → h β ⊕ = → h β ∪ → h ⊕ . In contrast, if we consider leftmost-outermost reduction → lo , which reduces aredex in the leftmost-outermost position, it is easy to see that → lo β ⊕ = → lo β ∪ → lo ⊕ . Consider again the term t = ( x ⊕ y )( II ). Since ( x ⊕ y ) is not a β -redex, ( II ) isthe leftmost redex for → β . Instead, ( II ) is not the lo -redex for → β ⊕ (here theleftmost redex is ( x ⊕ y )). So t → lo β ( x ⊕ y ) I but t lo β ⊕ ( x ⊕ y ) I .The least-level factorization for → β ! , → β , and → β v we prove here is robustenough to make it ready to be used as a module in a larger proof, where it maycombine with operators and other rules. The key point is to define the least-levelreduction from the very beginning as a reduction firing a redex at minimal levelwith respect to a general set of redexes (containing β ! , β or β v , respectively), sothat it is “ready” to be extended with other reduction rules (see Section 4). Proofs.
All proofs are available in
An ( abstract ) rewriting system , [32, Ch. 2] is a pair ( A, −→ ) consisting of a set A and a binary relation −→⊆ A × A (called reduction) whose pairs are written t −→ s and called steps . A −→ -sequence from t is a sequence of −→ -steps. As usual, → ∗ (resp. → = ) denotes the transitive-reflexive (resp. reflexive) closure of → . actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 5 A relation → is confluent if s ∗ ← r → ∗ t implies s → ∗ u ∗ ← t for some u . Wesay that u is → - normal (or a → -normal form) if there is no t such that u → t .In general, a term may or may not reduce to a normal form. If it does, notall reduction sequences necessarily lead to normal form. A term is weakly or strongly normalizing , depending on if it may or must reduce to normal form. Ifa term t is strongly normalizing, any choice of steps will eventually lead to anormal form. However, if t is weakly normalizing, how do we compute a normalform? This is the problem tackled by normalization : by repeatedly performing only specific steps , a normal form will be computed, provided that t can reduceto any.A strategy −→ e ⊆ −→ is a way to control that in a term there are different pos-sible choices of reduction. A normalizing strategy for → , is a reduction strategywhich, given a term t , is guaranteed to reach its → -normal form, if any exists (akey tool to show that certain terms are not → -normalizable). Definition 2 (Normalizing and complete strategy).
A reduction → e ⊆ → is a strategy for → if it has the same normal forms as → . A strategy → e for → is: – complete if t → e ∗ u whenever t −→ ∗ u with u → -normal; – normalizing if every maximal → e -sequence from t ends in a normal form,whenever t −→ ∗ u for some → -normal form u . Note that if the strategy → e is complete and deterministic ( i.e. for every t ∈ A , t → e s for at most one s ∈ A ), then → e is a normalizing strategy for → . Definition 3 (Factorization).
Let ( A, −→ ) be a rewriting system with → = → e ∪ → i . The relation → satisfies e -factorization , written Fact ( → e , → i ) , if Fact ( → e , → i ) : ( → e ∪ → i ) ∗ ⊆ → e ∗ · → i ∗ ( Factorization ) Proving Normalization.
Factorization provides a simple technique to estab-lish that a strategy is normalizing.
Lemma 4 (Normalization [3]).
Let → = → e ∪ → ¬ e , and → e be a strategy for → .The strategy → e is complete for → if the following hold:1. Persistence: If t → ¬ e t ′ then t ′ is not normal.2. Factorization : t −→ ∗ u implies t → e ∗ · → ¬ e ∗ u .The strategy → e is normalizing for → if it is complete and:3. Uniformity: all weakly → e -normalizing terms are strongly → e -normalizing. A sufficient condition for uniform normalization and confluence is the following:
Property 5 (Newman [25])
A reduction is quasi-diamond if ( t ← t → t )implies ( t = t or t → u ← t for some u ). If → is quasi-diamond then → isuniformly normalizing and confluent. C. Faggian, G. Guerrieri
Proving Factorization.
Hindley[17] first noted that a local property impliesfactorization. Let → = → e ∪ → i . We say that → i strongly postpones after → e , if SP ( → e , → i ) : → i · → e ⊆ → e ∗ · → i = ( Strong Postponement ) Lemma 6 (Hindley [17]). SP ( → e , → i ) implies Fact ( → e , → i ) . Strong postponement can rarely be used directly , because several interestingreductions—including β -reduction—do not satisfy it. However, it is at the heartof Takahashi’s method [31] to prove head factorization of −→ β , via the followingimmediate property that can be used also to prove other factorizations (see [3]). Property 7 (Characterization of factorization)
Factorization
Fact ( → e , → i ) holds if and only if there is a reduction ◦→ i such that ◦→ i ∗ = → i ∗ and SP ( → e , ◦→ i ) . The core of Takahashi’s method [31] is to introduce a relation ⇒ i , called internal parallel reduction , which verifies the hypotheses above. We will follow asimilar path in Section 6.1, to prove least-level factorization. Compound systems: proving factorization in a modular way.
In thispaper, we will consider compound systems that are obtained by extending the λ -calculus with extra rules to model advanced features.In an abstract setting, let us consider a rewrite system ( A, → ) where → = → ξ ∪ → ρ . Under which condition → admits factorization, assuming that both → ξ and → ρ do? To deal with this question, a technique for proving factoriza-tion for compound systems in a modular way has been introduced in [4]. Theapproach can be seen as an analogous for factorization of the classical techniquefor confluence based on Hindley-Rosen lemma [5]: if → ξ , → ρ are e -factorizingreductions, their union → ξ ∪ → ρ also is, provided that two local conditions ofcommutation hold. Lemma 8 (Modular factorization [4]).
Let → ξ = → e ξ ∪ → i ξ and → ρ = → e ρ ∪ → i ρ be e -factorizing relations. Let → e := → e ξ ∪ → e ρ , and → i := → i ξ ∪ → i ρ . Theunion → ξ ∪ → ρ fulfills factorization Fact ( → e , → i ) if the following swaps hold → i ξ · → e ρ ⊆ → e ρ · → ∗ ξ and → i ρ · → e ξ ⊆ → e ξ · → ∗ ρ ( Linear Swaps )The subtlety here is to set → e ξ and → e ρ so that → e = → e ρ ∪ → i ρ . As alreadyshown in Section 1, when dealing with normalizing strategies one needs ex-tra care. actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 7 λ -calculi: CbN, CbV, and bang We present here a generic syntax for λ -calculi, possibly containing operators. Allthe variants of the λ -calculus we shall study use this language. We assume somefamiliarity with the λ -calculus, and refer to [5,18] for details.Given a countable set Var of variables, denoted by x, y, z, . . . , terms and val-ues (whose sets are denoted by Λ O and Val , respectively) are defined as follows: t, s, r ::= v | ts | o ( t , . . . , t k ) Terms : Λ O v ::= x | λx.t Values : Val where o ranges over a set O of function symbols called operators , each one withits own arity k ∈ N . If the operators are o , . . . , o n , the set of terms is indicatedas Λ o ... o n . When the set O of operators is empty, the calculus is called pure ,and the sets of terms is denoted by Λ . Otherwise, the calculus is applied .Terms are identified up to renaming of bound variables, where abstraction isthe only binder. We denote by t { s/x } the capture-avoiding substitution of s forthe free occurrences of x in t . Contexts (with exactly one hole h·i ) are generatedby the grammar below, and c h t i stands for the term obtained from the context c by replacing the hole with the term t (possibly capturing free variables). c ::= h·i | t c | c t | λx. c | o ( t , . . . , c , . . . , t k ) Contexts: C Let ρ be a binary relation on Λ O ; we call it ρ -rule and denote it also by ρ , writing t ρ t ′ rather than ( t, t ′ ) ∈ ρ . A ρ - reduction step −→ ρ is the contex-tual closure of ρ . Explicitly, t −→ ρ t ′ holds if t = c h r i and t ′ = c h r ′ i for somecontext c with r ρ r ′ . The term r is called a ρ - redex . The set of ρ - redexes isdenoted by R ρ . Given a set of rules
Rules , the relation → = S ρ −→ ρ ( ρ ∈ Rules ) can equiva-lently be defined as the contextual closure of = S ρ ρ . λ -calculi Pure CbN and Pure CbV λ -calculi. The pure call-by-name (CbN for short) λ -calculus [5,18] is ( Λ, → β ), the set of terms Λ together with the β -reduction → β ,defined as the contextual closure of the usual β -rule, which we recall in (1) below.The pure call-by-value (CbV for short) λ -calculus [27] is the set Λ endowedwith the reduction −→ β v , defined as the contextual closure of the β v -rule in (2).CbN: ( λx.t ) s β t { s/x } (1) CbV: ( λx.t ) v β v t { v/x } with v ∈ Val (2)
CbN and CbV λ -calculi. A CbN (resp. CbV) λ -calculus is the set of termsendowed with a reduction −→ which extends → β (resp. → β v ).In particular, the applied setting with operators (when O 6 = ∅ ) models in the λ -calculus richer computational features, allowing o -reductions as the contextualclosure of o -rules of the form o ( t , . . . , t k ) o s . C. Faggian, G. Guerrieri
Example 9 (Non-deterministic λ -calculus). Let O = {⊕} where ⊕ is a binaryoperator; let → ⊕ be the contextual closure of the (non-deterministic) rule below: ⊕ ( t , t ) ⊕ t and ⊕ ( t , t ) ⊕ t The non-deterministic CbN λ -calculus Λ cbn ⊕ = ( Λ ⊕ , → β ⊕ ) is the set Λ ⊕ withthe reduction → β ⊕ = −→ β ∪ → ⊕ . The non-deterministic CbV λ -calculus Λ cbv ⊕ =( Λ ⊕ , → β v ⊕ ) is the set Λ ⊕ with the reduction → β v ⊕ = −→ β v ∪ → ⊕ . The bang calculus [12,16] is a variant of the λ -calculus inspired by linear logic.An operator ! plays the role of a marker for duplicability and discardability. Herewe allow also the presence of operators other than !, ranging over a set O . So,terms and contexts of the bang calculus (denoted by capital letters) are: T, S, R ::= x | λx.T | T S | ! T | o ( T , . . . , T k ) Terms: Λ ! O C ::= h·i | λx. C | T C | C T | ! C | o ( T , . . . , C , . . . , T k ) Contexts: C ! Terms of the form ! T are called boxes and their set is denoted by ! Λ ! , O . Whenthere are no operators other than ! ( i.e. O = ∅ ), the sets of terms, boxes andcontexts are denoted by Λ ! , ! Λ ! and C ! , respectively. This syntax can be expressedin the one of Section 3, where ! is an unary operator called bang . The pure bang calculus.
The pure bang calculus ( Λ ! , → β ! ) is the set of terms Λ ! endowed with reduction −→ β ! , the closure under contexts in C ! of the β ! -rule :( λx.T ) ! S β ! T { S/x } (3)Intuitively, in the bang calculus the bang-operator ! marks the only termsthat can be erased and duplicated. Indeed, a β -like redex ( λx.T ) S can be firedby β ! only when its argument S is a box, i.e. S = ! R : if it is so, the content R of the box S (and not S itself) replaces any free occurrence of x in T . A proof of confluence of β ! -reduction −→ β ! is in [16]. Notation 10
We use the following notations to denote some notable terms. ι := λx.x δ := λx.xx I := λx. ! x ∆ := λx.x ! x. Remark 11 (Notable terms).
The term I = λx. ! x plays the role of the identityin the bang calculus: I ! T −→ β ! !( x { T /x } ) = ! T for any term T . Instead, the term ι = λx.x , when applied to a box ! T , opens the box, i.e. returns its content T : ι ! T −→ β ! x { T /x } = T . Finally, ∆ ! ∆ −→ β ! ∆ ! ∆ −→ β ! . . . is a diverging term. Syntax and reduction rule of the bang calculus follow [16], which is slightly differentfrom [12]. Unlike [16] (but akin to [29]), here we do not use ι (aka der ) as a primitive,since ι and its associated rule d can be simulated, see Remark 11 and (4).actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 9 A bang calculus. A bang calculus ( Λ ! O , −→ ) is the set Λ ! O of terms endowed witha reduction −→ which extends −→ β ! . In this paper we shall consider calculi where −→ contains −→ β ! and o -reductions −→ o ( o ∈ O ) defined from o -rules of the form o ( T , . . . , T k ) o S , and possibly other rules. So, → = S ρ −→ ρ ( ρ ∈ Rules ), with
Rules ⊇ { ! β, o | o ∈ O} . We set → O = S o ∈O → o . Our motivation to study the bang calculus is to have a general framework whereboth CbN [5] and CbV [27] λ -calculi can be embedded, via two distinct trans-lations. Here we show how these translations work. We extend the simulationresults in [16,29,8] for the pure case to the case with operators (Proposition 13).Following [8], the CbV translation defined here differs from [16,29] in theapplication case. Section 5 will show why this optimization is crucial. CbN and
CbV translations are two maps ( · ) n : Λ O −→ Λ ! O and ( · ) v : Λ O −→ Λ ! O , respectively, translating terms of the λ -calculus into terms of the bang cal-culus: x n := x ( λx .t ) n := λx .t n ( o ( t , . . . , t k )) n := o ( t n , . . . , t n k ) ( ts ) n := t n ! s n ; x v := ! x ( λx .t ) v := !( λx.t v ) ( o ( t , . . . , t k )) v := o ( t v , . . . , t v k ) ( ts ) v := ( T s v if t v = ! T ( ι t v ) s v otherwise . Example 12.
Consider the λ -term ω := δδ : then, δ n = ∆ , δ v = ! ∆ and ω n = ∆ ! ∆ = ω v ( δ and ∆ are defined in Notation 10). The λ -term ω is diverging inCbN and CbV λ -calculi, and so is ω n = ω v in the bang calculus, see Remark 11.For any term t ∈ Λ O , t n and t v are just different decorations of t by means ofthe bang-operator ! (recall that ι = λx.x ). The translation ( · ) n puts the argumentof any application into a box: in CbN any term is duplicable or discardable. Onthe other hand, only values ( i.e. abstractions and variables) are translated by( · ) v into boxes, as they are the only terms duplicable or discardable in CbV.As in [16,29], we prove that the CbN translation ( · ) n (resp. CbV translation( · ) v ) from the pure CbN (resp. CbV) λ -calculus into the bang calculus is sound and complete : it maps β -reductions (resp. β v -reductions) of the λ -calculus into β ! -reductions of the bang calculus, and conversely β ! -reductions — when restrictedto the image of the translation — into β -reductions (resp. β v -reductions). Thesame holds if we consider any o -reduction for operators.In the simulation, −→ d denotes the contextual closure of the rule: ι ! T d T (this is nothing but ( λx.x )! T β ! T ) (4)Clearly, −→ d ⊆ −→ β ! (Remark 11). We write T ։ d S if T −→ ∗ d S and S is d -normal. Proposition 13 (Simulation of CbN and CbV).
Let t ∈ Λ O and o ∈ O .1. CbN soundness: If t −→ β t ′ then t n −→ β ! t ′ n . If t −→ o t ′ then t n −→ o t ′ n . CbN completeness: If t n −→ β ! S then S = t ′ n and t −→ β t ′ , for some t ′ ∈ Λ O .If t n −→ o S then S = t ′ n and t −→ o t ′ , for some t ′ ∈ Λ O . CbV soundness: If t −→ β v t ′ then t v −→ β ! −→ = d t ′ v with t ′ v d -normal. If t −→ o t ′ then t v −→ o −→ = d t ′ v with t ′ v d -normal. CbV completeness: If t v −→ β ! ։ d S then t v −→ β ! −→ = d S with S = t ′ v and t −→ β v t ′ , for some t ′ ∈ Λ O . If t v −→ o ։ d S then t v −→ o −→ = d S with S = t ′ v and t −→ o t ′ , for some t ′ ∈ Λ O .Example 14. Let t = (( λz.z ) x ) y and t ′ = xy . Then t −→ β t ′ while t n = (( λz.z )! x )! y −→ β ! x ! y = t ′ n ; and t −→ β v t ′ while t v = ( ι (( λz. ! z )! x ))! y −→ β ! ( ι ! x )! y −→ d x ! y = t ′ v . The bang calculus Λ ! has a natural normalizing strategy, issued by linear logic(where it was first used in [9]), namely the least-level reduction . It reduces onlyredexes at least level , where the level of a redex R in a term T is the number ofboxes ! in which R is nested.Least-level reduction is easily extended to a general bang calculus ( Λ ! O , −→ ).The level of a redex R is then the number of boxes ! and operators o in which R is nested; intuitively, least-level reduction fires a redex which is minimallynested .Below, we formalize the reduction in a way that is independent of the spe-cific shape of the redexes, and even of specific definition of level one chooses.The interest of least-level reduction is in the properties it satisfies. All our devel-opments will rely on such properties, rather than the specific definition of leastlevel.In this section, → = S ρ −→ ρ , for ρ ∈ Rules a set of rules. We write R = S ρ R ρ for the set of all redexes. The level of an occurrence of redex R in a term T is a measure of its depth.Formally, we indicate the occurrence of a subterm R in T with the context C such that C h R i = T . Its level then corresponds to the level ℓ ( C ) of the hole in C . The definition of level in a bang calculus Λ ! O is formalized as follows. ℓ ( h·i ) = 0 ℓ ( λx. C ) = ℓ ( C ) ℓ ( C T ) = ℓ ( C ) ℓ ( T C ) = ℓ ( C ) ℓ (! C ) = ℓ ( C ) + 1 ℓ ( o ( . . . , C , . . . )) = ℓ ( C ) + 1 (5)Note that the level increases by 1 in the scope of !, and of any operator o ∈ O .A reduction step T −→ ρ S is at level k if it fires a ρ -redex at level k ; it is least-level if it reduces a redex whose level is minimal.The least level ℓℓ ( T ) of a term T expresses the minimal level of any occurrenceof redexes in T ; if no redex is in T , we set ℓℓ ( T ) = ∞ . Formally Definition 15 (Least-level reduction).
Let → = S ρ → ρ ( ρ ∈ Rules ) and R = S ρ R ρ the set of redexes. Given a function ℓ ( − ) from contexts into N : actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 11 – The least level of a term T is defined as ℓℓ ( T ) := inf { ℓ ( C ) | T = C h R i for some R ∈ R} ∈ ( N ∪ {∞} ) . (6) – A ρ -reduction step T −→ ρ S is:1. at level k , written T −→ ρ : k S , if T := C h R i −→ ρ C h R ′ i =: S and ℓ ( C ) = k .2. least-level , written T → l ρ S , if T −→ ρ : k S and k = ℓℓ ( T ) .3. internal , written T → ¬ l ρ S , if T −→ ρ : k S and k > ℓℓ ( T ) . – Least-level reduction is → l = S ρ → l ρ ( ρ ∈ Rules ). – Internal reduction is → ¬ l = S ρ → ¬ l ρ ( ρ ∈ Rules ). Note that → = → l ∪ → ¬ l . Note also that the definition of least level of a termdepends on the set R = S ρ R ρ of redexes associated with → . Normal Forms.
It is immediate that → l ⊂→ is a strategy for → . Indeed, → l and → have the same normal forms because if M has a → -redex, it has a redex atleast-level, i.e. it has a → l -redex. Remark 16 (Least level of normal forms).
Note that ℓℓ ( T ) = ∞ if and only if T is → -normal, because ℓ ( C ) ∈ N for all contexts C . A good least-level reduction.
The beauty of least-level reduction for the bangcalculus, is that it satisfies some elegant properties, which allow for neat proofs,in particular monotonicity and internal invariance (in Definition 17). The devel-opments in the rest of the paper rely on such properties, and in fact will applyto any calculus whose reduction → has the properties described below. Definition 17 (Good least-level).
A reduction → has a good least-level if:1. Monotonocity: T → S implies ℓℓ ( T ) ≤ ℓℓ ( S ) .2. Internal invariance: T → ¬ l S implies ℓℓ ( T ) = ℓℓ ( S ) . Point 1. states that no step can decrease the least level of a term. Point 2. saysthat internal steps cannot change the least level of a term. Therefore, only least-level steps may increase the least level. Together, they imply persistence: onlyleast-level steps can approach normal forms.
Property 18 (Persistence) If → has a good least-level, then T → ¬ l S implies S is not → -normal. The pure bang calculus ( Λ ! , → β ! ) has a good least-level; the same holds truewhen extending the reduction with operators. Proposition 19 (Good least-level of bang calculi).
Given Λ ! O , let → = → β ! ∪ → O , where each o ∈ O has a redex of shape o ( P , . . . , P k ) . The reduction → has a good least-level. Recall that inf ∅ = ∞ , when ∅ is seen as the empty subset of N with the usual order. We should write ℓℓ R ( T ), l R and → l R ρ , but we avoid it for the sake of readability.2 C. Faggian, G. Guerrieri Let us examine more closely least-level reduction for a bang calculus ( Λ ! O , −→ ).For concreteness, we consider Rules = { β ! , o | o ∈ O} , hence the set of redexesis R = R β ! ∪ R O , where R O is a set of terms of shape o ( P , . . . , P k ).We observe that the least level ℓℓ ( T ) of a term T ∈ Λ ! O can easily be definedin a direct way, inductively. – ℓℓ ( T ) = 0 if T ∈ R = R β ! ∪ R O , – otherwise: ℓℓ ( x ) = ∞ ℓℓ ( λx.T ) = ℓℓ ( T ) ℓℓ (! T ) = ℓℓ ( T )+1 ℓℓ ( T S ) = min { ℓℓ ( T ) , ℓℓ ( S ) } Example 20 (Least level of a term).
Let R ∈ R β ! . If T := R (! R ), then ℓℓ ( T ) =0. If T := x ! R then ℓℓ ( T ) = 1. If T := o ( x, y )! R then ℓℓ ( T ) = 0, as o ( x, y ) ∈R o .Intuitively, least-level reduction fires a redex that is minimally nested , wherea redex is any subterm whose form is in R = R β ! ∪ R O . Note that least-levelreduction can choose to fire one among possibly several redexes at minimal level. Example 21.
Let us revisit Example 20 with R = ( λx.x )! z ∈ R β ! ( R β ! z ).Then T := x ! R → l β ! x ! z but T := R (! R ) l R ! z and similarly T := o ( x, y ) ! R l β ! o ( x, y )! z . Observe also that o ( x, R ) l β ! o ( x, z ). Example 22.
Let R = ( λx.x )! z . Two least-level steps are possible in ( λz.R )! R :( λz.R )! R → l β ! ( λx.x )! R , and ( λz.R )! R → l β ! ( λz.z )! R . But ( λz.R )! R l β ! ( λz.R )! z . λ -calculi The definition of least-level reduction in Section 4.1 is independent from thespecific notion of level that is chosen, and also from the specific calculus. Theidea is that the reduction strategy persistently fires a redex at minimal level,once such a notion is set.Least-level reduction can indeed be defined also for the CbN and CbV λ -calculi, given an opportune definition of level. In CbN, we count the numberof nested arguments and operators containing the occurrence of redex. In CbV,we count the number of nested operators and unapplied abstractions containingthe redex, where an abstraction is unapplied if it is not the right-hand sideof an application. Formally, an occurrence of redex is identified by a context(as explained in Section 4.1), and we define the following ℓ CbN ( · ) and ℓ CbV ( · )functions from C to N , the level in CbN and CbV λ -calculi. ℓ CbN ( h·i ) = 0 ℓ CbV ( h·i ) = 0 ℓ CbN ( λx. c ) = ℓ CbN ( c ) ℓ CbV ( λx. c ) = ℓ CbV ( c ) + 1 ℓ CbN ( c t ) = ℓ CbN ( c ) ℓ CbV ( c t ) = ( ℓ CbV ( c ′ ) if c = λx. c ′ ℓ CbV ( c ) otherwise ℓ CbN ( t c ) = ℓ CbN ( c ) + 1 ℓ CbV ( t c ) = ℓ CbV ( c ) ℓ CbN ( o ( . . . , c , . . . )) = ℓ CbN ( c ) + 1 ℓ CbV ( o ( . . . , c , . . . )) = ℓ CbV ( c ) + 1actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 13 In both CbN and CbV λ -calculi, the least level of a term (denoted by ℓℓ CbN ( · )and ℓℓ CbV ( · )) and least-level and internal reductions are given by Definition 15(replace ℓ ( · ) with ℓ CbN ( · ) for CbN and ℓ CbV ( · ) for CbV).In Section 5 we will see that the definitions of CbN and CbV least level are notarbitrary, but induced by the CbN and CbV translations defined in Section 3.3. Here we refine the analysis of the CbN and CbV translations given in Section 3.3,by showing two new results: translations preserve normal forms (Proposition 23)and least-level (Proposition 26), back and forth. This way, to obtain least-level factorization or least-level normalization results, it suffices to prove them in thebang calculus. The translation transfers the results into the CbN and CbV λ -calculi (Theorem 27). We use here the expression “translate” in a strong sense:the results for CbN and CbV λ -calculi are obtained from the correspondingresults in the bang calculus almost for free, just via CbN and CbV translations. Preservation of normal forms.
The targets of the CbN translation ( · ) n and CbVtranslation ( · ) v into the bang calculus can be characterized syntactically . A fineanalysis of these fragments of the bang calculus (see [ ? ] for details) proves thatboth CbN and CbV translations preserve normal forms, back and forth. Proposition 23 (Preservation of normal forms).
Let t, s ∈ Λ and o ∈ O .1. CbN: t is β -normal iff t n is β ! -normal; t is o -normal iff t n is o -normal.2. CbV: t is β v -normal iff t v is β ! -normal; t is o -normal iff t v is o -normal. By Remark 16, Proposition 23 can be seen as the fact that CbN and CbVtranslations preserve the least-level of a term, back and forth, when the least-levelis infinite. Actually, this holds more in general for any value of the least-level.
Preservation of levels.
We aim to show that least-level steps in CbN and CbV λ -calculi correspond to least-level steps in the bang calculus, back and forth, viaCbN and CbV translations respectively (Proposition 26). This result is subtle,one of the main technical contributions of this paper.First, we extend the definition of translations to contexts. The CbN andCbV translations for contexts are two functions ( · ) n : C −→ C ! and ( · ) v : C −→C ! , respectively, mapping contexts of the λ -calculus into contexts of the bangcalculus: h·i n = h·i h·i v = h·i ( λx. c ) n = λx. c n ( λx. c ) v = !( λx. c v )( o ( t , ..., c , ..., t k )) n = o ( t n , ..., c n , ..., t n k ) ( o ( t , ..., c , ..., t k )) v = o ( t v , ..., c v , ..., t v k )( c t ) n = c n !( t n ) ( c t ) v = ( C t v if c v = ! C ( ι c v ) t v otherwise( t c ) n = t n !( c n ) ; ( t c ) v = ( T c v if t v = ! T ( ι t v ) c v otherwise.4 C. Faggian, G. Guerrieri Note that CbN (resp. CbV) level of a context defined in Section 4.3 increasesby 1 whenever the CbN (resp. CbV) translation for contexts add !. Thus, CbNand CbV translations preserve, back and forth, the level of a redex and theleast-level of a term. Said differently, the level for CbN and CbV is defined inSection 4.3 so as to enable the preservation of level via CbN and CbV transla-tions.
Lemma 24 (Preservation of level via CbN translation). For contexts:
For any context c ∈ C , one has ℓ CbN ( c ) = ℓ ( c n ) .2. For reduction:
For any term t ∈ Λ O : t −→ β : k s if and only if t n −→ β ! : k s n ; and t −→ o : k s if and only if t n −→ o : k s n , for any o ∈ O .3. For least-level of a term:
For any term t ∈ Λ O , one has ℓℓ CbN ( t ) = ℓℓ ( t n ) . Lemma 25 (Preservation of level via CbV translation). For contexts:
For any context c ∈ C , one has ℓ CbV ( c ) = ℓ ( c v ) .2. For reduction:
For any term t ∈ Λ O : t −→ β v : k s if and only if t v −→ β ! : k −→ = d : k s v ;and t −→ o : k s if and only if t v −→ o : k −→ = d : k s v , for any o ∈ O .3. For least-level of a term:
For any term t ∈ Λ O , one has ℓℓ CbV ( t ) = ℓℓ ( t v ) . From the two lemmas above it follows that CbN and CbV translations pre-serve least-level and internal reductions, back and forth.
Proposition 26 (Preservation of least-level and internal reductions).
Let t be a λ -term and o ∈ O .1. CbN least-level: t → l β s iff t n → l β ! s n ; and t → l o s iff t n → l o s n .2. CbN internal: t → ¬ l β s iff t n → ¬ l β ! s n ; and t → ¬ l o s iff t n → ¬ l o s n .3. CbV least-level: t → l β v s iff t v → l β ! → l d = s v ; and t → l o s iff t v → l o → l d = s v .4. CbV internal: t → l β v s iff t v → ¬ l β ! → ¬ l d = s v ; and t → l o s iff t v → ¬ l o → ¬ l d = s v . As a consequence, least-level reduction induces factorization in CbN and CbV λ -calculi as soon as it does in the bang calculus. And, by Proposition 23, it is anormalizing strategy in CbN and CbV as soon as it is so in the bang calculus. Theorem 27 (Factorization and normalization by translation).
Let Λ cbn O = ( Λ O , → β ∪ → O ) and Λ cbv O = ( Λ O , → β v ∪ → O ) .1. If Λ ! O admits least-level factorization Fact ( → l , → ¬ l ) , then so do Λ cbn O and Λ cbv O .2. If Λ ! O admits least-level normalization, then so do Λ cbn O and Λ cbv O . A similar result will hold also when extending the pure calculi with a rule ρ other than o , as long as the translation preserves redexes. Remark 28 (Preservation of least-level and of normal forms.).
Preservation ofnormal form and least-level is delicate. For instance, it does not hold with thedefinition CbV translation ( · ) v in [16,29]. There, the translation t = rs ∈ Λ would be t v = ( ι !( r v )) s v and then Proposition 23 and Proposition 26 would nothold: ι !( r v ) is a β ! -redex in t v (see Remark 11) and hence t v would not be normaleven though so is t , and ℓℓ ( t v ) = 0 even though ℓℓ CbV ( t ) = 0. This is why wedefined two distinct case when defining ( · ) v for applications, akin to [8]. actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 15 We have shown that least-level factorization in a bang calculus Λ ! O implies least-level factorization in the corresponding CbN and CbV calculi, via forth-and-backtranslation. The central question now is how to prove least-level factorization fora bang calculus: the rest of the paper is devoted to that. Overview.
Let us overview our approach by considering O = { o } , and → = → β ! ∪ → o . Since by definition → l = → l β ! ∪ → l o (and → ¬ l = → ¬ l β ! ∪ → ¬ l o ), Lemma 8states that we can decompose least-level factorization of → in three modules:1. prove l -factorization of → β ! , i.e. → ∗ β ! ⊆ → l β ! ∗ · → ¬ l β !
2. prove l -factorization of → o , i.e. → o ∗ ⊆ → l o ∗ · → ¬ l o
3. prove the two linear swaps of Lemma 8.Please note that the least level for both → l β ! and → l o is defined with respect tothe redexes R = R β ! ∪ R o , so to have → l = → l β ! ∪ → l o . This addresses the issuewe mentioned in Example 1.Clearly, points 2. and 3. depend on the specific rule o . However, the beautyof a modular approach is that point 1. can be established in general: we do notneed to know o , only the shape of its redexes R o . In Section 6.1 we provide ageneral result of l -factorization for → β ! (Theorem 29). In fact, we shall show a bitmore: the way of decomposing the study of factorization that we have sketched,can be applied to study least-level factorization of any reduction → = → β ! ∪ → ρ ,as long as → has a good least-level.Once (1.) is established (once and for all), to prove factorization of a reduc-tion → β ! ∪ → o we are only left with (2.) and (3.). In Section 6.3 we show thatthe proof of the two linear swaps can be reduced to a single, simple test, involv-ing only the o step (Proposition 34). In Section 7, we will illustrate how allelements play together on a concrete case, applying them to non-deterministic λ -calculi. → β ! in a bang calculus We prove that → β ! -reduction factorizes via least-level reduction (Theorem 29).The result holds for a definition of → l β ! (as in Section 4) where the set of redexes R is R β ! ∪ R o —this generalization has essentially no cost, and allows us to useTheorem 29 as a module in the factorization of a larger reduction.We prove factorization via Takahashi’s Parallel Reduction method [31]. Wedefine a reflexive reduction ⇒ ¬ l β ! (called parallel internal β ! -reduction) which sat-isfies the conditions of Property 7, i.e. ⇒ ¬ l β ! ∗ = → ¬ l β ! ∗ and ⇒ ¬ l β ! · → l β ! ⊆→ l β ! ∗ · ⇒ ¬ l β ! .The tricky point is to prove ⇒ ¬ l β ! · → l β ! ⊆→ l β ! ∗ · ⇒ ¬ l β ! We adapt the prooftechnique in [3]. All details are in [ ? ]. Here we just give the definition of ⇒ ¬ l β ! . We first introduce ⇒ β ! : n (the parallel version of −→ β ! : n ), which fires simulta-neously a number of β ! -redexes at level at least n (and ⇒ β ! : ∞ does not reduceany β ! -redex: T ⇒ β ! : ∞ S implies T = S ). x ⇒ β ! : ∞ x T ⇒ β ! : n T ′ λx.T ⇒ β ! : n λx.T ′ T ⇒ β ! : m T ′ S ⇒ β ! : n S ′ T S ⇒ β ! :min { m,n } T ′ S ′ T ⇒ β ! : n T ′ ! T ⇒ β ! : n +1 ! T ′ T ⇒ β ! : n T ′ S ⇒ β ! : m S ′ ( λx.T )! S ⇒ β ! :0 T ′ { S ′ /x } The parallel internal β ! -reduction ⇒ ¬ l β ! is the parallel version of → ¬ l β ! , whichfires simultaneously a number of β ! -redexes that are not at minimal level. For-mally, T ⇒ ¬ l β ! S if T ⇒ β ! : n S with n = ∞ or n > ℓℓ ( T ). Theorem 29 (Least-level factorization of → β ! ). Assume → = → β ! ∪ → ρ has good least-level in Λ ! O . Then: T −→ ∗ β ! S implies T → l β ! ∗ · → ¬ l β ! ∗ S. Corollary 30 (Least-level factorization in the pure bang calculus).
Inthe pure bang calculus ( Λ ! , −→ β ! ) , if T −→ ∗ β ! S then T → l β ! ∗ · → ¬ l β ! ∗ S . Least-level factorization of → β ! implies in particular least-level factorization for → β and → β v . As a consequence, least-level reduction is a normalizing strategyfor all three pure calculi: the bang calculus, the CbN, and the CbV λ -calculi. The pure bang calculus. → l β ! is a normalizing strategy for → β ! . Indeed, itsatisfies all ingredients in Lemma 4. Since we have least-level factorization (Corol-lary 30)), same normal forms, and persistence (Proposition 19), → l β ! is a completestrategy for → β ! : If N is β ! -normal and M → ∗ β ! N, then M → l β ! ∗ N. We already observed (Example 22) that the least-level reduction → l β ! is non-deterministic, because several redexes at least level may be available. Such non-determinism is however inessential, because → l β ! is uniformly normalizing . Lemma 31 (Quasi-Diamond). In ( Λ ! , −→ β ! ) , the reduction → l β ! is quasi-diamond(Property 5), and therefore uniformly normalizing. Putting all the ingredients together, we have (by Lemma 4):
Theorem 32 (Least-level normalization).
In the pure bang calculus → l β ! is a normalizing strategy for → β ! . Theorem 32 means not only that if T is β ! -normalizable then T can reachits normal form by just performing least-level steps, but also that performing whatever least-level steps eventually leads to the normal form, if any. actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 17 Pure CbV and CbN λ -calculi. By forth-and-back translation (Theorem 27)the least-level factorization and normalization results for the pure bang calculusimmediately transfers to the CbN and CbV setting.
Theorem 33 (CbV and CbN least-level normalization).–
CbN: In ( Λ, → β ) , → l β is a normalizing strategy for → β . – CbV: In ( Λ, → β v ) , → l β v is a normalizing strategy for → β v . As anticipated at the beginning of this section, we can use Theorem 29 also aspart of the proof of factorization for a more complex calculus. We now introduceone more useful tool: a simple test to establish least-level factorization of areduction → β ! ∪ → ρ (where → ρ is a new reduction added to → β ! ). We shall givean example of its use in Section 7 (see the proof of Theorem 36).The test embodies Lemma 8, and the fact that we already know (once forall) that → β ! factorizes via → l β ! . It turns out that the proof of the two linearswaps can be reduced to a single, simple test, which only involves the ρ step. Proposition 34 (Test for modular least-level factorization).
Let → ρ bethe contextual closure of a rule ρ , and assume → = ( → β ! ∪ → ρ ) has a goodleast-level. Then → factorizes via → l = ( → l β ! ∪ → l ρ ) if the following hold:1. l -factorization of → ρ : → ∗ ρ ⊆ → l ρ ∗ · → ¬ l ρ ∗ ρ is substitutive : R ρ R ′ implies R { Q/x } 7→ ρ R ′ { Q/x } . Root linear swap : → ¬ l β ! · 7→ ρ ⊆ 7→ ρ · → ∗ β ! . Note that, as usual, at point (1.) the least level is defined w.r.t. R = R ! β ∪R ρ . λ -calculi To show how to use our framework, we apply the set of tools which we havedeveloped on our running example. We extend the bang calculus with a non-deterministic operator, then considering ( Λ ! ⊕ , → β ! ⊕ ) where → β ! ⊕ = ( → β ! ∪ → ⊕ ), and → ⊕ is the contextual closure of the (non-deterministic) rules: o ( P, Q ) ⊕ P o ( P, Q ) ⊕ Q (7) First step: non-deterministic bang calculus.
We analyze Λ ! ⊕ . We use our modulartest to prove least-level factorization for Λ ! ⊕ : if → ∗ β ! ⊕ U then T → l β ! ⊕∗ · → ¬ l β ! ⊕∗ U . By Lemma 4, an immediate consequence of the factorization result is that theleast-level strategy is complete , i.e. if U is normal: T → ∗ β ! ⊕ U implies T → l β ⊕∗ U . Second step: CbN and CbV non-deterministic calculi.
By translation, we have for free , that the analogous results hold in Λ cbn ⊕ and Λ cbv ⊕ , as defined in Example 9.So, least-level factorization holds for both calculi, and moreover – CbN completeness : in Λ cbn ⊕ , if u is normal: t → ∗ β ⊕ u implies t → l β ⊕∗ u . – CbV completeness : in Λ cbv ⊕ , if u is normal: t → ∗ β v ⊕ u implies t → l β v ⊕∗ u . What do we really need to prove?
The only result we need to prove is least-level factorization of → β ! ⊕ . Completeness then follows by Lemma 4 and thetranslations will automatically take care of transferring the results.To prove factorization of → β ! ⊕ , most of the work is done, as l -factorizationof → β ! is already established; we then use our test (Proposition 34) to extend → β ! with → ⊕ . The only ingredients we need are substitutivity of ⊕ (which isan obvious property), and the following easy lemma. Lemma 35 (Roots).
Let ρ ∈ { β ! , ⊕} . If T → ¬ l ρ P ⊕ S then T ⊕ · → = ρ S . Theorem 36 (Least-level factorization).
1. In ( Λ ! ⊕ , −→ ) , Fact ( → l , → ¬ l ) holds for → = → ⊕ ∪ → β ! .2. Least-level factorization holds in ( Λ cbn ⊕ , → ⊕ ∪ → β ) , and in ( Λ cbv ⊕ , → ⊕ ∪ → β v ) .Proof.
1. It is enough to verify the hypotheses of Proposition 34.2. It follows from Theorem 27 and Theorem 36.1. ⊓⊔ The combination of translations (Theorem 27), l -factorization for → β ! (Theo-rem 29), and modularity (Proposition 34), give us a powerful method to analyzefactorization in various λ -calculi that extend the pure CbN and CbV calculi. Themain novelty is transferring the results from a calculus to another via transla-tions.We chose to study least-level reduction as a normalizing strategy because it isnatural to define in the bang calculus, and it is easier to transfer via translationsto CbN and CbV calculi than leftmost-outermost. Since leftmost-outermost isthe most common normalizing strategy in CbN, it is worth noticing that least-level normalization implies leftmost-outermost normalization (and vice-versa).This is an easy consequence of the—easy to check—fact that their union isquasi-diamond (and hence, again, uniformly normalizing). A proof of least-levelnormalization lends a proof also of leftmost-outermost normalization. Related Work.
Many calculi inspired by linear logic subsumes CbN and CbV,such as [6,7,28,24] (other than the ones already cited). We chose the bang calculusfor its simplicity, which eases the analysis of the CbN and CbV translations.Least-level reduction is studied for linear-logic-based calculi in [33,2] and forlinear logic proof-nets in [9,26]. Least-level factorization and normalization forthe pure CbN λ -calculus is studied in [3]. actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 19 References (20), 1884–1902 (2011)10. Chouquet, J., Tasson, C.: Taylor expansion for Call-By-Push-Value. In:28th EACSL Annual Conference on Computer Science Logic (CSL 2020).Leibniz International Proceedings in Informatics (LIPIcs), vol. 152, pp.16:1–16:16. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik (2020).https://doi.org/10.4230/LIPIcs.CSL.2020.1611. Ehrhard, T.: Call-by-push-value from a linear logic point of view. In: ProgrammingLanguages and Systems - 25th European Symposium on Programming (ESOP2016). Lecture Notes in Computer Science, vol. 9632, pp. 202–228 (2016)12. Ehrhard, T., Guerrieri, G.: The bang calculus: an untyped lambda-calculus gen-eralizing call-by-name and call-by-value. In: Proceedings of the 18th InternationalSymposium on Principles and Practice of Declarative Programming (PPDP 2016).pp. 174–187. ACM (2016). https://doi.org/10.1145/2967973.296860813. Faggian, C., Ronchi Della Rocca, S.: Lambda calculus and probabilistic computa-tion (extended version), available at http://arxiv.org/abs/1901.02853
14. Faggian, C., Ronchi Della Rocca, S.: Lambda calculus and probabilistic compu-tation. In: 34th Annual ACM/IEEE Symposium on Logic in Computer Science,LICS 2019. pp. 1–13 (2019). https://doi.org/10.1109/LICS.2019.87856990 C. Faggian, G. Guerrieri15. Girard, J.: Linear logic. Theor. Comput. Sci. , 1–102 (1987).https://doi.org/10.1016/0304-3975(87)90045-416. Guerrieri, G., Manzonetto, G.: The bang calculus and the two Girard’s translations.In: Proceedings Joint International Workshop on Linearity & Trends in LinearLogic and Applications (Linearity-TLLA 2018). EPTCS, vol. 292, pp. 15–30 (2019)17. Hindley, J.R.: The Church-Rosser Property and a Result in Combinatory Logic.Ph.D. thesis, University of Newcastle-upon-Tyne (1964)18. Hindley, J.R., Seldin, J.P.: Introduction to Combinators and Lambda-Calculus.Cambridge University Press (1986)19. Hirokawa, N., Middeldorp, A., Moser, G.: Leftmost Outermost Revisited.In: 26th International Conference on Rewriting Techniques and Applica-tions (RTA 2015). Leibniz International Proceedings in Informatics (LIPIcs),vol. 36, pp. 209–222. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik (2015).https://doi.org/10.4230/LIPIcs.RTA.2015.20920. Levy, P.B.: Call-by-push-value: A subsuming paradigm. In: Typed LambdaCalculi and Applications, 4th International Conference (TLCA’99).Lecture Notes in Computer Science, vol. 1581, pp. 228–242 (1999).https://doi.org/10.1007/3-540-48959-2 1721. Levy, P.B.: Call-by-push-value: Decomposing call-by-value and call-by-name. High. Order Symb. Comput. (4), 377–414 (2006).https://doi.org/10.1007/s10990-006-0480-622. de’ Liguoro, U.: Non-deterministic untyped λ -calculus. A study about explicit nondeterminism in higher-order functional calculi. Ph.D. thesis, Universit`a di RomaLa Sapienza (1991),
23. de’ Liguoro, U., Piperno, A.: Non deterministic extensions of untyped lambda-calculus. Inf. Comput. (2), 149–177 (1995)24. Maraist, J., Odersky, M., Turner, D.N., Wadler, P.: Call-by-name, call-by-value,call-by-need and the linear lambda calculus. Theor. Comput. Sci. (1-2), 175–210 (1999). https://doi.org/10.1016/S0304-3975(98)00358-225. Newman, M.: On theories with a combinatorial definition of equivalence. Annalsof Mathematics (1942)26. Pagani, M., Tranquilli, P.: The conservation theorem for differ-ential nets. Math. Struct. Comput. Sci. (6), 939–992 (2017).https://doi.org/10.1017/S096012951500045627. Plotkin, G.D.: Call-by-name, call-by-value and the lambda-calculus. Theor. Com-put. Sci. (2), 125–159 (1975)28. Ronchi Della Rocca, S., Roversi, L.: Lambda calculus and intuitionistic linear logic.Stud Logica (3), 417–448 (1997). https://doi.org/10.1023/A:100509263011529. Santo, J.E., Pinto, L., Uustalu, T.: Modal embeddings and calling paradigms. In:4th International Conference on Formal Structures for Computation and Deduc-tion, FSCD 2019. LIPIcs, vol. 131, pp. 18:1–18:20. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2019). https://doi.org/10.4230/LIPIcs.FSCD.2019.1830. Simpson, A.K.: Reduction in a linear lambda-calculus with applications to oper-ational semantics. In: Term Rewriting and Applications, 16th International Con-ference (RTA 2005). Lecture Notes in Computer Science, vol. 3467, pp. 219–234(2005). https://doi.org/10.1007/978-3-540-32033-3 1731. Takahashi, M.: Parallel reductions in lambda-calculus. Inf. Comput. (1), 120–127 (1995)32. Terese: Term Rewriting Systems, Cambridge Tracts in Theoretical Computer Sci-ence, vol. 55. Cambridge University Press (2003)actorization in Call-by-Name and Call-by-Value Calculi via Linear Logic 2133. Terui, K.: Light affine lambda calculus and polynomial time strong normalization.Archive for Mathematical Logic46