Abstract 1 Introduction 2 Mixed Graded/Linear Logic: Proofs and Terms 3 Model 4 Natural Deduction 5 Discussion References

A Mixed Linear and Graded Logic:
Proofs, Terms, and Models

Victoria Vollmer ORCID School of Computing, University of Kent, UK Danielle Marshall ORCID School of Computing, University of Kent, UK Harley Eades III ORCID Computer Science, Augusta University, GA, USA Dominic Orchard ORCID School of Computing, University of Kent, UK
Department of Computer Science and Technology, University of Cambridge, UK
Abstract

Graded modal logics generalise standard modal logics via families of modalities indexed by an algebraic structure whose operations mediate between the different modalities. The graded “of-course” modality !r captures how many times a proposition is used and has an analogous interpretation to the of-course modality from linear logic; the of-course modality from linear logic can be modelled by a linear exponential comonad and graded of-course can be modelled by a graded linear exponential comonad. Benton showed in his seminal paper on Linear/Non-Linear logic that the of-course modality can be split into two modalities connecting intuitionistic logic with linear logic, forming a symmetric monoidal adjunction. Later, Fujii et al. demonstrated that every graded comonad can be decomposed into an adjunction and a “strict action”. We give a similar result to Benton, leveraging Fujii et al.’s decomposition, showing that graded modalities can be split into two modalities connecting a graded logic with a graded linear logic. We propose a sequent calculus, its proof theory and categorical model, and a natural deduction system which we show is isomorphic to the sequent calculus system. Interestingly, our system can also be understood as Linear/Non-Linear logic composed with an action that adds the grading, further illuminating the shared principles between linear logic and a class of graded modal logics.

Keywords and phrases:
linear logic, graded modal logic, adjoint decomposition
Copyright and License:
[Uncaptioned image] © Victoria Vollmer, Danielle Marshall, Harley Eades III, and Dominic Orchard; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Logic
Related Version:
Full version with appendices: https://arxiv.org/abs/2401.17199 [40]
Acknowledgements:
We thank all the anonymous reviewers of this, and previous versions, of this paper. We are also grateful for discussions with Peter Hanukaev and helpful comments from Paulo Torrens on a draft of this manuscript.
Funding:
This work was supported in part by the EPSRC grant EP/T013516/1 (Verifying Resource-like Data Use in Programs via Types). The second author received support through Schmidt Sciences, LLC.
Editors:
Jörg Endrullis and Sylvain Schmitz

1 Introduction

Intuitionistic logic has a central role in the foundations of programming language theory, providing a logical basis for type theories and type systems, and other program reasoning principles. A significant amount of the expressivity of proof systems for intuitionistic logic (both natural deduction and sequent calculus forms) lies within the structure of the hypotheses – the context. Probing the foundations of this part of the logic has, perhaps surprisingly, yielded the very fertile field of substructural logics [39] including influential logics such as linear logic [14] and its variants, and the Lambek calculus [25].

By restricting the manipulation of hypotheses in the context we typically arrive at logics which align more closely with physical reality, where propositions are instead “resources” that cannot necessarily be copied, discarded, or reordered. Such restricted logics have been used to construct type systems for safely manipulating values that should be treated in a resourceful way, such as file handlers, pointers to mutable memory, or channels [43, 42].

However, such pervasive restrictions often hamper expressivity and thus some substructural logics then seek to carefully control the reintroduction of structural rules. For example, linear logic provides the ! modality (“of course”) for reintroducing weakening and contraction of propositions, which linear logic otherwise prohibits. However, this modality is coarse-grained: for those propositions under the modality, it re-enables all the structural rules that have been removed in linear logic. Subexponentials instead aim to be more fine-grained, offering families of modalities capturing specific structural rules [8, 22]. The related notion of grading [12, 31] gives an alternate view, providing an indexed family of modalities whose indices are subject to an algebra which accounts for any structural rules applied: structural rules are “counted” by the algebra (whose operations mirror the shape of structural rules). Bounded Linear Logic [15] is a special case where the family of modalities !nA uses indices n which are natural numbers (or polynomial terms over naturals) counting the upper bound on usage of the proposition A. Various systems generalise this approach to arbitrary semirings to capture data-flow properties [1, 2, 5, 12, 13, 24, 28, 31, 33, 34, 36]. Such graded systems annotate hypotheses/variables in the context with elements of the semiring (“grades”) denoting their usage, e.g., x:0At:B types a term t which does not use x and y:1+1At:B types a term t in which y is used in two different subterms once each, accounted for by the semiring addition. A graded modality internalises the semiring grade, causing a multiplication to the grades of any captured dependencies when the graded modality is introduced, e.g., y:0(1+1)At:0B.

We seek here to further understand the underlying structure of graded modal logics by following an “adjoint resolution” approach à la Benton’s seminal “A Mixed Linear and Non-Linear Logic: Proofs, Terms and Models” at CSL 1994 [3]. Benton showed that the exponential modality of linear logic (modelled by a comonad) can be decomposed into an adjunction, defining a pair of “adjoint” logics (a linear logic and a non-linear intuitionistic, or “Cartesian”, logic) which embed into each other [3]. This provides a beautiful reduction of the core features of linear logic and its non-linearity modality. Adjoint logic applies the same idea but to subexponentials [37, 38]. We follow the same scheme, via the adjoint decomposition of graded modalities which generalise linear logic’s ! and which are traditionally modelled by graded exponential comonads [5, 6, 12, 13, 24, 34]. Whilst Benton’s work has a pair of adjoint modalities mediating between the two sublogics, we have a pair of a modality 𝖫𝗂𝗇 and a graded modality 𝖦𝗋𝖽r. We give a categorical model, showing that these are captured by an LNL-like adjunction paired with a “strict action” for incorporating the grading, following the Fujii-Katsumata-Melliès adjoint decomposition of graded (co)monads [10, 24]. The result is a pair of logics which serve to explain and clarify the relationship between linearity and grading. We call our system Mixed Graded/Linear (𝗆𝖦𝖫) Logic.

This pair of logics also shines light on a relationship between two styles of graded system in the literature: those which take linear types as their basis augmented with a graded modality [6, 12, 31] versus those with no base notion of linearity where grading is pervasive, tracking all substructurality [1, 2, 4, 7, 28, 30, 34]. Our linear fragment is analogous to the former whilst our graded fragment is analogous to the latter. The mutual embedding shows that these two styles of graded logics have a similar relationship to the adjoint relationship of intuitionistic logic and linear logic.

Aside from the internal motivation of better understanding the relationship between grading and linearity, an external motivation for this work is that it can provide a basis for flexible, safe programming with resources. By separating out the linear fragment from an intuitionistic graded fragment, one could avoid the strictures of linearity for working with standard data types which need not be linear, working only in the linear fragment for handling resources like file handles. The mutual embedding would allow the programmer to move smoothly between these two subcalculi, as seen also in other adjunction-based calculi, e.g., for concurrent programming [35]. The focus here however is on the core theory rather than developing these applications yet.

Since our focus is on the relationship between grading and linearity, we consider the semiring-graded modalities that generalise linear logic’s !. Other flavours of graded modality (e.g., graded monads for capturing side effecting behaviour [23, 32]) are not considered here.

Roadmap

Section 2 defines a pair of sequent calculi, the mixed fragment 𝖬𝖲, which has both linear and graded assumptions, and the graded fragment 𝖦𝖲, which has only graded assumptions and no function arrow. As described above, these calculi have a mutual embedding via modalities between the two. Section 3 considers the categorical model of 𝗆𝖦𝖫 leveraging recent work on the adjoint resolution of graded comonads [10, 24]. Section 4 provides the natural deduction formulation of the calculus, which is proved equivalent to the sequent calculus version. Section 5 discusses how this work gives a view on the landscape of graded systems in the literature and considers other related work and future applications.

