Two Bases for Graded Types: Calculi and Correspondence
Prerequisites. Direct starred prerequisites: Chapter 53. No later core chapter depends on this route.
Suppose 𝑓 uses its argument with grade 𝑟. In the body 𝑓(𝑓𝑥), the outer occurrence of 𝑓 contributes 1, the inner occurrence lies in an argument scaled by 𝑟, and 𝑥 lies under both applications. Their grades are therefore 1+𝑟 and 𝑟⋅𝑟. There are two places to record those facts. A judgment may grade the assumptions for 𝑓 and 𝑥, or a type may place a graded box around the argument of 𝑓. The annotations look interchangeable. They are not: one presentation has graded functions, while the other has linear functions and a graded modality. This chapter fixes the two nondependent calculi of Liepelt, Marshall, and Orchard and proves only the translations they establish [LMO26].
One algebra, two bases
Fix a preordered semiring𝑅,0,1,+,⋅,⊑𝗊. Addition and multiplication are monotone, with respective units 0 and 1. A graded assumption is written 𝑥:𝑟𝐴, while a linear assumption is written 𝑥:𝐴. Context addition and scalar multiplication are pointwise: (Δ,𝑥:𝑟𝐴)+(Δ′,𝑥:𝑠𝐴)=Δ+Δ′,𝑥:𝑟+𝑠𝐴,𝑞⋅(Δ,𝑥:𝑟𝐴)=𝑞⋅Δ,𝑥:𝑞⋅𝑟𝐴. Missing variables carry grade 0. These equations describe annotations; they do not yet say whether a grade is an exact count, an upper bound, a sensitivity, or a security level. That interpretation is fixed by the chosen semiring and preorder.
★☆☆ In the semiring of natural numbers, calculate the grades 1+𝑟 and 𝑟⋅𝑟 of 𝑓 and 𝑥 in 𝑓(𝑓𝑥) when the arrow of 𝑓 carries grade 𝑟. Repeat in the Boolean semiring and explain why the second calculation cannot count calls.
The Linear Base puts ordinary functions over a context containing linear and graded assumptions: 𝐴,𝐵::=𝐾∣𝐴⊸𝐵∣◻𝑟𝐴,𝑡,𝑢::=𝑥∣𝜆𝑥.𝑡∣𝑡𝑢∣[𝑡]∣𝗅𝖾𝗍[𝑥]=𝑡𝗂𝗇𝑢. Write Γ⊢𝖫𝑡:𝐴. The notation gr(Γ) means that every assumption in Γ is graded, while gr0(Γ) means that each has grade 0. The complete typing rules are
𝑥:𝐴⊢𝖫𝑥:𝐴
L-Var
Γ,𝑥:𝐴⊢𝖫𝑡:𝐵
Γ⊢𝖫𝜆𝑥.𝑡:𝐴⊸𝐵
L-Abs
Γ1⊢𝖫𝑡:𝐴⊸𝐵Γ2⊢𝖫𝑢:𝐴
Γ1+Γ2⊢𝖫𝑡𝑢:𝐵
L-App
Γ⊢𝖫𝑡:𝐴gr0(Γ′)
Γ+Γ′⊢𝖫𝑡:𝐴
L-Weak
Γ,𝑥:𝐴⊢𝖫𝑡:𝐵
Γ,𝑥:[𝐴]1⊢𝖫𝑡:𝐵
L-Der
Γ⊢𝖫𝑡:𝐴gr(Γ)
𝑟⋅Γ⊢𝖫[𝑡]:◻𝑟𝐴
L-Prom
Γ1⊢𝖫𝑡:◻𝑟𝐴Γ2,𝑥:[𝐴]𝑟⊢𝖫𝑢:𝐵
Γ1+Γ2⊢𝖫𝗅𝖾𝗍[𝑥]=𝑡𝗂𝗇𝑢:𝐵
L-Let
Γ,𝑥:[𝐴]𝑟⊢𝖫𝑡:𝐵𝑟⊑𝗊𝑠
Γ,𝑥:[𝐴]𝑠⊢𝖫𝑡:𝐵
L-Approx
Context addition is undefined when both operands contain the same linear assumption; only shared graded assumptions are added. Thus there is no contraction rule for a linear assumption. Promotion scales an entire graded context; it cannot close over a linear assumption.
Call-by-name reduction has the two principal steps (𝜆𝑥.𝑡)𝑢⟶𝖫𝑡[𝑢/𝑥],𝗅𝖾𝗍[𝑥]=[𝑡]𝗂𝗇𝑢⟶𝖫𝑢[𝑡/𝑥], and congruence in function and scrutinee position. Its reflexive transitive closure is ⟶∗𝖫.
If 2⊑𝗊𝑟, then 𝑐:𝐾⊸𝐾⊸𝐶,𝑧:◻𝑟𝐾⊢𝖫𝗅𝖾𝗍[𝑥]=𝑧𝗂𝗇𝑐𝑥𝑥:𝐶. The two occurrences of 𝑥 are combined before L-Approx. This is an upper-bound reading only when the preorder is oriented so that larger annotations admit more use.
The Graded Base grades the domain of every function: 𝐴,𝐵::=𝐾∣𝐴𝑟→𝐵,𝑡,𝑢::=𝑥∣𝜆𝑥.𝑡∣𝑡𝑢. Every assumption is graded. The complete judgment Δ⊢𝖦𝑡:𝐴 is generated by
𝑥:1𝐴⊢𝖦𝑥:𝐴
G-Var
Δ⊢𝖦𝑡:𝐴
Δ,0⋅Δ′⊢𝖦𝑡:𝐴
G-Weak
Δ,𝑥:𝑟𝐴⊢𝖦𝑡:𝐵𝑟⊑𝗊𝑠
Δ,𝑥:𝑠𝐴⊢𝖦𝑡:𝐵
G-Approx
Δ,𝑥:𝑟𝐴⊢𝖦𝑡:𝐵
Δ⊢𝖦𝜆𝑥.𝑡:𝐴𝑟→𝐵
G-Abs
Δ1⊢𝖦𝑡:𝐴𝑟→𝐵Δ2⊢𝖦𝑢:𝐴
Δ1+𝑟⋅Δ2⊢𝖦𝑡𝑢:𝐵
G-App
The principal reduction is (𝜆𝑥.𝑡)𝑢⟶𝖦𝑡[𝑢/𝑥]; congruence is in function position. Thus both bases use call by name.
Proof. Induct on the first derivation. In the variable case for 𝑥, the context has grade 1, so the conclusion is the second premise. Another variable uses G-Weak. The abstraction case applies the induction hypothesis under the binder. In the application case, write the function’s arrow grade as 𝑞, and write the grades of 𝑥 in the function and argument premises as 𝑎 and 𝑏. The conclusion before substitution has context Δ1+𝑞Δ2,𝑥:𝑎+𝑞𝑏𝐴. The two induction hypotheses produce Δ1+𝑎Θ and Δ2+𝑏Θ; rule G-App combines them as (Δ1+𝑎Θ)+𝑞(Δ2+𝑏Θ)=Δ1+𝑞Δ2+(𝑎+𝑞𝑏)Θ, by distributivity and associativity. Weakening and approximation commute with substitution by monotonicity of addition and multiplication. ◻
For ℎ=𝜆𝑓.𝜆𝑥.𝑓(𝑓𝑥), the outer use of 𝑓 has grade 1, its inner use is scaled by 𝑟, and the nested argument grades multiply: ⊢𝖦ℎ:(𝐴𝑟→𝐴)1+𝑟←←←←←←←→𝐴𝑟⋅𝑟⟶𝐴. This single derivation separates addition for independent occurrences from multiplication for nested demand. The printed Examples 2.13–2.14 of the source show (1+1) for the grade of (f). Rule G-App, however, scales the inner occurrence by the arbitrary arrow grade (r), giving (1+r); the chapter uses that rule-derived correction throughout [LMO26].
The algebra decides what that calculation means. The following four instantiations use the same syntax but not the same theorem:
Reading
Algebra and order
Calculation for ℎ
exact use
ℕ, ordinary + and ⋅, equality order
At 𝑟=2, 𝑓 has grade 3 and 𝑥 grade 4; neither may be enlarged.
upper bound
ℕ, ordinary operations, numeric ≤
The least derived pair at 𝑟=2 is (3,4); G-Approx also admits (5,7).
sensitivity
ℝ≥0, ordinary operations, numeric ≤
If the argument position is 𝐿-sensitive, the two nested paths give 1+𝐿 for 𝑓 and 𝐿2 for 𝑥.
The exact-use and security rows are instances exhibited by the source; the upper-bound and sensitivity rows are direct semiring calculations. The security derivation does not by itself prove noninterference, and the sensitivity row does not by itself define a metric semantics. The bounded-use and Level-security examples in Granule illustrate the same requirement to fix the algebra before reading an annotation; they do not supply a theorem for the two bases [OLI19].
★★☆ Use lemma 54.2 to prove preservation for the principal beta step. State why the result is preservation of the annotated judgment, not a proof that the annotation is an exact dynamic count.
The direct translation inserts a box at every graded domain: L[[𝐾]]=𝐾,L[[𝐴𝑟→𝐵]]=◻𝑟L[[𝐴]]⊸L[[𝐵]],L[[𝑥:𝑟𝐴]]=𝑥:[L[[𝐴]]]𝑟,L[[𝑥]]=𝑥,L[[𝜆𝑥.𝑡]]=𝜆𝑦.𝗅𝖾𝗍[𝑥]=𝑦𝗂𝗇L[[𝑡]],L[[𝑡𝑢]]=L[[𝑡]][L[[𝑢]]], where 𝑦 is fresh. Context translation is pointwise and consequently commutes with addition and scaling.
Proof of Theorem 54.3 — Graded-to-linear correspondence
Proof. For item 1, induction on typing. The only new cases are abstraction and application. Abstraction translates its graded assumption into 𝑥:[L[[𝐴]]]𝑟, eliminates it with L-Let, and then applies L-Abs. Application promotes the translated argument with L-Prom and combines contexts with L-App. The identity L[[𝑟⋅Δ]]=𝑟⋅L[[Δ]] supplies the required context.
For item 2, the principal calculation is L[[(𝜆𝑥.𝑡)𝑢]]=(𝜆𝑦.𝗅𝖾𝗍[𝑥]=𝑦𝗂𝗇L[[𝑡]])[L[[𝑢]]]⟶𝖫𝗅𝖾𝗍[𝑥]=[L[[𝑢]]]𝗂𝗇L[[𝑡]]⟶𝖫L[[𝑡]][L[[𝑢]]/𝑥]=L[[𝑡[𝑢/𝑥]]]. The congruence case follows from function-position congruence. Item 3 is an induction over the source equational derivation; the beta case is the displayed calculation, and congruence and equivalence rules are homomorphic. These are the three clauses of Theorem 1 of the source; its Appendix B.1 gives the standard weakening and substitution details [LMO26]. ◻
Proof. Both equations follow pointwise from L[[𝑥:𝑞𝐴]]=𝑥:[L[[𝐴]]]𝑞. ◻
The converse is false as a direct translation. A term of type 𝐴1→𝐵 does not promise exactly one use: in a semiring where 0=1, the grade carries no such information. Mapping it to 𝐴⊸𝐵 would manufacture linearity. The source therefore uses continuation passing.
★★☆ Take the one-element semiring. Derive a constant function at an arrow marked 1, and explain why translating that arrow directly to a linear arrow would invalidate the intended assumption discipline.
Fix an answer type 𝐾. The call-by-name CPS translation is G[[𝐾]]=(𝐾1→𝐾)1→𝐾,G[[𝐴⊸𝐵]]=((G[[𝐴]]1→G[[𝐵]])1→𝐾)1→𝐾,G[[◻𝑟𝐴]]=(G[[𝐴]]𝑟→𝐾)1→𝐾,G[[𝑥]]=𝜆𝑘.𝑥𝑘,G[[𝜆𝑥.𝑡]]=𝜆𝑘.𝑘(𝜆𝑥.G[[𝑡]]),G[[𝑡𝑢]]=𝜆𝑘.G[[𝑡]](𝜆𝑓.𝑓(G[[𝑢]])𝑘),G[[[𝑡]]]=𝜆𝑘.𝑘(G[[𝑡]]),G[[𝗅𝖾𝗍[𝑥]=𝑡𝗂𝗇𝑢]]=𝜆𝑘.G[[𝑡]](𝜆𝑥.G[[𝑢]]𝑘). A linear assumption maps to grade 1; 𝑥:[𝐴]𝑟 maps to grade 𝑟. The continuation is essential: it supplies the multiplication needed to simulate promotion and unboxing.
Proof of Theorem 54.5 — Linear-to-graded CPS correspondence
Proof. Typing is by induction on the Linear Base derivation. Linear variables use grade 1; L-Prom becomes multiplication of the translated context by 𝑟; and L-Let becomes graded substitution. The beta simulations are finite full-beta calculations through the displayed continuations. The modal beta calculation substitutes the value passed to the continuation; modal eta cancels the continuation introduced for a box. Function eta is excluded because the CPS type is not definitionally an unboxed function type. This is exactly Theorem 2 and its stated equation boundary in the source; Appendix B.2 verifies every remaining rule case [LMO26]. ◻
Neither theorem asserts inverse translations, full abstraction, normalization, or a common denotational semantics. Products make the limit concrete: a negative-position product in the continuation translation is not the direct image of a Graded Base product. Similar-looking grades therefore support a correspondence, not an identification of calculi.
★★☆ Calculate G[[◻2(𝐴⊸𝐴)]]. Mark the arrow carrying grade 2, and explain why erasing the two continuation layers would not be a type-preserving simplification.
Gaboardi, Katsumata, Orchard, Breuvart, and Uustalu combine effects and coeffects in a third calculus [GyKO^+16]. It is not a corollary of either translation above. Fix an effect preordered monoid 𝐸,1,∙, a coeffect preordered semiring 𝑅, a distributive-law format 𝜙, and the source’s matched-pair operations connecting the two grades. The type grammar is 𝐴,𝐵::=𝑜∣𝐴→𝐵∣𝑇𝑒𝐴∣𝐷𝑟𝐴. The type 𝑇𝑒𝐴 classifies a computation with effect grade 𝑒; the type 𝐷𝑟𝐴 classifies data made available with coeffect grade 𝑟. A judgment has linear assumptions 𝑥:𝐴 and discharged assumptions 𝑥:[𝐴]𝑟. Context sum is defined only when repeated variables are discharged, in which case their grades add. Scalar multiplication 𝑟∗[Γ] is defined only for a fully discharged context. Here is the complete typing card:
𝑥:𝐴⊢𝑥:𝐴
EC-Ax
Γ⊢𝑡:𝐴Γ′<:𝖾𝖼Γ𝐴<:𝖾𝖼𝐵
Γ′,[Δ]0⊢𝑡:𝐵
EC-Sub
Γ,𝑥:𝐴⊢𝑡:𝐵
Γ⊢𝜆𝑥.𝑡:𝐴→𝐵
EC-Abs
Γ⊢𝑡:𝐴→𝐵Δ⊢𝑢:𝐴
Γ+Δ⊢𝑡𝑢:𝐵
EC-App
Γ⊢𝑡:𝐴
Γ⊢⟨𝑡⟩:𝑇1𝐴
EC-Unit
Γ⊢𝑡1:𝑇𝑒𝐴Δ,𝑥:𝐴⊢𝑡2:𝑇𝑓𝐵
Γ+Δ⊢𝗅𝖾𝗍⟨𝑥⟩=𝑡1𝗂𝗇𝑡2:𝑇𝑒∙𝑓𝐵
EC-LetT
Γ,𝑥:𝐴⊢𝑡:𝐵
Γ,𝑥:[𝐴]1⊢𝑡:𝐵
EC-Der
[Γ]⊢𝑡:𝐵
𝑟∗[Γ]⊢[𝑡]:𝐷𝑟𝐵
EC-Pr
Γ⊢𝑡1:𝐷𝑟𝐴Δ,𝑥:[𝐴]𝑟⊢𝑡2:𝐵
Γ+Δ⊢𝗅𝖾𝗍[𝑥]=𝑡1𝗂𝗇𝑡2:𝐵
EC-LetD
⊢𝖽𝗂𝗌𝗍𝜙𝑟,𝑒:𝐹𝜙𝑟,𝑒𝐴→𝐺𝜙𝑟,𝑒𝐴
EC-Dist
⊢𝗈𝗉:𝐴𝗈𝗉
EC-Op
Subtyping is covariant in effect grades and contravariant in coeffect grades: 𝐴<:𝖾𝖼𝐴′𝑒≤𝑓𝑇𝑒𝐴<:𝖾𝖼𝑇𝑓𝐴′𝐴<:𝖾𝖼𝐴′𝑠≤𝑟𝐷𝑟𝐴<:𝖾𝖼𝐷𝑠𝐴′𝐴<:𝖾𝖼𝐴′𝑠≤𝑟[𝐴]𝑟<:𝖾𝖼[𝐴′]𝑠. Arrow subtyping and pointwise context subtyping complete the relation. The eight choices of 𝐹𝜙𝑟,𝑒 and 𝐺𝜙𝑟,𝑒 are the source’s four left/right information-flow formats crossed with the choices 𝑇-over-𝐷 and 𝐷-over-𝑇; choosing one is part of fixing the calculus, not a derived equivalence.
One completely typed program exposes both coordinates. Assume 𝑑:𝐷2𝐴, 𝑝:𝐴→𝑇𝑒𝐵, and 𝑐:𝐴→𝐵→𝐶. Then 𝗅𝖾𝗍[𝑥]=𝑑𝗂𝗇𝗅𝖾𝗍⟨𝑦⟩=𝑝𝑥𝗂𝗇⟨𝑐𝑥𝑦⟩:𝑇𝑒𝐶. The first occurrence of 𝑥 types 𝑝𝑥:𝑇𝑒𝐵; the second types 𝑐𝑥𝑦:𝐶. Each premise derives 𝑥:[𝐴]1, so EC-LetT adds them to 𝑥:[𝐴]2, exactly the discharged assumption required by EC-LetD. The effect coordinate is instead 𝑒∙1=𝑒. Thus the coeffect addition 1+1=2 accounts for two contextual uses while effect multiplication composes the producer with a pure continuation. Neither coordinate is a Koka effect row or a QTT usage annotation.
The combined calculus admits exactly the following context transformations: Γ,𝑥:𝐴⊢𝑡2:𝐵,Δ⊢𝑡1:𝐴⟹Γ+Δ⊢𝑡2[𝑡1/𝑥]:𝐵,Γ,𝑥:[𝐴]𝑟⊢𝑡2:𝐵,[Δ]⊢𝑡1:𝐴⟹Γ+𝑟⋅[Δ]⊢𝑡2[𝑡1/𝑥]:𝐵. Here [Δ] means that every assumption of Δ is discharged.
Proof. These are Lemmas 1 and 2 of the source. Induction on the first derivation proves both. The linear variable case replaces one assumption by Δ. The discharged variable case replaces grade 𝑟 by 𝑟⋅Δ. The modal introduction case is valid only because its premise has a fully discharged context. Every other rule follows from distributivity and monotonicity. ◻
Orienting the calculus’s typed equations gives an operational reduction relation for the fragment without primitive operations. Every oriented equation has the same type and context on both sides. The pure beta rule uses linear substitution; the coeffect beta rule uses coeffectful substitution; effect beta and associativity use the effect-monoid laws; the distributive rules use the fixed matched-pair equations. Hence each principal step preserves its judgment. This is the source’s type-preservation argument for the oriented equations, not a progress theorem. The published semantic theorem is different:
Let 𝜋1 and 𝜋2 derive Γ⊢𝑡1:𝐴 and Γ⊢𝑡2:𝐴. If 𝜋1=𝜋2 is derivable in the combined equational theory, then their interpretations in every model satisfying the source’s categorical hypotheses are equal.
Proof of Theorem 54.7 — Equational soundness of combined grading
Proof. Induct on the equality derivation. Congruence cases use functoriality. The beta cases use the two substitution lemmas, interpreted respectively by ordinary composition and the graded action. Unit and associativity equations use the monoid and semiring coherence maps; the distributive equation uses the specified interaction between 𝑇𝑒 and 𝐷𝑟. This is Theorem 1 of Gaboardi et al.; its statement is denotational soundness, not progress [GyKO^+16]. ◻
★★☆ For the displayed program, change the effect grade of 𝑝 while keeping the coeffect grade of 𝑥 fixed, and then do the converse. Identify the distinct rule premise affected in each change.
Marshall and Orchard’s fractional-uniqueness calculus assigns reference permissions from a semiring, but adds heaps, borrowing, and uniqueness conditions not present in the two bases above [MO24a]. It permits several read-only fractional references whose incoming permissions sum to 1, while an in-place update requires one reference carrying permission 1.
For the reference occurrences in a term 𝑡 that target identifier 𝑖𝑑 in heap 𝐻, write 𝑃(𝑡,𝐻,𝑖𝑑)=∑𝜌∈𝗋𝖾𝖿𝗌(𝑡)𝜌↦𝑝𝑖𝑑∈𝐻𝑝. This abbreviation exposes the heap hypotheses of the source theorems; it is not a Graded Base context grade.
For the source calculus and heap-compatibility relation 𝐻⋈𝗁Γ:
If Γ⊢𝑡:𝐴, then 𝑡 is a value or, for every 𝑠, Γ0, and 𝐻 with 𝐻⋈𝗁(Γ0+𝑠⋅Γ), there are 𝐻′ and 𝑡′ such that 𝐻⊢𝑡⇝𝖿𝗎𝐻′⊢𝑡′ (Progress, Theorem 6.6).
Under the same quantified heap hypothesis, a step preserves type and produces some Γ′ with Γ′⊢𝑡′:𝐴 and 𝐻′⋈𝗁(Γ0+𝑠⋅Γ′), provided reference payloads are non-function types (Type Preservation, Theorem 6.7).
For one step as above, 𝑃(𝑡,𝐻,𝑖𝑑)=1 implies 𝑃(𝑡′,𝐻′,𝑖𝑑)∈{0,1}; every identifier fresh from 𝐻 but present in 𝐻′ has outgoing permission sum 1 (Borrow Safety, Lemma 6.8).
For a multistep reduction to a value, 𝑃(𝑡,𝐻,𝑖𝑑)=1 implies that the final value contains exactly one permission-1 reference targeting 𝑖𝑑. Every final reference to an identifier fresh from 𝐻 is likewise the unique such reference. For a term of the source uniqueness type ⋆𝐴, this yields the incoming-and-fresh uniqueness conclusion (Theorem 6.9 and Corollary 6.10).
If Γ⊢𝑡1:𝐴, Γ⊢𝑡2:𝐴, 𝑡1≡𝑡2, and 𝐻⋈𝗁Γ, then both terms multireduce from 𝐻 to values whose fully beta-reduced, dereferenced forms in their resulting heaps agree (Equational Soundness, Theorem 6.11).
Proof of Theorem 54.8 — Fractional-uniqueness safety package
Proof. The five clauses are imported at their exact source signatures. Progress is by typing induction and heap compatibility. Preservation couples substitution with heap evolution; the non-function payload restriction is used when a stored value is recovered. Borrow safety is an invariant on the sum of permissions targeting each location. Induction over ⇝𝖿𝗎∗ gives the multistep clause, from which uniqueness is immediate. Equational soundness then uses preservation plus confluence of the fully dereferenced term theory. The source’s Sections 6.2–6.4 contain the case analysis; none of these statements is transferred to Linear Base or Graded Base. ◻
The pinned Granule 0.9.5.0 evaluator makes the ownership distinction executable. Loading examples.gr accepts 𝖾𝗑𝖺𝗆𝗉𝗅𝖾𝖡𝗈𝗋𝗋𝗈𝗐:∗𝖢𝗈𝗅𝗈𝗎𝗋→∗𝖢𝗈𝗅𝗈𝗎𝗋, whose borrow is split into two fractional observations and joined before the unique value is returned. Loading parsum.gr accepts 𝗌𝗎𝗆𝖥𝗋𝗈𝗆𝖳𝗈:&𝑓(𝖥𝗅𝗈𝖺𝗍𝖠𝗋𝗋𝖺𝗒𝑖𝑑)→!𝖨𝗇𝗍→!𝖨𝗇𝗍→(𝖥𝗅𝗈𝖺𝗍,&𝑓(𝖥𝗅𝗈𝖺𝗍𝖠𝗋𝗋𝖺𝗒𝑖𝑑)). It then evaluates the parallel shared reads followed by the full-permission reference update to 100.0. Appendix E records the preserved image, exact commands, and hashes. This is implementation evidence for the language design, not a machine-checked proof of theorem 54.8. The chapter’s Kappa supplement checks only a finite grade-correspondence model.
★★★ Construct a permission assignment in which two outgoing references to one identifier each have permission 1. Explain why the assignment is not by itself a counterexample to Borrow Safety—its incoming sum-one premise is absent—and why ordinary graded substitution alone cannot rule it out.
Exact-use, upper-bound, sensitivity, and security readings are therefore examples only when their algebra validates the required order and operations. The translations preserve the written grades; they do not choose their meaning.
Chapter 53 also grades contextual requirements. The named bridge used here is corollary 54.4: the direct translation preserves the same semiring coefficient while moving it from an assumption to a box, and the CPS translation preserves it in the reverse direction. This compares contextual requirements with usage accounting at the two frozen nondependent signatures; it does not transfer a substitution or subject-reduction theorem from chapter 53.
Dependency creates the next obstruction. If a result type 𝐵(𝑥) mentions a graded input, substitution must transport 𝐵(𝑢) as well as scale the term context. Linear Base elimination above acts only in terms, and the reverse translation fixes a nondependent answer type 𝐾; neither correspondence theorem licenses eliminating a graded box into a type or continuation-encoding a dependency. A quantitative dependent calculus therefore needs its own judgments and metatheory.
Sources and theorem boundary
The two-base calculi and Theorems 1–2 come from the ICFP 2026 paper and its extended Appendices B.1–B.2 [LMO26]. Lemmas 1–2 of Section 3 and Theorem 1 of Section 5 supply the combined substitutions and soundness theorem [GyKO^+16]. The fractional route uses Progress 6.6, Preservation 6.7, Borrow Safety Lemma 6.8, Borrow Safety Theorem 6.9, Uniqueness Corollary 6.10, and Equational Soundness Theorem 6.11 of Marshall and Orchard [MO24a]. None of these results turns arbitrary semiring grades into cost, sensitivity, information-flow, or ownership guarantees.
★★☆Audit the CPS boundary. Reduce the CPS translation of one linear beta redex and one modal beta redex. Locate the full-beta steps that are not source call-by-name steps.
★★☆Separate coordinates. Extend the combined-grading example with an effectful producer and a duplicated read-only input. Keep the effect monoid and coeffect semiring annotations on different lines of the derivation.
★★★Practical project.grade-correspondence-checker The implemented calculus is the finite syntax 𝐹∣𝑋∣𝖠𝗉𝗉𝗅𝗒𝑟𝑡𝑢. Preserve the invariant 𝗎𝗌𝖺𝗀𝖾(𝖠𝗉𝗉𝗅𝗒𝑟𝑡𝑢)=𝗎𝗌𝖺𝗀𝖾(𝑡)+𝑟⋅𝗎𝗌𝖺𝗀𝖾(𝑢) coordinatewise. Run artifacts/ch54-grade-correspondence/corpus.kp and require the named input 𝑓(𝑓𝑥) at 𝑟=2 to produce (3,4), its direct translation to produce the same pair, and the Boolean interpretation to produce (𝗍𝗋𝗎𝖾,𝗍𝗋𝗎𝖾). Acceptance is the four named PASS lines and empty audit printed in appendix E. Then add one term with an independent and a nested use. Predict both grades before running it, replace multiplication by addition, and require the unchanged nested-grade oracle to reject the mutant.