A Linear Algebra Approach to Linear Metatheory
aa r X i v : . [ c s . P L ] M a y Submitted to:Linearity & TLLA 2020 c (cid:13)
J. Wood & R. AtkeyThis work is licensed under theCreative Commons Attribution License.
A Linear Algebra Approach to Linear Metatheory
James Wood ∗ University of StrathclydeGlasgow, United Kingdom [email protected]
Robert Atkey
University of StrathclydeGlasgow, United Kingdom [email protected]
Linear typed λ -calculi are more delicate than their simply typed siblings when it comes to metatheo-retic results like preservation of typing under renaming and substitution. Tracking the usage of vari-ables in contexts places more constraints on how variables may be renamed or substituted. We presenta methodology based on linear algebra over semirings, extending McBride’s kits and traversals ap-proach for the metatheory of syntax with binding to linear usage-annotated terms. Our approach isreadily formalisable, and we have done so in Agda. The basic metatheoretic results for typed λ -calculi, such as preservation of typing under renaming, weak-ening, substitution and so on, are crucial but quite boring to prove. In calculi with substructural typingdisciplines and modalities, it can also be quite easy to break these properties [Wad92, BBPH93]. It isdesirable therefore to use a proof assistant to prove these properties. This has the double benefit of bothconfidence in the results and in focusing on the essential properties required to obtain them.Mechanisation of the metatheory of substructural λ -calculi has not received the same level of atten-tion as intuitionistic typing. “Straightforward” translations from paper presentations to formal presenta-tions make metatheory difficult, due to incompatibilies between the standard de Bruijn representation ofbinding and the splitting of contexts. For formalisations of linear sequent calculi, sticking to the paperpresentation using lists and permutations is common [PW99, XORN17, Lau18], but explicit permuta-tions make the resulting encodings difficult to use. Multisets for contexts are more convenient [CLR19],but do not work well for Curry-Howard uses, as noted by Laurent. For natural deduction, Allais [All18]uses an I/O model to track usage of variables, Rouvoet et al. [RBPKV20] use a co-de Bruijn represen-tation to distribute variables between subterms, and Crary uses mutually defined typing and linearityjudgements with HOAS [Cra10].In this paper, we adapt the generic kits and traversals technique for proving admissibility of renamingand substitution due to McBride [McB05] to a linear typed λ -calculus where variables are annotatedwith values from a skew semiring denoting those variables’ usage by terms. Our calculus, λ R , is aprototypical example of a linear “quantitative” or “coeffect” calculus in the style of [RP10, BGMZ14,GS14, POM14, OLE19]. The key advantages of λ R over the formalisations listed above are that theshape of typing contexts is maintained, so de Bruijn indices behave the same as in non-substructuralcalculi, and by selecting different semirings, we obtain from λ R well known systems, including Barber’sDual Intuitionistic Linear Logic [Bar96] and Pfenning and Davis’ S4 modal type theory [PD99].McBride’s kits and traversals technique isolates properties required to form binding-respecting traver-sals of simply typed λ -terms, so that renaming and substitution arise as specific instantiations. Benton,Hur, Kennedy, and McBride [BHKM12] implement the technique in Coq and extend it to polymorphic ∗ James Wood is supported by an EPSRC Studentship.
ALinear Algebra Approach to Linear Metatheoryterms. Allais et al. [AAC +
20] generalise to a wider class of syntax with binding and show that moregeneral notions of semantics can be handled.To adapt kits and traversals to linear usage-annotated terms requires us to not only respect the bindingstructure, but to also respect the usage annotations. For instance, the usages associated with a term beingsubstituted in must be correctly distributed across all the occurrences of that term in the result. To aid usin tracking usages correctly, we employ the linear algebra of vectors and matrices induced by the skewsemiring we are using. Usage annotations on contexts are vectors, usage-preserving maps of contextsare matrices, and the linearity properties of the maps induced by matrices are exactly the lemmas weneed for showing that traversals (and hence renaming, subusaging, and substitution) preserve typing andusages.The paper proceeds as follows. In section 2, we specify our requirements on the set of annotationsthat will track usage of variables. A consequence of our formalisation is that we learn that we only need skew semirings, a weaker structure than the partially ordered semirings usually used. In section 3, we usethese annotations to define the system λ R in an intrinsically typed style. Then, in section 4, we provethat λ R admits renaming, subusaging, and substitution by our extension of McBride’s kits and traversalstechnique. We conclude in section 5 with some directions for future work.The Agda formalisation of this work can be found at https://github.com/laMudri/generic-lr/tree/master/src/Specific . It contains our formalisation of vectors and matrices (approx. 790 lines)and the definition of λ R and proofs of renaming and substitution (approx. 530 lines). We shall use skew semirings where other authors have previously used partially ordered semirings (see,for example, the Granule definition of a resource algebra [OLE19]). Elements of a skew semiring areused as usage annotations , and describe how values are used in a program. In the syntax for λ R , eachassumption will have a usage annotation, describing how that assumption can be used in the derivation.Addition describes how to combine multiple usages of an assumption, and multiplication describes theaction our graded !-modality can have. The ordering describes the specificness of annotations. If π E ρ , π can be the annotation for a variable wherever ρ can be. We can read this relation as “supply E demand”— where we demand that a variable be used according to ρ , it is also fine to use it if it is annotated π .Skew semirings are a generalisation of partially ordered semirings, which are in turn a generalisationof commutative semirings. As such, readers unfamiliar with the more general structures may wish tothink in terms of the more specific structures. Our formalisation was essential for noticing and stickingto this level of generality. Definition 2.1. A (left) skew monoid is a structure ( R , E , , ∗ ) such that ( R , E ) forms a partial order, ∗ is monotonic with respect to E , and the following laws hold. x E x x E x ( xy ) z E x ( yz ) Remark 2.2.
A commutative skew monoid is just a commutative monoid.
Skew-monoidal categories are due to Szlach´anyi [Szl12], and the notion introduced here of a skewmonoid is a decategorification of the notion of skew-monoidal category.
Definition 2.3. A (left) skew semiring is a structure ( R , E , , + , , ∗ ) such that ( R , E ) forms a partialorder, + and ∗ are monotonic with respect to E , ( R , , +) forms a commutative monoid, ( R , E , , ∗ ) forms a skew monoid, and we have the following distributivity laws. z E ( x + y ) z E xz + yz E x xy + xz E x ( y + z ) .Wood &R.Atkey 3 Example 2.4.
In light of the above remark, most “skew” semirings are actually just partially orderedsemirings. An example that yields a system equivalent to Barber’s DILL is the ⊲ ω ⊳ semiring of“unused”, “unrestricted”, and “linear”, respectively. See [OLE19] for more examples. We will only speak of left skew semirings, and thus generally omit the word “left”. A mnemonicfor (left) skew semirings is “multiplication respects operators on the left from left to right, and respectsoperators on the right from right to left”. One may also describe multiplication as “respecting” and“corespecting” operators on the left and right, respectively.From a skew semiring R , we form finite vectors, which we notate as R n , and matrices, which wenotate as R m × n . In Agda, we represent vectors in R n as functions Idx n → R , where Idx n is the type ofvalid indexes in an n -tuple, and matrices in R m × n as functions Idx m → Idx n → R . Whereas elementsof R describe how individual variables are used, elements of R n describe how all of the variables in an n -length context are used. We call such vectors usage contexts , and take them to be row vectors. Matri-ces in R m × n will be used to describe how usage contexts are transformed by renaming and substitutionin section 4. We define E , 0 and + on vectors and matrices pointwise. Basis vectors h i | (used to rep-resent usage contexts for individual variables), identity matrices I , matrix multiplication ∗ , and matrixreindexing − −×− are defined as follows: h−| : Idx n → R n h i | j : = ( , if i = j , otherwise I : R m × m I i j : = h i | j ∗ : R m × n × R n × o → R m × o ( MN ) ik : = ∑ j M i j N jk − −×− : R m ′ × n ′ × ( Idx m → Idx m ′ ) × ( Idx n → Idx n ′ ) → R m × n ( M f × g ) i , j : = M f i , g j We define vector-matrix multiplication by treating vectors as 1-height matrices. We will sometimessilently cast between the types Idx m and Γ ∋ A , particularly when using the reindexing operation. We present the syntax of λ R as an intrinsically typed syntax, as it is in our Agda formalisation. Intrinisictyping means that we define well-typed terms as inhabitants of an inductive family R Γ ⊢ A indexed bytyping contexts Γ , usage contexts R , and types A . Typing contexts are lists of types. Usage contexts R are vectors of elements of some fixed skew semiring R , with the same number of elements as the typingcontext they are paired with. To highlight how usage annotations are used in the syntax, we write allelements of R , and vectors and matrices thereof, in green.The types of λ R are given by the grammar: A , B , C :: = ι | A ⊸ B | | A ⊗ B | | A ⊕ B | ⊤ | A & B | ! ρ A .We have a base type ι , function types A ⊸ B , tensor product types A ⊗ B with unit 1, sum types A ⊕ B with unit 0, “with” product types A & B with unit ⊤ , and an exponential ! ρ A indexed by a usage ρ .We distinguish between plain variables, values of type Γ ∋ A , which are indices into a context witha specified type, and usage-checked variables, values of type R Γ ⊐ − A which are pairs of a plain variable i : Γ ∋ A and proof that R E h i | . The force of the latter condition is that the selected variable i must havea usage annotation E R , and all other variables must have a usage annotation E λ R are presented as constructors of the inductive family R Γ ⊢ A ,hence the notation M : R Γ ⊢ A instead of the more usual R Γ ⊢ M : A . Our Agda formalisation uses ALinear Algebra Approach to Linear MetatheoryFigure 1: Typing rules of λ R x : R Γ ⊐ − Ax : R Γ ⊢ A VAR M : P Γ ⊢ A ⊸ B N : Q Γ ⊢ A R E P + Q M N : R Γ ⊢ B ⊸ -E M { x } : R Γ , x : A ⊢ B λ x . M { x } : R Γ ⊢ A ⊸ B ⊸ -I M : P Γ ⊢ N : Q Γ ⊢ C R E P + Q let ( ⊗ ) = M in N : R Γ ⊢ C R E ( ⊗ ) : R Γ ⊢ M : P Γ ⊢ A ⊗ B N { x , y } : Q Γ , x : A , y : B ⊢ C R E P + Q let ( x ⊗ y ) = M in N { x , y } : R Γ ⊢ C ⊗ -E M : P Γ ⊢ A N : Q Γ ⊢ B R E P + Q ( M ⊗ N ) : R Γ ⊢ A ⊗ B ⊗ -I M : P Γ ⊢ R E P + Q ex-falso M : R Γ ⊢ C M : P Γ ⊢ A ⊕ B N { x } : Q Γ , x : A ⊢ C O { y } : Q Γ , y : B ⊢ C R E P + Q case M of inj L x N { x } ; inj R y O { y } : R Γ ⊢ C ⊕ -E M : R Γ ⊢ A inj L M : R Γ ⊢ A ⊕ B ⊕ -I L M : R Γ ⊢ B inj R M : R Γ ⊢ A ⊕ B ⊕ -I R ( & ) : R Γ ⊢ ⊤ ⊤ -I M : R Γ ⊢ A & B proj L M : R Γ ⊢ A &-E L M : R Γ ⊢ A & B proj R M : R Γ ⊢ B &-E R M : R Γ ⊢ A N : R Γ ⊢ B ( M & N ) : R Γ ⊢ A & B &-I M : P Γ ⊢ ! ρ A N { x } : Q Γ , ρ x : A ⊢ C R E P + Q let [ x ] = M in N { x } : R Γ ⊢ C ! ρ -E M : P Γ ⊢ A R E ρ P [ M ] : R Γ ⊢ ! ρ A ! ρ -I de Bruijn indices to represent variables, but we have annotated the rules with variable names for easeof reading. Ignoring the usages, the typing rules all look like their simply typed counterparts; the onlydifference between the ⊗ and & products being their presentation in terms of pattern matching andprojections, respectively. Thus the addition of usage contexts and constraints on them refines the usualsimple typing to be usage constrained. For instance, in the ⊗ -I rule, the usage context R on the conclusionis constrained to be able to supply the sum P + Q of the usage contexts of the premises. If we instantiate R to be the 0 ⊲ ω ⊳ McBride defines kits [McB05, BHKM12], which provide a general method for giving admissible rulesthat are usually proven by induction on the derivation. To produce a kit, we give an indexed family (cid:7) : Ctx × Ty → Set and explain how to inject variables, extract terms, and weaken by new variablescoming from binders. In return, given a type-preserving map from variables in one context to (cid:7) -stuffin another (an environment ), we get a type-preserving function between terms in these contexts. Such a.Wood &R.Atkey 5function is the intrinsic typing equivalent of an admissible rule.To make the kit-based approach work in our usage-constrained setting, we make modifications toboth kits and environments. Kits need not support arbitrary weakening, but only weakening by theintroduction of 0-use variables. The family (cid:7) must also respect E of usage contexts. Environments areequipped with a matrix mapping input usages to output usages.We prove simultaneous substitution using renaming. We take both renaming and substitution ascorollaries of the traversal principle (Theorem 4.3) yielded from kits and environments.Definition of kit s, environment s and traversal are in the module Specific.Syntax.Traversal . A kit is a structure on ⊢ -like relations (cid:7) , intuitively giving a way in which (cid:7) lives between the usage-checked variable judgement ⊐ − and the typing judgement ⊢ . The components vr and tm are basicallyunchanged from McBride’s original kits. The component wk only differs in that new variables are givenannotation 0, which intuitively marks them as weakenable. The requirement psh is new, and allows us tofix up usage contexts via skew algebraic reasoning. Definition 4.1 ( Kit ) . For any (cid:7) : Ctx × Ty → Set , let
Kit ( (cid:7) ) denote the type of kits . A kit comprises thefollowing functions for all P , Q , Γ , ∆ , and A.psh : P E Q → Q Γ (cid:7) A → P Γ (cid:7) A vr : P Γ ⊐ − A → P Γ (cid:7) Atm : P Γ (cid:7) A → P Γ ⊢ A wk : P Γ (cid:7) A → P Γ , ∆ (cid:7) A An inhabitant of P Γ (cid:7) A is described as stuff in P Γ of type A . Environments
In simple intuitionistic type theory, an environment is a type-preserving function fromvariables in the old context ∆ to stuff in the new context Γ : an inhabitant of ∆ ∋ A → Γ (cid:7) A . The traversalfunction turns such an environment into a map between terms, ∆ ⊢ A → Γ ⊢ A .For λ R , we want maps of usaged terms Q ∆ ⊢ A → P Γ ⊢ A . We can see that an environment oftype Q ∆ ⊐ − A → P Γ (cid:7) A would be insufficient — Q ∆ ⊐ − A can only be inhabited when Q is compatiblewith a basis vector, so our environment would be trivial in more general cases. Instead, we care aboutnon-usage-checked variables ∆ ∋ A .Our understanding of an environment is that it should simultaneously map all of the usage-checkedvariables in Q ∆ to stuff in P Γ in a way that preserves usage. As such, we want to map each variable j : ∆ ∋ A not to A -stuff in P Γ , but rather A -stuff in P j Γ , where P j is some fragment of P . Precisely,when weighted by Q| j i , we want these P j to sum to P , so as to provide “enough” usage to cover all ofthe variables j . When we collect all of the P j into a matrix Ψ , we notice that the condition just describedis stated succinctly via a vector-matrix multiplication Q Ψ . This culminates to give us the following: Definition 4.2 ( Env ) . For any (cid:7) , P , Q , Γ , and ∆ , where Γ and ∆ have lengths m and n respectively, let P Γ (cid:7) = ⇒ Q ∆ denote the type of environments . An environment comprises a pair of a matrix Ψ : R n × m anda mapping of variables act : ( j : ( ∆ ∋ A )) → ( h j | Ψ ) Γ (cid:7) A, such that P E Q Ψ . Our main result is the following, which we will instantiate to prove admissibility of renaming(Corollary 4.6), subusaging (Corollary 4.7), and substitution (Corollary 4.9). The proof is in subsection 4.4.
Theorem 4.3 (traversal, trav ) . Given a kit on (cid:7) and an environment P Γ (cid:7) = ⇒ Q ∆ , we get a function Q ∆ ⊢ A → P Γ ⊢ A. ALinear Algebra Approach to Linear Metatheory
We now show how to use traversals to prove that renaming (including weakening) and subusaging areadmissible. This subsection corresponds to the Agda module
Specific.Syntax.Renaming . Definition 4.4 ( LVar-kit ) . Let ⊐ − -kit : Kit ( ⊐ − ) be defined with the following fields.psh ( PQ : P E Q ) : Q Γ ⊐ − A → P Γ ⊐ − A : The only occurrence of the usage context Q in the definition of ⊐ − is to the left of a E . Applying transitivity in this place gets us the required term.vr : P Γ ⊐ − A → P Γ ⊐ − A : = id .tm : P Γ ⊐ − A → P Γ ⊢ A : = VAR .wk : P Γ ⊐ − A → P Γ , ∆ ⊐ − A : A basis vector extended by s is still a basis vector: if that we have P E h i | for some i, we also have P , E h inl i | . Environments for renamings are special in that the matrix Ψ can be calculated from the action of therenaming on non-usage-checked variables. Lemma 4.5 ( ren-env ) . Given a type-preserving mapping of plain variables f : ∆ ∋ A → Γ ∋ A such that P E Q I f × id , we can produce a ⊐ − -environment of type P Γ ⊐ − = ⇒ Q ∆ .Proof. The environment has Ψ : = I f × id , so the usage condition holds by assumption. Now, act is requiredto have type ( j : ∆ ∋ A ) → ( h j | Ψ ) Γ ⊐ − A . Take arbitrary j : ∆ ∋ A . Then, we have f j : Γ ∋ A , so all thatis left is to show that f j forms a usage-checked variable of type ( h j | Ψ ) Γ ⊐ − A . This amounts to proving h j | Ψ E h f j | . Let i : Γ ∋ A , then we have ( h j | Ψ ) i E Ψ j , i = I f j , i = h f j | i . Corollary 4.6 (renaming, ren ) . Given a type-preserving mapping of plain variables f : ∆ ∋ A → Γ ∋ Asuch that P E Q I f × id , we can produce a function of type Q ∆ ⊢ A → P Γ ⊢ A. Corollary 4.7 (subusaging, subuse ) . Given P E Q , then we have a function Q Γ ⊢ A → P Γ ⊢ A. Now that we have renaming, we can use it with traversals to prove that simultaneous well-usaged substi-tution is admissible. This subsection corresponds to the Agda module
Specific.Syntax.Substitution . Definition 4.8 ( Tm-kit ) . Let ⊢ -kit : Kit ( ⊢ ) be defined with the following fields.psh ( PQ : P E Q ) : Q Γ ⊢ A → P Γ ⊢ A : This is Corollary 4.7 (subusaging).vr : P Γ ⊐ − A → P Γ ⊢ A : = VAR .tm : P Γ ⊢ A → P Γ ⊢ A : = id .wk : P Γ ⊢ A → P Γ , ∆ ⊢ A : We use Corollary 4.6 (renaming), with f : Γ ∋ A → Γ , ∆ ∋ A being the em-bedding inl . It remains to check that ( P , ) E P I inl × id . We prove this pointwise. Let i : Γ , ∆ ∋ A,and take cases on whether i is from Γ or from ∆ . If i = inl i ′ for an i ′ : Γ ∋ A, we must show that P i ′ E ( P I inl × id ) inl i ′ . But we have the following. P i ′ E ( P I ) i ′ = ∑ j : Γ ∋ A P j I j , i ′ = ∑ j : Γ ∋ A P j I inl j , inl i ′ = ( P I inl × id ) inl i ′ . If i = inr i ′ for an i ′ : ∆ ∋ A, we must show that E ( P I inl × id ) inr i ′ . But we have the following. E ( P ) i ′ = ∑ j : Γ ∋ A P j j , i ′ = ∑ j : Γ ∋ A P j I inl j , inr i ′ = ( P I inl × id ) inr i ′ . Corollary 4.9 (substitution, sub ) . Given an environment of type P Γ ⊢ = ⇒ Q ∆ (i.e., a well-usaged simulta-neous substitution), we get a function of type Q ∆ ⊢ A → P Γ ⊢ A. .Wood &R.Atkey 7 The proof of the traversal theorem follows the same structure as in McBride’s article, extended withproof obligations to show that we are correctly respecting the usage annotations. We must first prove alemma that shows that environments can be pushed under binders.
Lemma 4.10 (bind, bind ) . Given a kit on (cid:7) , we can extend an environment of type P Γ (cid:7) = ⇒ Q ∆ , to anenvironment of type P Γ , R Θ (cid:7) = ⇒ Q ∆ , R Θ .Proof. Let the environment we are given be ( Ψ : R n × m , act : ( j : ∆ ∋ A ) → ( h j | Ψ ) Γ (cid:7) A ) , with P E Q Ψ . We are trying to construct ( Ψ ′ : R ( n + o ) × ( m + o ) , act ′ : ( j : ∆ , Θ ∋ A ) → ( h j | Ψ ′ )( Γ , Θ ) (cid:7) A ) , with P , R E ( Q , R ) Ψ ′ . Let Ψ ′ : = (cid:18) Ψ
00 I (cid:19) . With this definition, our required condition splits into theeasily checked conditions P E Q Ψ + R and R E Q + R I . For act ′ , we take cases on whether j isfrom ∆ or from Θ . In the ∆ case, act gets us an inhabitant of ( h j | Ψ ) Γ (cid:7) A . Notice that h j | Ψ ′ = h j | Ψ , ,so we want to get from ( h j | Ψ ) Γ (cid:7) A to ( h j | Ψ ) Γ , Θ (cid:7) A . We can get this using wk from our kit. In the Θ case, notice that h j | Ψ ′ = , h j | . In other words, h j | Ψ ′ is a basis vector, so we actually have usage-checked ( h j | Ψ ′ )( Γ , Θ ) ⊐ − A . Thus, we can use vr from our kit to get ( h j | Ψ ′ )( Γ , Θ ) (cid:7) A , as required. Theorem 4.3 (traversal, trav ) . Given a kit on (cid:7) and an environment P Γ (cid:7) = ⇒ Q ∆ , we get a function Q ∆ ⊢ A → P Γ ⊢ A.Proof.
By induction on the syntax of M . In the VAR x case, where x : Q ∆ ⊐ − A : By definition of ⊐ − ,we have that Q E h j | for some j . Applying the action of the environment, we have ( h j | Ψ ) Γ (cid:7) A . Wethen have P E Q Ψ E h j | Ψ , so using the fact that stuff appropriately respects subusaging ( psh ), we have P Γ (cid:7) A . Finally, using tm , we get a term P Γ ⊢ A , as required.Non- VAR cases are generally handled in the following way. If the input usage context Q is split upinto a linear combination of zero or more usage contexts Q i , obtain a similar splitting of P by setting P i : = Q i Ψ . This works out because of the linearity of matrix multiplication (in particular, multiplicationrespects operations on the left). This yields environments of type P i Γ (cid:7) = ⇒ Q i ∆ for the subterms to usewith the inductive hypothesis. If any subterms bind variables, apply Lemma 4.10 as appropriate. We have extended McBride’s method of kits and traversals to proving admissibility of renaming, sub-usaging and substitution to the usage-annotated calculus λ R . In doing so, we have discovered that onlyskew semirings are required, and the importance of linear algebra for stating and proving these results.Though we have not had space to elaborate here, λ R is capable of representing several well known linearand modal type theories by choice of semiring.Our work is similar in spirit to the work of Licata, Shulman, and Riley [LSR17], which gives aproof of cut elimination for a large class of substructural single-conclusion sequent calculi. The class ofnatural deduction systems we consider here is likely less general, but not directly comparable. We leavea complete comparison to future work. They have not formalised their work.We plan to build on our work to generalise the framework of Allais et al. [AAC +
20] to include usageannotations, allowing generic metatheory and semantics for an even wider class of substructural calculi.
Acknowledgements
We are thankful for comments from Guillaume Allais. ALinear Algebra Approach to Linear Metatheory
References [AAC +
20] Guillaume Allais, Robert Atkey, James Chapman, Conor McBride & James McKinna (2020):
A Typeand Scope Safe Universe of Syntaxes with Binding: Their Semantics and Proofs . Accepted for JFP.[All18] Guillaume Allais (2018):
Typing with Leftovers - A mechanization of Intuitionistic Multiplicative-Additive Linear Logic . In: TYPES2017, pp. 1:1–1:22, doi: .[Bar96] Andrew Barber (1996):
Dual Intuitionistic Linear Logic . Technical Report, University of Edinburgh.[BBPH93] P. N. Benton, Gavin M. Bierman, Valeria de Paiva & Martin Hyland (1993):
A Term Calculus forIntuitionistic Linear Logic . In: Typed Lambda Calculi and Applications, LNCS 664, Springer, pp.75–90, doi: .[BGMZ14] A. Brunel, M. Gaboardi, D. Mazza & S. Zdancewic (2014):
A Core Quantitative Coeffect Calculus .In: ESOP2014, pp. 351–370.[BHKM12] Nick Benton, Chung-Kil Hur, Andrew Kennedy & Conor McBride (2012):
Strongly typed termrepresentations in Coq . J.ofAutomReasoning 49(2), doi: .[CLR19] Kaustuv Chaudhuri, Leonardo Lima & Giselle Reis (2019):
Formalized meta-theory of sequent cal-culi for linear logics . Theor.Comput.Sci. 781, pp. 24–38, doi: .[Cra10] Karl Crary (2010):
Higher-Order Representation of Substructural Logics . SIGPLANNot. 45(9), p.131142, doi: .[GS14] Dan R. Ghica & Alex I. Smith (2014):
Bounded Linear Types in a Resource Semiring . In: ESOP2014, pp. 331–350.[Lau18] Olivier Laurent (2018):
Preliminary Report on the Yalla Library . Available at https://perso.ens-lyon.fr/olivier.laurent/yalla/ . Coq Workshop.[LSR17] Daniel R. Licata, Michael Shulman & Mitchell Riley (2017):
A Fibrational Framework for Sub-structural and Modal Logics . In: FSCD2017, pp. 25:1–25:22, doi: .[McB05] Conor McBride (2005):
Type-preserving renaming and substitution . Available at .[OLE19] Dominic A. Orchard, Vilem Liepelt & Harley Eades (2019):
Quantitative program reasoning withgraded modal types . ProceedingsoftheACMonProgrammingLanguages3.[PD99] Frank Pfenning & Rowan Davies (1999):
A Judgmental Reconstruction of Modal Logic . In: Mathe-maticalStructuresinComputerScience, p. 2001.[POM14] Tomas Petricek, Dominic A. Orchard & Alan Mycroft (2014):
Coeffects: a calculus of context-dependent computation . In: ICFP2014, pp. 123–135.[PW99] James Power & Caroline Webster (1999):
Working with Linear Logic in Coq . 12th InternationalConference on Theorem Proving in Higher Order Logics (Work-in-progress paper).[RBPKV20] Arjen Rouvoet, Casper Bach Poulsen, Robbert Krebbers & Eelco Visser (2020):
Intrinsically-TypedDefinitional Interpreters for Linear, Session-Typed Languages . In: CPP2020, pp. 284–298, doi: .[RP10] J. Reed & B. C. Pierce (2010):
Distance Makes the Types Grow Stronger . In P. Hudak & S. Weirich,editors: ICFP2010, pp. 157–168.[Szl12] Korn´el Szlach´anyi (2012):
Skew-monoidal categories and bialgebroids . Advances in Mathematics231(3-4), pp. 1694–1730, doi: .[Wad92] Philip Wadler (1992):
There’s no substitute for linear logic . In: 8th InternationalWorkshop on theMathematicalFoundationsofProgrammingSemantics.[XORN17] Bruno Xavier, Carlos Olarte, Giselle Reis & Vivek Nigam (2017):
Mechanizing Focused LinearLogic in Coq . In: 12thWorkshoponLogicalandSemanticFrameworks,withApplications, ENTCS338, Elsevier, pp. 219–236, doi:10.1016/j.entcs.2018.10.014