A version of this paper with the appendices providing full proof details can be found on the arXiv [40].

2 Mixed Graded/Linear Logic: Proofs and Terms

(𝖦𝖲/𝖦𝖳)t::=x𝗃𝗅𝖾𝗍𝗃=t1𝗂𝗇t2graded(t1,t2)𝗅𝖾𝗍(x,y)=t1𝗂𝗇t2𝖫𝗂𝗇l(𝖬𝖲/𝖬𝖳)l::=x𝗂𝗅𝖾𝗍𝗂=l1𝗂𝗇l2linear(l1,l2)𝗅𝖾𝗍(x,y)=l1𝗂𝗇l2λx.ll1l2𝖦𝗋𝖽rt𝗅𝖾𝗍𝖦𝗋𝖽rx=l1𝗂𝗇l2𝖴𝗇𝗅𝗂𝗇z𝗅𝖾𝗍𝗃=z𝗂𝗇l𝗅𝖾𝗍(x,y)=z𝗂𝗇l

Variables are ranged over by x, y, z in both fragments.

Terms are mostly grouped above with introduction forms followed by elimination forms, though note that in the last two lines of syntax for l there are additional eliminators: for the linear modality (𝖴𝗇𝗅𝗂𝗇), for units 𝗃, and for tensors coming from the graded context.

Figure 1: Collected term syntax.

We present first a sequent calculus for Mixed Graded/Linear logic, which comes in the form of a term assignment. Figure 1 collects the term syntax for reference; it will also be used in Section 4 for the natural deduction formulation. The syntax is explained with reference to its associated proof rules in the next section.

Benton’s approach has two proof systems [3]: one system of linear propositions (the L of LNL) with two contexts for linear and non-linear propositions respectively, and one system of non-linear propositions (the NL in LNL). We generalise this approach to the graded setting by replacing the non-linear parts with graded notions. Thus, our system (𝗆𝖦𝖫) has two analogous proof systems: one of linear propositions with two contexts for linear and graded propositions, with judgments subscripted as 𝖬𝖲 (for “Mixed (linear/graded) Sequent”), and one system of graded propositions, with judgments subscripted as 𝖦𝖲 (“Graded Sequent”).

The syntax of Benton’s propositions is split into two, “conventional” (i.e., Cartesian / non-linear) and linear [3]. The syntax of our propositions is analogously split into two, graded and linear:

(Graded)X,Y,Z::=𝖩XY𝖫𝗂𝗇A(Linear)A,B,C::=𝖨ABAB𝖦𝗋𝖽rX

where 𝖩 and 𝖨 are unit types, and and are tensor (product) operators in their respective domains. In the case of the linear domain, the product is the standard multiplicative conjunction. The 𝖫𝗂𝗇 modality encapsulates a linear proposition as a graded proposition, and the 𝖦𝗋𝖽r modality encapsulates a graded proposition (at grade r, whose structure is defined below) as a linear proposition. Thus, the two logics are interconnected by 𝖦𝗋𝖽rX and 𝖫𝗂𝗇A. Using these two modalities we will later define graded modalities rA as 𝖦𝗋𝖽r(𝖫𝗂𝗇A), similarly to how the of-course modality !A can be defined in LNL logic as the composition of two adjoint modalities.

Definition 1.

Grades (ranged over by r,s) are drawn from a semiring parameterizing the system (,1,,𝟢,+,) with preorder (,) such that both and + are monotonic wrt .

The semiring governs the structural rules: the additive part of the semiring is involved in weakening and contraction, and the multiplicative part in usage and composition. Various concrete examples of interesting semirings are given at the end of Subsection 2.1.

Section 4 develops an equivalent natural deduction formulation of 𝗆𝖦𝖫. We then show that the natural deduction and the sequent calculus are interderivable without modifying the term witnessing a derivation. Thus, any semantic model of one is a model of the other. We opt to focus on the sequent calculus form for now without loss of generality.

2.1 Sequent Calculus

We first define contexts used in the judgments:

Definition 2 (Graded contexts).

Suppose (,1,,𝟢,+,) is a preordered semiring (Def. 1). Then grade vectors δ are sequences of , contexts Δ are sequences of graded formulas X, and contexts Γ are sequences of linear formulas:

δ:=δ,rΔ:=Δ,x:XΓ:=Γ,x:A

The comma operator is overloaded for sequence concatenation, i.e., we can write δ1,δ2 and Δ1,Δ2, which further requires that Δ1 and Δ2 are disjoint contexts.

A graded context δΔ is a pairing of a grade vector and a context defined as follows:

=(δ,r)(Δ,x:X)=(δΔ),x:(rX)

where rX pairs a formula with a grade r capturing (by the rules of the system) how the formula X (named x) is used to form a judgment.

We lift the operations of semirings to grade vectors, forming a semimodule, with the pointwise addition and scalar multiplication defined in a standard way:

+ = r =
(δ1,r1)+(δ2,r2) =(δ1+δ2),(r1+r2) r(δ,s) =(rδ),(rs)

Addition of grade vectors requires the vectors to be of the same length.

The judgment form for our fully graded logic δΔ𝖦𝖲t:X captures a concluding proposition X under the graded context of assumptions δΔ. Mixed graded/linear logic judgments δΔ;Γ𝖬𝖲l:A are similar but also have a context Γ of linear assumptions which, being linear, do not have a corresponding grade vector.

The two judgments 𝖦𝖲 and 𝖬𝖲 (also called sub-logics or fragments) are defined by mutual induction. We present conceptually related rules from both systems side-by-side where possible, or one-after-the-other, in the order 𝖦𝖲 then 𝖬𝖲.

The identity (axiom) rules are:

The multiplicative identity 1 is the “default” grade for formulas in the graded logic 𝖦𝖲 (left), in the sense that we can think of the right-hand side of the judgment as also implicitly having grade 1. The graded identity rule says that a graded formula that is used must have the default grade. For example, in the natural number semiring (,1,,0,+,=) the multiplicative identity 1 captures linear usage. The mixed identity rule types linear assumption use, requiring just a singleton linear context (forcing a lack of weakening). It also requires that there are no graded formulas in context – the graded context is empty .

The “cut” rules are:

The cutGS rule provides a cut through a graded proposition X of grade r in the receiving context (second premise). Thus, the resulting term uses semiring multiplication (lifted to contexts, Def. 2) to capture sequential usage, scaling the grade vector δ2 of the cut term t1 by r. The cutMS rules provides a cut through a linear proposition A and has no effect on the graded contexts. However, 𝖬𝖲 has a further cut rule gcutMS for graded propositions in its graded context, incurring a scaling similarly to cutGS. This pattern occurs throughout: operations applied to the graded context in 𝖦𝖲 have a sister rule in 𝖬𝖲 applying the same operation in the 𝖬𝖲 graded context.

Both sub-logics have free use of exchange:

Exchanging graded propositions simultaneously exchanges their grades in the grade vector.

We can use weakening and contraction in the graded system and the mixed system within the graded contexts, with the semiring’s 0 representing weakened hypotheses and the grades of contracted hypotheses combined via semiring addition +:

The left and right rules for units for the graded and mixed logics are akin to linear logic:

Thus, in 𝖦𝖲, we can eliminate a graded unit 𝗃 at an arbitrary grade r, whereas the linear unit 𝗂 in 𝖬𝖲 gets eliminated from the linear context. The additional left rule (unitL𝖩𝖬𝖲) for 𝖬𝖲 again similarly eliminates graded units 𝖩 in the graded context.

Tensor products are then eliminated in each fragment as follows:

The left rule for eliminates from the graded context at any grade r, where the components of the tensor product both inherit this grade in the premise. Reading instead top-down, the graded tensor product requires that both components are graded with the same grade; this is similar to linear products, where both components are linear.

Note that Benton has two left rules for (non-linear) tensor products, in the “projection” style. We instead must use the pattern matching style for the soundness of grading so that each component is bound to a variable with the same grade.

Only the mixed linear-graded system has implication, and only on linear propositions, thus we have in 𝖬𝖲 with left and right rules:

In Lemma 4, we recover a graded implication through the modal operators of the system in the same way that Melliès did for (ungraded) LNL logic [29].

We now consider the modal operators 𝖫𝗂𝗇 and 𝖦𝗋𝖽r which connect the two sub-logics.

The right rule for the 𝖫𝗂𝗇 modality transports a linear formula from the linear system 𝖬𝖲 into the graded system 𝖦𝖲 where it can be reasoned with non-linearly as accounted for by grading. The corresponding left rule is akin to dereliction from linear logic, enabling a linear assumption x:A to treated as a (renamed) graded assumption z:𝖫𝗂𝗇A at grade 1:

The other modal operator 𝖦𝗋𝖽, or rather the family of modal operators 𝖦𝗋𝖽r, transports a graded formula with its grade into the linear system where it can be reasoned with linearly:

The right rule is akin to promotion for 𝖦𝗋𝖽r where we subsequently scale the graded context by the grade r. The left rule “unboxes” a graded modality 𝖦𝗋𝖽rX providing access to the X formula “inside”, graded at r.

Perhaps the most remarkable property of these modal operators is that they decompose semiring-graded necessity modalities into rA=𝖦𝗋𝖽r(𝖫𝗂𝗇A) [24] within the mixed system. In fact, their introduction and elimination rules are derivable:

Lemma 3 (𝗆𝖦𝖫 Graded Necessity Modality).

The following are derivable:

Proof.

The elimination rule follows by applying 𝖦𝗋𝖽L to the second premise and then applying cut with the first premise. The introduction rule follows by 𝖫𝗂𝗇R then 𝖦𝗋𝖽R. The previous lemma reveals a lot about the structure of existing graded type systems. First, graded hypotheses, usually denoted with their grade x:rA in the literature (e.g. [1, 31]), are graded hypotheses r𝖫𝗂𝗇A where the linear formula has been transported into the graded system. Second, the restriction to only graded variables in the promotion rule is very explicit in the introduction rule i above. Third, the elimination rule (here E) is really the left rule for 𝖦𝗋𝖽 followed by a cut. Thus, graded type systems, whilst typically of a natural deduction form, incorporate a little of the flavour of sequent calculi in the rules for graded modalities because of the integrated cut.

Using the modal operators we can derive a graded implication of the form 𝖦𝗋𝖽rXA:

Lemma 4 (𝗆𝖦𝖫 Graded Implication).

The following rules are derivable:

Proof.

The left rule follows by applying 𝖦𝗋𝖽R to the first premise, and then L using the second premise. The right rule follows by applying 𝖦𝗋𝖽L to the premise and then R. The final rules are the approximation rules for grades:

Approximation allows for the abstraction of grades along an ordering. For example, in the semiring (,1,,0,+,) where the order is the usual ordering on natural numbers, then a grade r stands for “at-most r”, generalising the notion of “affine” usage tracking. Disabling the ordering by forcing it to be true only in the case of reflexive pairs (i.e., an equality relation) results in exact usage tracking. This demonstrates that having a notion of approximation results in a more general usage tracking framework.

Example 5 (Derivation).

As an example derivation in the natural numbers semiring (,1,,0,+,), for “affine” usage tracking, the following copies an assumption to make a pair in the graded fragment, then uses an approximation, and then transports the pair into the linear fragment, scaling its grades further:

Example 6 (None-One-Tons [28]).

The semiring over {0,1,ω} with 0ω and 1ω, where + and are saturating at ω, can be used to distinguish between linear and various non-linear uses: assigning r=1 to linear usage, r=0 to non-usage (when a resource is discarded), and r=ω to arbitrary usage.

Note, however, that even with the above semiring we are unable to exactly represent the exponential modality ! from linear logic via some particular grade r within the graded logic. This is because no matter which grade we choose, we are able to “push” the grade into the tensor product using this graded tensor elimination (L), allowing derivation of 𝖦𝗋𝖽r(XY)(𝖦𝗋𝖽rX𝖦𝗋𝖽rY), and yet in linear logic it is not possible to derive !(AB)!A!B. Therefore, our logic cannot reduce to Benton’s LNL logic simply by taking the Cartesian (trivial) semiring, as one might expect at first glance. This quality is typical of graded base systems, so reconciling these with linear logic requires some additional structure on the semiring [18] (though this is not the focus here).

On the other hand, notice that we have another way to represent graded products: as linear products wrapped in the derived graded modality, or r(AB). Importantly, here it is not possible to “push” the grade “through” the tensor as we can for the graded product; we cannot derive (rA)(rB). This representation of graded products thus has behaviour more typical of a linear base graded type system, with our combined logic again giving us a clearer understanding of the relationship between these contrasting styles.

Example 7 (Security levels).

Information-Flow Control properties can be tracked by instantiating the semiring with a lattice of security levels [12], e.g., with ({𝖫𝗈𝖧𝗂},𝖫𝗈,,𝖧𝗂,) where 𝖧𝗂-graded inputs are treated as irrelevant: we cannot depend on any high-security inputs when building a low-security graded output 𝖦𝗋𝖽𝖫𝗈A.

Example 8 (Sensitivity).

The real number semiring (,1,,0,+,) can be leveraged to capture a notion of numerical sensitivity in programs/logic [11, 9], where a program is k-sensitive (for k) in a variable if a change ϵ in its inputs to x produces at most a change of kϵ in the output of the program. This instantiation of the system tracks sensitivities as grades where additional dependent-type-based mechanisms are needed to lift program values into the types, e.g., 𝗌𝖼𝖺𝗅𝖾:(k:)𝖦𝗋𝖽k.

2.2 Metatheory

𝗆𝖦𝖫 enjoys a rich metatheory. First, it satisfies cut elimination, for which we give the full proof. The proof of cut reduction requires a generalization of the graded cut rules to graded multicut rules in order to accommodate the structural rule of graded contraction.111Whilst cut reduction can be proved for intuitionistic sequent calculus without multicut [41], we use the standard multicut approach as it relates well to the categorical models developed later.

Thus, throughout the cut elimination proof we use the following graded multicut rules:

Both rules compute the contraction of the n hypotheses involved in the multicut on the cut-formula X. To do this we use row-vector matrix multiplication. We denote the matrix consisting of n-copies of the row vector δ2 by [δ2n]. Then row-vector multiplication is:

δ[δ2n]=k=1n(δ(k)δ2)

where the on the right is the scalar multiplication derived from the semiring, is the pointwise addition of vectors, and where δ(k) is the k-th element of the vector δ. This computes the usages of the hypotheses in Δ2 as the multiplication of a matrix of size 1×n with a matrix of size n×|Δ2| to yield a matrix of size 1×|Δ2|.

We now proceed with the proof of cut elimination. The rank 𝖱𝖺𝗇𝗄(X) and 𝖱𝖺𝗇𝗄(A) of a formula is the height of the input formula’s syntax tree where constants are of rank 0. The cut rank 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π) of a derivation Π of some judgment is defined to be one more than the maximum rank of the cut formula’s in Π, and 0 if Π is cut free. The depth 𝖣𝖾𝗉𝗍𝗁(Π) of a derivation Π is the length of the longest path in the proof tree of Π, and hence, the depth of an axiom is 0. We prove cut-elimination without term annotations on the rules, in keeping with traditional proofs.

Lemma 9 (Cut Reduction for 𝗆𝖦𝖫).
  1. 1.

    (Graded) If Π1 is a proof of δ2Δ2𝖦𝖲X and Π2 is a proof of (δ1,δ,δ3)(Δ1,Xn,Δ3)𝖦𝖲Y with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π1),𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π2)𝖱𝖺𝗇𝗄(X), then there exists a proof Π of (δ1,δ[δ2n],δ3)(Δ1,Δ2,Δ3)𝖦𝖲Y with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)𝖱𝖺𝗇𝗄(X).

  2. 2.

    (Graded/Mixed) If Π1 is a proof of δ2Δ2𝖦𝖲X and Π2 is a proof of (δ1,δ,δ3)(Δ1,Xn,Δ3);Γ𝖬𝖲B with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π1),𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π2)𝖱𝖺𝗇𝗄(X), then there exists a proof Π of (δ1,δ[δ2n],δ3)(Δ1,Δ2,Δ3);Γ𝖬𝖲B with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)𝖱𝖺𝗇𝗄(X).

  3. 3.

    (Mixed) If Π1 is a proof of δ2Δ2;Γ2𝖬𝖲A and Π2 is a proof of δ1Δ1;(Γ1,A,Γ3)𝖬𝖲B with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π1),𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π2)𝖱𝖺𝗇𝗄(A), then there exists a proof Π of (δ1,δ2)(Δ1,Δ2);(Γ1,Γ2,Γ3)𝖬𝖲B with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)𝖱𝖺𝗇𝗄(A).

Proof.

By mutual induction on 𝖣𝖾𝗉𝗍𝗁(Π1)+𝖣𝖾𝗉𝗍𝗁(Π2) (see Appendix C.1 [40] for proof).

Lemma 10 (Decreasing Order of 𝗆𝖦𝖫).

If Π is a proof of δΔ𝖦𝖲X or δΔ;Γ𝖬𝖲A with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)> 0, then there is a proof Π of δΔ𝖦𝖲X or δΔ;Γ𝖬𝖲A with δδ and 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)<𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π).

Proof.

By induction on 𝖣𝖾𝗉𝗍𝗁(Π) (see Appendix C.2 [40] for proof).

Theorem 11 (Cut Elimination of 𝗆𝖦𝖫).

If Π is a proof of δΔ𝖦𝖲X or δΔ;Γ𝖬𝖲A with 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π)> 0, then there is an algorithm which yields a cut-free proof Π of δΔ𝖦𝖲X or δΔ;Γ𝖬𝖲A respectively.

Proof.

Follows immediately by induction on 𝖢𝗎𝗍𝖱𝖺𝗇𝗄(Π) and the previous lemma.

Lemma 12 (Subformula property).
  1. 1.

    (Graded) Every formula occurring in a cut-free proof Π of a judgment, δΔ𝖦𝖲X, consists of subformulas of the formulas occurring in δΔ𝖦𝖲X.

  2. 2.

    (Mixed) Every formula occurring in a cut-free proof Π of a judgment, δΔ;Γ𝖬𝖲A, consists of subformulas of the formulas occurring in δΔ;Γ𝖬𝖲A.

Proof.

By induction on Π (See Appendix C.3 [40] for proof).

Lastly, we define an equational theory for 𝗆𝖦𝖫:

Definition 13 (Equational theory , subset).

An equational theory on derivations accounts for equalities between proofs of the same sequent arising from the graded structure (where the terms are the same but the structure of the proof tree differs), as well as cut elimination, i.e., in 𝖦𝖲, if cut elimination on derivation Π1 of δΔ𝖦𝖲t:X yields the cut-free derivation of Π2 for δΔ𝖦𝖲t:X then the equational theory has Π1Π2, and similarly for 𝖬𝖲.

As a sample of two equations from the 𝖦𝖲 fragment, the following shows an equation leveraging the commutativity of contraction, and another on the interaction between weakening and contraction leveraging the left-unit of semiring addition:

Appendix A.1 [40] gives the full definition of the equational theory.

 Remark 14 (“βη-equalities” and “Triangle identities” via cut reduction).

One might wonder where β-equalities are in the above equational theory, e.g., that (λx.l)l in 𝖬𝖲 is equal to the cut [l/x]l. Such β-equalities are provided by the cut elimination procedure, which reduces away interacting pairs of right and left formulas (the principal vs. principal cases).

Similarly, η-equalities are equivalent to the identity expansion part of cut elimination procedure (where the cut of an identity axiom is transformed into an interacting left and right pair, with identity axioms expanded towards the leaves).

The internal derivations for the graded equivalent of the “triangle identities’ (that one usually has associated with an adjunction) are also handled in the cut elimination procedure. The main feature of the derivations for both identities is that after one step the left and right rules for the modal operators match up. This leads to consecutive principal vs. principal cases where rules for the interacting left and right pairs in the two subproofs are removed by the reduction step.

3 Model

We detail a denotational model for 𝗆𝖦𝖫 which is based on an adjoint decomposition of graded comonads. We introduce key definitions as needed.

A graded comonad can be summarised as a colax monoidal functor :[𝒞,𝒞] where is a preordered monoid (,1,,) treated as a monoidal category and [𝒞,𝒞] is the category of endofunctors on 𝒞 [33, 34]. Colax monoidality of means that the laws of a monoidal functor become 2-cells, providing the graded comonad operations:

which are thus natural transformations εA:1AA. and δr,s,A:(rs)Ar(sA).

Fujii et al. [10] gave a formal theory for graded monads, which can be easily dualised to graded comonads, showing that in an analogous way to an ordinary comonad, every graded comonad can be decomposed into an adjunction 𝖬𝗇𝗒𝖫𝗂𝗇:𝒞 and (key to graded comonads) a monoidal action :×𝒞𝒞, and thus vice versa:

Lemma 15.

(Resolution of a graded comonad [24, 10]) An adjunction 𝖫𝖱:𝒞 and a strict monoidal action :×𝒞𝒞 together induce a graded comonad over the family of endofunctors defined by r=𝖫(r(𝖱)):.

Along with some additional structure relating to substructurality (see below), this result provides a model of 𝗆𝖦𝖫 with 𝒞 providing a model for 𝖦𝖲 derivations, providing a model for 𝖬𝖲 derivations, the type constructor 𝖦𝗋𝖽r transporting from 𝖦𝖲 to 𝖬𝖲 modelled by 𝖫(r):𝒞, and type constructor 𝖫𝗂𝗇 transporting 𝖬𝖲 to 𝖦𝖲 modelled by 𝖱:𝒞.

However we need additional structure for the (sub)structural behaviour of our logic. In the literature on graded modal type theories, graded comonads are extended to graded exponential comonads (sometimes called graded linear exponential comonads [24]) defined as a colax monoidal functor :[,] where is a preordered semiring (,1,,𝟢,+,) (viewed as a category), [,] is the category of symmetric lax monoidal endofunctors on a symmetric monoidal category , and has additional symmetric lax monoidal structure for the additional monoidality of and [,] [12]. This additional structure provides natural transformations wA:𝟢A1 and cr,s,A:(r+s)A(rA)(sA) capturing (graded) weakening and contraction, subject to comonoidal coherence conditions. This additional structure can be induced by the adjoint decomposition given an exponential action:

Definition 16 (Exponential action).

Given a preordered semiring (,1,,𝟢,+,) and a symmetric monoidal category (𝒞,𝖩,), we say that a bifunctor :×C𝒞 is

  1. 1.

    a strict action (a strict graded comonad), if it satisfies the following equalities:

    εX:1X=XδX,r,s:(rs)X=r(sX)

    Note that we treat these equalities as strict natural transformations named ε and δ;

  2. 2.

    symmetric lax monoidal in the second argument if it has:

    m𝖩,r:𝖩r𝖩m,r,X,Y:(rX)(rY)r(XY)

    where m𝖩 is the unit of m and m is associative and commutative up to isomorphism;

  3. 3.

    symmetric colax monoidal between (,0,+,) and (𝒞,𝖩,) in the first argument if it has natural transformations:

    𝗐𝖾𝖺𝗄X:0X𝖩𝖼𝗈𝗇𝗍𝗋r,s,X:(r+s)X(rX)(sX)

    where 𝗐𝖾𝖺𝗄 is the unit of 𝖼𝗈𝗇𝗍𝗋, e.g. ρrX(id𝗐𝖾𝖺𝗄X)𝖼𝗈𝗇𝗍𝗋r,0,X=id with right unitor ρ, and 𝖼𝗈𝗇𝗍𝗋 is associative and commutative, i.e., that 𝖼𝗈𝗇𝗍𝗋r,s,X=c𝖼𝗈𝗇𝗍𝗋s,r,X.

    Furthermore, these natural transformations must be preserved by the strict action and monoidal structure as described by the standard additional equations in Figure 2.

    Figure 2: Further equations of a strict exponential action, interacting the colax symmetric monoidal structure, strict action, and (strict) monoidality.

If we have all of the above properties then we refer to as an exponential action. This terminology recalls the exponential action of Brunel et al. [6] which is the same as the above but where strictness is instead laxness in their definition. Our definition is also similar to linear exponential graded comonads (see e.g., [24, 12]), but here the graded comonad is uncurried (in the form of an action) and has equalities for its natural transformations (strictness).

We define a strict exponential action to be an exponential action as above but where the monoidal structure m𝖩 and m is also strict, where for clarity (in the appendix) we sometimes orient the equality as a morphism, where in the opposite direction we denote these morphisms by n𝖩,r and n,r,X,Y respectively. Strictness of the monoidal structure is needed for soundness of our model.

We now give the definition of the model of 𝗆𝖦𝖫, where we now use the opposite category 𝗈𝗉 to capture the correct polarity of the approximation rules.

Definition 17 (Mixed Graded/Linear model).

Suppose (𝒞,𝖩,) and (,𝖨,) are symmetric monoidal categories, where is symmetric monoidal closed (with exponents ), and (,1,,𝟢,+,) is a preordered semiring. Then a Mixed Graded/Linear model is a symmetric monoidal adjunction 𝖬𝗇𝗒𝖫𝗂𝗇:𝒞 along with an exponential action :𝗈𝗉×𝒞𝒞.

Thus an 𝗆𝖦𝖫 model is essentially an LNL model with a strict action. However, whilst Benton’s LNL models are initially stated to require that is Cartesian closed, he goes on to show that Cartesian properties are induced for the Eilenberg-Moore category of !-coalgebras for a symmetric monoidal category [3]. In our setting, the Cartesian structure is not needed since the 𝖬𝖲 logic is a mix of graded and linear logic, rather than Cartesian and linear logic. That is, graded propositions do not have arbitrary weakening and contraction, but instead these structural rules are controlled by grades (and corresponding underlying categorical structure [12, 24]). Therefore, a symmetric monoidal closed suffices.

From Definition 17, we define our denotational model of 𝗆𝖦𝖫:

Definition 18 (Interpretation of Mixed Graded/Linear Logic.).

Given a Mixed Graded/Linear model (Def. 17) (with 𝖬𝗇𝗒𝖫𝗂𝗇:𝒞 and :𝗈𝗉×𝒞𝒞), we interpret by two mutually defined interpretations 𝖦𝖲 and 𝖬𝖲 on types and proofs (derivations):

  • For every 𝖦𝖲 type X there is an object X𝖦𝖲𝒞 and for every 𝖬𝖲 type A there is an object A𝖬𝖲, mutually defined inductively as:

    𝖩𝖦𝖲=𝖩XY𝖦𝖲=X𝖦𝖲Y𝖦𝖲𝖫𝗂𝗇A𝖦𝖲=𝖫𝗂𝗇A𝖬𝖲 𝖨𝖬𝖲=𝖨AB𝖬𝖲=A𝖬𝖲B𝖬𝖲AB𝖬𝖲=A𝖬𝖲B𝖬𝖲𝖦𝗋𝖽rX𝖬𝖲=𝖬𝗇𝗒(rX𝖦𝖲)
  • For every proof Π of a 𝖦𝖲 sequent (r1,,rn)(x1:X1,,xn:Xn)𝖦𝖲t:X there is a morphism in the category 𝒞:

    Π𝖦𝖲:(r1X1𝖦𝖲)(rnXn𝖦𝖲)X

    (where an empty context is interpreted as 𝖦𝖲=𝖩).

  • For every proof Π of an 𝖬𝖲 sequent (r1,,rn)(x1:X1,,xn:Xn);y1:A1,,ym:Am𝖬𝖲l:B there is a morphism in the category :

    Π𝖬𝖲:𝖬𝗇𝗒(r1X1𝖦𝖲)𝖬𝗇𝗒(rnXn𝖦𝖲)A1𝖬𝖲Am𝖬𝖲B𝖬𝖲

    (where an empty 𝖬𝖲 context is interpreted as 𝖬𝖲=𝖨).

Appendix C.4 [40] gives the full definition of the interpretation, including intermediate derivations from the 𝗆𝖦𝖫 model.

Finally, we have our soundness and completeness theorems:

Theorem 19 (Soundness of Mixed Graded/Linear Logic models).

Suppose a mixed graded/linear model as above. Then for derivation Π1 of δΔ𝖦𝖲t1:X and derivation Π2 of δΔ𝖦𝖲t2:X then if Π1Π2 then Π1=Π2.

Similarly for Π1 of δΔ;Γ𝖬𝖲l1:A and derivation Π2 of δΔ;Γ𝖬𝖲l2:A then if Π1Π2 then Π1=Π2.

Proof.

This proof holds by mutual induction. For the details see Appendix C.5 [40].

Theorem 20 (Completeness of Mixed Graded/Linear Logic models).

For derivations Π1, Π2 (of either 𝖦𝖲 or 𝖬𝖲) if Π1=Π2 in all mixed graded/linear models, then Π1Π2.

Proof.

This is a standard proof, where we build a generic model based on the syntax and the equational theory. For the details see Appendix C.6 [40].

4 Natural Deduction

We now develop a natural deduction formulation of 𝗆𝖦𝖫. Whilst sequent calculus judgments were denoted 𝖬𝖲 and 𝖦𝖲, natural deduction judgments are correspondingly 𝖬𝖳 and 𝖦𝖳.

The syntax for terms is identical to the sequent calculus, collected in Figure 1. Appendix B [40] gives the introduction and elimination rules and structural rules for 𝗆𝖦𝖫’s natural deduction formulation. The unit constructors are 𝗃 and 𝗂. Tensor products in both systems are denoted by pairs of terms with corresponding let-expressions for eliminators. The graded modal introduction form 𝖫𝗂𝗇l operates on mixed terms, dual to 𝖦𝗋𝖽rt which operates on graded terms. The mixed syntax includes abstraction λx.l and function application l1l2.
The most interesting aspect is the rules for the modal operators:

In the sequent calculus presented in Section 2, the right rule for 𝖫𝗂𝗇 is in the graded subsystem, but the left rule is in the mixed subsystem. A similar idea arises here, the introduction rule for 𝖫𝗂𝗇 (rule 𝖫𝗂𝗇I) is in the graded subsystem and the elimination rule (rule 𝖫𝗂𝗇E) is in the mixed subsystem. Introducing 𝖦𝗋𝖽r formulas (rule 𝖦𝗋𝖽I) has the effect of scaling the input grades by r. The elimination rule for 𝖦𝗋𝖽r (rule 𝖦𝗋𝖽E) is a pattern match on the form of l1. Since 𝖫𝗂𝗇 and 𝖦𝗋𝖽 are the decomposition of graded modalities (Section 3), the form of the elimination rule for 𝖦𝗋𝖽r is defined in a way which resembles that of elimination rules for graded modalities in other natural deduction-based type systems [31].

This formulation also has explicit graded structural rules:

In the transition from sequent calculus to natural deduction, left rules transform into elimination rules, and as a result the additional graded left rules in the mixed sequent calculus are no longer explicitly part of the system, but can be derived. We go on to prove that the sequent calculus of Section 2.1 is equivalent to the natural deduction system.

We give two main results related to the natural deduction system; the first is substitution for typing. Note that this reuses the row-vector multiplication operation of Section 2.2.

Lemma 21 (Substitution for 𝖦𝖳 and 𝖬𝖳).

The following hold by mutual induction:

  1. 1.

    (Graded) If δ2Δ2𝖦𝖳t1:X and (δ1,δ,δ3)(Δ1,xn:Xn,Δ3)𝖦𝖳t2:Y, then (δ1,δ[δ2n],δ3)(Δ1,Δ2,Δ3)𝖦𝖳[t1,,t1/x1,,xn]t2:Y.

  2. 2.

    (Graded/Mixed) If δ2Δ2𝖦𝖳t:X and (δ1,δ,δ3)(Δ1,xn:Xn,Δ3);Γ𝖬𝖳l:B, then (δ1,δ[δ2n],δ3)(Δ1,Δ2,Δ3);Γ𝖬𝖳[t,,t/x1,,xn]l:B.

  3. 3.

    (Mixed) If δ2Δ2;Γ2𝖬𝖳l1:A and δ1Δ1;(Γ1,x:A,Γ3)𝖬𝖳l2:B, then (δ1,δ2)(Δ1,Δ2);(Γ1,Γ2,Γ3)𝖬𝖳[l1/x]l2:B.

Proof.

By mutual induction on the second assumed derivation (see Appendix C.7 [40]). Since we have an explicit structural rule for contraction (above and listed in Appendix B [40]), the substitution lemma on the graded fragment is formalized as multi-substitution. Otherwise, its proof is a fairly standard substitution proof for graded systems (e.g., as in [31]). Lastly, the natural deduction system is interderivable with the sequent calculus, which we establish such that the term witnessing the derivations does not change between systems:

Theorem 22 (Sequent calculus and natural deduction interderivability).

δΔ𝖦𝖲t:XδΔ𝖦𝖳t:X and δΔ;Γ𝖬𝖲l:AδΔ;Γ𝖬𝖳l:A.

Proof.

By mutual induction on the assumed derivations (Appendix C.8 and C.9 [40]). The sequent calculus to natural deduction direction requires the substitution lemma above. The implication of the previous result is that we only need a semantic model of one of the two systems, and the other can be modelled using the same interpretation of terms. We chose to model the sequent calculus form directly.

5 Discussion

5.1 Relating linear base vs. graded base calculi

A major thread of graded type systems in the literature starts with a linear logic base and then generalises the ! modality to a semiring-graded modality atop a linear logic, e.g., the systems of Brunel et al. [6], Gaboardi et al. [12], Orchard et al. [31], and others [11, 18]. Often these systems are presented with a single context containing both linear and graded propositions [12, 31]. Overall, these approaches have a common core which is isomorphic to the natural deduction 𝖬𝖳 fragment shown here with the (natural deduction analogue of the) derived r graded modality of Lemma 3 as part of their definition (i.e., not derived). We refer to this style of graded type system as the linear base style.

A contrasting approach has no base notion of linearity, but instead has pervasive grading tracking substructurality, i.e., no linear assumptions, every assumption has a grade, and function arrows come equipped with a grade describing the usage of their input in the function (e.g., written A𝑟B). Such systems include the coeffect calculi of Petricek et al. [33, 34], the general graded modal system of Bernardy et al. [1], and several others [2, 4, 7, 28, 30]. The 𝖦𝖳 fragment of our system here corresponds to a common subset of these approaches: a subset without function arrows and without a graded modality, since there is no graded modality that lives in the 𝖦𝖳 side (i is derived into 𝖬𝖳). Hughes et al. also develop a program synthesis technique for graded base systems, where grades are used to prune the search space [19]; its synthesis calculus formulation resembles closely 𝖦𝖲.

Our work thus shows the relationship between the linear base and graded base style, namely that there is a mutual embedding between these two approaches which generates the graded modality in the linear base (Lemma 3). Exploring this in more depth is further work. For instance, it is unclear what is needed to realise a graded comonadic modality in 𝖦𝖳 that arises from the embedding (or a different embedding), and how this could interact with a graded function arrow in 𝖦𝖲 or 𝖦𝖳. Pursuing this line of work would help to explain the relationship between the two dominant styles of graded system in the literature, which seem strongly related, and their relative expressive power. Nonetheless, by following Benton’s programme and giving it a graded rendering here, we can already see here the close connection between these two styles of graded system.

5.2 Related work on adjoint logics

Pruiksma et al. formalized a general way to add and remove structural rules from a logic through adjunctions [37]. Their work is similar to ours as it relates logics through adjoint decompositions based on modal operators to control structural rules. Their formulation with “modes of truth” resembles our work with grades; however, modes of truth lack the algebraic properties graded formulations depend on and instead have a very relational flavor. Building on this work of Pruiksma et al., Jang et al. develop a natural deduction formulation of adjoint logic [21]. They leverage this to give a functional language able to reason about resource properties like strictness and erasure. Similar reasoning can be developed ontop of our natural deduction formulation here, though this is left as further work.

A question is whether grading can be unified with the adjoint logic approach. Eades and Orchard sketched a unification based on generalising semiring operations to relations rather than functions, with predicates classifying unit values [20]. Hanukaev et al. develop this idea further, introducing a dependent type system based on a similar structure as the logics here but using a generalised notion of grading that combines the modes of adjoint logic [16]. They prove that their system is well-formed syntactically, but do not introduce any semantic model. Our logic 𝗆𝖦𝖫 can be seen as an instantiation of their system, but the categorical model given here could potentially be generalised into a model of their system.

5.3 Further work

Practical implementation to leverage linear/grading separation

The separation of the mixed system (𝖬𝖲/𝖬𝖳) from the purely graded fragment (𝖦𝖲/𝖦𝖳) (which acts more as a standard intuitionistic system) can provide a basis for a programming language design. In such a language, the restrictions of linearity could be used only for handling data that needs to be linear, such as file handles or channels. However, for data types which need not be linear, e.g., primitive types like integers, characters, or structures over them, the graded fragment could be used without having to confront linearity constraints. The mutual embedding would allow the programmer to move smoothly between these two subcalculi. Similar ideas are discussed for the polarized extension of SILL for concurrent programming [35]. The implementation could borrow ideas from the Granule programming language, which already provides a mature and feature rich implementation of a linear-base style graded type system [31]. Instead, an 𝗆𝖦𝖫-inspired implementation could be based on the natural deduction term calculus with the modalities mediating between the two judgments. Exploring this application, perhaps as an extension to Granule, is future work.

Other generalisations

In LNL, the adjunction can be followed in the opposite direction to derive a monad ?A=𝖫𝗂𝗇(𝖬𝗇𝗒A). However, in 𝗆𝖦𝖫 we do not get a graded monad by composing 𝖫𝗂𝗇(𝖦𝗋𝖽rX) since the adjoint resolution of a graded monad has a strict action on the other side (on in the model). Exploring a calculus with a pair of actions to allow both graded monads and graded comonads is further work.

Uniqueness typing

Recent work has demonstrated that uniqueness is a closely related but distinct concept to linearity [27]; uniqueness logic [17] is substructural in much the same way as linear logic, but provides a monadic modality for enabling the structural rules in contrast to linear logic’s comonadic ! modality. Building an adjoint model for uniqueness or a calculus which unifies uniqueness and linearity [27] would be interesting further work, and this could potentially be extended to more recent systems which develop graded notions of uniqueness [26].

References

  • [1] Andreas Abel and Jean-Philippe Bernardy. A unified view of modalities in type systems. Proc. ACM Program. Lang., 4(ICFP):90:1–90:28, 2020. doi:10.1145/3408972.
  • [2] Robert Atkey. Syntax and Semantics of Quantitative Type Theory. In Anuj Dawar and Erich Grädel, editors, Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018, pages 56–65. ACM, 2018. doi:10.1145/3209108.3209189.
  • [3] P. N. Benton. A mixed linear and non-linear logic: Proofs, terms and models (extended abstract). In Leszek Pacholski and Jerzy Tiuryn, editors, Computer Science Logic, 8th International Workshop, CSL ’94, Kazimierz, Poland, September 25-30, 1994, Selected Papers, volume 933 of Lecture Notes in Computer Science, pages 121–135. Springer, 1994. doi:10.1007/BFB0022251.
  • [4] Jean-Philippe Bernardy, Mathieu Boespflug, Ryan R. Newton, Simon Peyton Jones, and Arnaud Spiwack. Linear Haskell: practical linearity in a higher-order polymorphic language. Proc. ACM Program. Lang., 2(POPL):5:1–5:29, 2018. doi:10.1145/3158093.
  • [5] Flavien Breuvart and Michele Pagani. Modelling coeffects in the relational semantics of linear logic. In 24th EACSL Annual Conference on Computer Science Logic, CSL 2015, September 7-10, 2015, Berlin, Germany, pages 567–581, 2015. doi:10.4230/LIPIcs.CSL.2015.567.
  • [6] Aloïs Brunel, Marco Gaboardi, Damiano Mazza, and Steve Zdancewic. A core quantitative coeffect calculus. In Zhong Shao, editor, Programming Languages and Systems - 23rd European Symposium on Programming, ESOP 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014, Proceedings, volume 8410 of Lecture Notes in Computer Science, pages 351–370. Springer, 2014. doi:10.1007/978-3-642-54833-8_19.
  • [7] Pritam Choudhury, Harley Eades III, Richard A. Eisenberg, and Stephanie Weirich. A graded dependent type system with a usage-aware semantics. Proc. ACM Program. Lang., 5(POPL):1–32, 2021. doi:10.1145/3434331.
  • [8] Vincent Danos, Jean-Baptiste Joinet, and Harold Schellinx. The Structure of Exponentials: Uncovering the Dynamics of Linear Logic Proofs. In Georg Gottlob, Alexander Leitsch, and Daniele Mundici, editors, Computational Logic and Proof Theory, Third Kurt Gödel Colloquium, KGC’93, Brno, Czech Republic, August 24-27, 1993, Proceedings, volume 713 of Lecture Notes in Computer Science, pages 159–171. Springer, 1993. doi:10.1007/BFB0022564.
  • [9] Loris D’Antoni, Marco Gaboardi, Emilio Jesús Gallego Arias, Andreas Haeberlen, and Benjamin C. Pierce. Sensitivity analysis using type-based constraints. In Proceedings of the 1st Annual Workshop on Functional Programming Concepts in Domain-Specific Languages, FPCDSL@ICFP 2013, Boston, Massachusetts, USA, September 22, 2013, pages 43–50, 2013. doi:10.1145/2505351.2505353.
  • [10] Soichiro Fujii, Shin-ya Katsumata, and Paul-André Melliès. Towards a Formal Theory of Graded Monads. In Bart Jacobs and Christof Löding, editors, Foundations of Software Science and Computation Structures - 19th International Conference, FOSSACS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2-8, 2016, Proceedings, volume 9634 of Lecture Notes in Computer Science, pages 513–530. Springer, 2016. doi:10.1007/978-3-662-49630-5_30.
  • [11] Marco Gaboardi, Andreas Haeberlen, Justin Hsu, Arjun Narayan, and Benjamin C. Pierce. Linear dependent types for differential privacy. In The 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’13, Rome, Italy - January 23 - 25, 2013, pages 357–370, 2013. doi:10.1145/2429069.2429113.
  • [12] Marco Gaboardi, Shin-ya Katsumata, Dominic A. Orchard, Flavien Breuvart, and Tarmo Uustalu. Combining effects and coeffects via grading. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, pages 476–489, 2016. doi:10.1145/2951913.2951939.
  • [13] Dan R. Ghica and Alex I. Smith. Bounded linear types in a resource semiring. In Zhong Shao, editor, Programming Languages and Systems - 23rd European Symposium on Programming, ESOP 2014, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2014, Grenoble, France, April 5-13, 2014, Proceedings, volume 8410 of Lecture Notes in Computer Science, pages 331–350. Springer, 2014. doi:10.1007/978-3-642-54833-8_18.
  • [14] Jean-Yves Girard. Linear logic. Theor. Comput. Sci., 50:1–102, 1987. doi:10.1016/0304-3975(87)90045-4.
  • [15] Jean-Yves Girard, Andre Scedrov, and Philip J. Scott. Bounded linear logic: A modular approach to polynomial-time computability. Theor. Comput. Sci., 97(1):1–66, 1992. doi:10.1016/0304-3975(92)90386-T.
  • [16] Peter Hanukaev and Harley Eades III. Combining dependency, grades, and adjoint logic. In Proceedings of the 8th ACM SIGPLAN International Workshop on Type-Driven Development, TyDe 2023, pages 58–70, New York, NY, USA, 2023. Association for Computing Machinery. doi:10.1145/3609027.3609408.
  • [17] Dana Harrington. Uniqueness logic. Theor. Comput. Sci., 354(1):24–41, 2006. doi:10.1016/j.tcs.2005.11.006.
  • [18] Jack Hughes, Danielle Marshall, James Wood, and Dominic Orchard. Linear Exponentials as Graded Modal Types. In 5th International Workshop on Trends in Linear Logic and Applications (TLLA 2021), Rome (virtual), Italy, June 2021. URL: https://hal-lirmm.ccsd.cnrs.fr/lirmm-03271465.
  • [19] Jack Hughes and Dominic Orchard. Program synthesis from graded types. In Stephanie Weirich, editor, Programming Languages and Systems - 33rd European Symposium on Programming, ESOP 2024, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2024, Luxembourg City, Luxembourg, April 6-11, 2024, Proceedings, Part I, volume 14576 of Lecture Notes in Computer Science, pages 83–112. Springer, 2024. doi:10.1007/978-3-031-57262-3_4.
  • [20] Harley Eades III and Dominic Orchard. Grading adjoint logic. CoRR, abs/2006.08854, 2020. arXiv:2006.08854.
  • [21] Junyoung Jang, Sophia Roshal, Frank Pfenning, and Brigitte Pientka. Adjoint Natural Deduction. In Jakob Rehof, editor, 9th International Conference on Formal Structures for Computation and Deduction, FSCD 2024, July 10-13, 2024, Tallinn, Estonia, volume 299 of LIPIcs, pages 15:1–15:23. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.FSCD.2024.15.
  • [22] Max I. Kanovich, Stepan L. Kuznetsov, Vivek Nigam, and Andre Scedrov. Soft subexponentials and multiplexing. In Nicolas Peltier and Viorica Sofronie-Stokkermans, editors, Automated Reasoning - 10th International Joint Conference, IJCAR 2020, Paris, France, July 1-4, 2020, Proceedings, Part I, volume 12166 of Lecture Notes in Computer Science, pages 500–517. Springer, 2020. doi:10.1007/978-3-030-51074-9_29.
  • [23] Shin-ya Katsumata. Parametric effect monads and semantics of effect systems. In Suresh Jagannathan and Peter Sewell, editors, The 41st Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’14, San Diego, CA, USA, January 20-21, 2014, pages 633–646. ACM, 2014. doi:10.1145/2535838.2535846.
  • [24] Shin-ya Katsumata. A double category theoretic analysis of graded linear exponential comonads. In Christel Baier and Ugo Dal Lago, editors, Foundations of Software Science and Computation Structures - 21st International Conference, FOSSACS 2018, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2018, Thessaloniki, Greece, April 14-20, 2018, Proceedings, volume 10803 of Lecture Notes in Computer Science, pages 110–127. Springer, 2018. doi:10.1007/978-3-319-89366-2_6.
  • [25] Joachim Lambek. The mathematics of sentence structure. The American Mathematical Monthly, 65(3):154–170, 1958.
  • [26] Danielle Marshall and Dominic Orchard. Functional Ownership through Fractional Uniqueness. Proc. ACM Program. Lang., 8(OOPSLA1):1040–1070, 2024. doi:10.1145/3649848.
  • [27] Danielle Marshall, Michael Vollmer, and Dominic Orchard. Linearity and Uniqueness: An Entente Cordiale. In Ilya Sergey, editor, Programming Languages and Systems - 31st European Symposium on Programming, ESOP 2022, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2022, Munich, Germany, April 2-7, 2022, Proceedings, volume 13240 of Lecture Notes in Computer Science, pages 346–375. Springer, 2022. doi:10.1007/978-3-030-99336-8_13.
  • [28] Conor McBride. I Got Plenty o’ Nuttin’. In Sam Lindley, Conor McBride, Philip W. Trinder, and Donald Sannella, editors, A List of Successes That Can Change the World - Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday, volume 9600 of Lecture Notes in Computer Science, pages 207–233. Springer, 2016. doi:10.1007/978-3-319-30936-1_12.
  • [29] Paul-André Melliès. Categorical semantics of linear logic. In Pierre-Louis Curien, Hugo Herbelin, Jean-Louis Krivine, and Paul-André Melliès, editors, Interactive Models of Computation and Program Behaviour. Panoramas et Synthèses 27, Société Mathématique de France, 2009.
  • [30] Benjamin Moon, Harley Eades III, and Dominic Orchard. Graded modal dependent type theory. In Programming Languages and Systems - 30th European Symposium on Programming, ESOP 2021, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2021, Luxembourg City, Luxembourg, March 27 - April 1, 2021, Proceedings, pages 462–490, 2021. doi:10.1007/978-3-030-72019-3_17.
  • [31] Dominic Orchard, Vilem-Benjamin Liepelt, and Harley Eades III. Quantitative program reasoning with graded modal types. Proc. ACM Program. Lang., 3(ICFP):110:1–110:30, 2019. doi:10.1145/3341714.
  • [32] Dominic A. Orchard, Tomas Petricek, and Alan Mycroft. The semantic marriage of monads and effects. CoRR, abs/1401.5391, 2014. arXiv:1401.5391.
  • [33] Tomas Petricek, Dominic A. Orchard, and Alan Mycroft. Coeffects: Unified static analysis of context-dependence. In Automata, Languages, and Programming - 40th International Colloquium, ICALP 2013, Riga, Latvia, July 8-12, 2013, Proceedings, Part II, pages 385–397, 2013. doi:10.1007/978-3-642-39212-2_35.
  • [34] Tomas Petricek, Dominic A. Orchard, and Alan Mycroft. Coeffects: a calculus of context-dependent computation. In Proceedings of the 19th ACM SIGPLAN international conference on Functional programming, Gothenburg, Sweden, September 1-3, 2014, pages 123–135, 2014. doi:10.1145/2628136.2628160.
  • [35] Frank Pfenning and Dennis Griffith. Polarized substructural session types. In Andrew M. Pitts, editor, Foundations of Software Science and Computation Structures - 18th International Conference, FoSSaCS 2015, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2015, London, UK, April 11-18, 2015. Proceedings, volume 9034 of Lecture Notes in Computer Science, pages 3–22. Springer, 2015. doi:10.1007/978-3-662-46678-0_1.
  • [36] Elaine Pimentel, Carlos Olarte, and Vivek Nigam. Process-as-formula interpretation: A substructural multimodal view (invited talk). In Naoki Kobayashi, editor, 6th International Conference on Formal Structures for Computation and Deduction, FSCD 2021, July 17-24, 2021, Buenos Aires, Argentina (Virtual Conference), volume 195 of LIPIcs, pages 3:1–3:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.FSCD.2021.3.
  • [37] Klaas Pruiksma, William Chargin, Frank Pfenning, and Jason Reed. Adjoint logic. Unpublished Draft: http://www.cs.cmu.edu/˜fp/papers/adjoint18b.pdf, 2018.
  • [38] Klaas Pruiksma and Frank Pfenning. A message-passing interpretation of adjoint logic. Journal of Logical and Algebraic Methods in Programming, page 100637, 2020.
  • [39] Greg Restall. An introduction to substructural logics. Routledge, 2002.
  • [40] Victoria Vollmer, Danielle Marshall, Harley Eades III, and Dominic Orchard. A Mixed Linear and Graded Logic: Proofs, Terms, and Models. CoRR, abs/2401.17199, 2024. doi:10.48550/arXiv.2401.17199.
  • [41] Jan von Plato. A proof of Gentzen’s Hauptsatz without multicut. Arch. Math. Log., 40(1):9–18, 2001. doi:10.1007/S001530050170.
  • [42] Philip Wadler. Linear types can change the world! In Manfred Broy and Cliff B. Jones, editors, Programming concepts and methods: Proceedings of the IFIP Working Group 2.2, 2.3 Working Conference on Programming Concepts and Methods, Sea of Galilee, Israel, 2-5 April, 1990, page 561. North-Holland, 1990.
  • [43] David Walker. Substructural type systems. Advanced topics in types and programming languages, pages 3–44, 2005.