Papers
Topics
Authors
Recent
Search
2000 character limit reached

Graded Modal Type Theory

Updated 4 July 2026
  • Graded Modal Type Theory is a family of type systems where modalities are indexed by algebraic grades that regulate context dependence, resource usage, and more.
  • The framework unifies coeffects, linear logic, dependency, and modal semantics through rigorous structures like preordered semirings and graded modalities.
  • It supports practical applications in security, cost analysis, temporal scheduling, and session-typed concurrency while evolving toward dependent and multimodal formulations.

Graded modal type theory is a family of type-theoretic systems in which modalities, assumptions, or both are indexed by grades drawn from an algebraic structure—most often a preordered semiring—and those grades regulate context dependence, resource usage, dataflow, sensitivity, security, timing, or cost. In the dependent setting, the distinctive feature is that grading can track use not only in terms but also in types and in the context itself, while other formulations split graded and linear fragments, or compare modal and pervasive styles of grading. Taken together, these systems present graded modality not as a single calculus but as a design space linking coeffects, linear logic, dependency, and modal structure (Moon et al., 2020, Vollmer et al., 2024, Liepelt et al., 26 Jun 2026).

1. Historical development and lineages

A central distinction in the literature is between two lineages of graded typing for coeffects. In the graded-base style, grading is pervasive: contexts contain assumptions such as x:rAx :_r A, and function spaces are themselves graded, as in ArBA \xrightarrow{r} B. In the linear-base style, the underlying calculus is linear and grading is introduced via a graded modal operator such as rA\square_r A. The relationship between these styles remained open until translations were given that preserve typing, grades, and operational behavior, showing that the same notions of context dependence can be expressed in either presentation, though with important differences once products, sums, and distributive principles are considered (Liepelt et al., 26 Jun 2026).

This split is historically tied to two different sources. The linear-base lineage descends from linear logic, Bounded Linear Logic, and semiring-graded generalizations of the exponential; the graded-base lineage descends from coeffect calculi and pervasively graded systems used in Quantitative Type Theory, Idris 2, Linear Haskell, GraD, and related work. A further refinement appears in mixed graded/linear systems, where graded and linear fragments are kept distinct and connected by modalities. In one such formulation, the familiar graded modality is decomposed as

rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),

making explicit that graded necessity can be analyzed as the interaction of two modal transports rather than as a primitive unary constructor (Vollmer et al., 2024).

This development suggests that “graded modal type theory” is best understood as a broad umbrella for systems in which algebraically indexed modalities mediate structural principles. Some papers treat the graded modality itself as primary; others derive it from adjoint or action-based structure; still others show how modal and non-modal formulations can encode one another. The unifying theme is that grades are not mere annotations: they are semantic parameters controlling admissible use.

2. Core formal apparatus

The most common algebraic basis is a preordered semiring

(R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),

whose operations govern structural behavior. Across the literature, ++ combines demands, * scales demands, $0$ supports weakening, $1$ corresponds to ordinary linear use, and \sqsubseteq supports approximation or subgrading. In Granule-style presentations, the modality is written mathematically as ArBA \xrightarrow{r} B0 or ArBA \xrightarrow{r} B1, and in surface syntax as ArBA \xrightarrow{r} B2 (Hughes et al., 2021, Marshall et al., 2022).

A characteristic non-dependent linear-base judgment distinguishes linear from graded assumptions. One representative core calculus uses contexts of the form

ArBA \xrightarrow{r} B3

and types

ArBA \xrightarrow{r} B4

The key modal rules are weakening, dereliction, promotion, and approximation: ArBA \xrightarrow{r} B5

ArBA \xrightarrow{r} B6

ArBA \xrightarrow{r} B7

and if ArBA \xrightarrow{r} B8, then graded assumptions at ArBA \xrightarrow{r} B9 may be weakened to rA\square_r A0. In a closely related presentation for session typing, the introduction and elimination rules appear as

rA\square_r A1

with context addition adding grades on overlapping graded assumptions (Marshall et al., 2022).

In the dependent setting, the grading problem is more delicate because dependency allows terms to occur in types. Graded Modal Dependent Type Theory therefore uses a judgment

rA\square_r A2

where rA\square_r A3 records use of context variables in the subject term, rA\square_r A4 records use in the subject type, and rA\square_r A5 records use internal to the context itself. Dependent products are graded as

rA\square_r A6

where rA\square_r A7 tracks use of rA\square_r A8 in the function body and rA\square_r A9 tracks use of rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),0 in the codomain rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),1. Application then scales the argument’s usage twice, once for term-level substitution and once for type-level substitution: rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),2 This is the core mechanism by which GrTT tracks dataflow both in and between terms and types (Moon et al., 2020).

A later dependent formalization generalizes the algebraic base to a modality structure

rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),3

where rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),4 controls grading for natural-number recursion, and a separate usage judgment rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),5 tracks free-variable usage in both terms and types. This formulation supports rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),6-types, weak and strong rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),7-types, naturals, a universe, and graded rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),8-types, and it makes explicit that dependent graded calculi may need more structure than a bare semiring to account for elimination principles such as recursion (Abel et al., 31 Mar 2026).

3. Dependent, mixed, and multimodal formulations

One major line of work embeds grading into dependent type theory directly. In GrTT, dependency and grading are unified in a single syntax with universes, dependent products, dependent tensors, and a graded modality rA=Grdr(LinA),\Box_r A = \mathsf{Grd}_r(\mathsf{Lin}\,A),9. The theory is intended to make visible dataflow that ordinary dependent type theory hides, particularly the distinction between using a variable computationally and using it only in a type. This supports graded reconstructions of linearity, irrelevance, and parametric quantification; for example,

(R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),0

treats universal quantification as a graded dependent product whose bound variable is computationally irrelevant (Moon et al., 2020).

A second line decomposes the theory into fragments. The system (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),1 combines a graded dependent fragment and a mixed linear fragment connected by two modal operators, (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),2 and (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),3. The graded side supports dependent graded types, while the mixed side supports linear implication and tensor, with linear types allowed to depend on graded variables but not on linear ones. The operator (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),4 sends a linear type to a graded type, and (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),5 packages a graded component and a linear component that may depend on it. The later generalization (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),6 replaces the two-fragment architecture with many modes ordered as in Adjoint Logic, each mode carrying its own preordered semiring and modal shifts (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),7, (R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),8 mediating transport between modes (Hanukaev et al., 2023).

Mixed Graded/Linear Logic develops a closely related but proof-theoretic account. It separates a graded fragment with types

(R,,1,+,0,),(\mathcal R, *, 1, +, 0, \sqsubseteq),9

from a mixed linear/graded fragment with types

++0

The system’s central claim is that ordinary graded modalities can be split across two interacting forms: ++1 This mirrors Benton-style decomposition of linear logic’s ++2, but now in a semiring-graded setting and with explicit proof terms for ++3 and ++4 (Vollmer et al., 2024).

A further development shows that the relationship between “pervasive” grading and modal grading is largely a matter of base calculus. Translating

++5

embeds graded-base systems into linear-base systems directly, while the reverse direction requires either a CPS translation or the addition of modal structure and distributive principles. Once a graded-base calculus is extended with its own graded modality, direct mutual embeddings become possible on large fragments. This suggests that graded modal type theory and pervasively graded calculi are best viewed as two dominant approaches to the same coeffect discipline, rather than unrelated formalisms (Liepelt et al., 26 Jun 2026).

The metatheoretic endpoint of this line is a fully formalized graded modal dependent type theory with erasure. That system is formalized in Agda, includes ++6-types, weak and strong ++7-types, naturals, empty type, universe, graded ++8-types, and erasure-oriented modalities, and proves subject reduction, consistency, normalization, decidability of definitional equality, a substitution theorem for grade assignment, and preservation of grades under reduction. It also proves soundness of extraction to an untyped ++9-calculus for a class of modalities with a well-behaved zero (Abel et al., 31 Mar 2026).

4. Semantics, proof theory, and logical structure

The dominant semantic picture is graded comonadic. In semiring-graded systems, the indexed modality carries counit- and comultiplication-like structure, with maps such as

*0

and with additional structure for weakening and contraction when the grade algebra supports them. Mixed Graded/Linear Logic makes this explicit by decomposing a graded exponential comonad into a symmetric monoidal adjunction together with a strict action, thereby deriving the graded modality from interaction between fragments rather than postulating it as primitive (Hughes et al., 2021, Vollmer et al., 2024).

Quantitative equality adds another semantic layer. A complete *1-equational system for a graded *2-calculus interprets graded modalities in *3-enriched symmetric monoidal closed categories equipped with a Lipschitz exponential comonad. The defining condition

*4

states that the grade scales quantitative discrepancy. This supports a sound and complete proof system for equations

*5

and yields canonical constructions of such comonads via symmetric powers, with applications to timed and probabilistic behavior (Dahlqvist et al., 2023).

Another strand relates modal reasoning directly to metric reasoning. In a call-by-value affine *6-calculus with graded modal necessity types *7, modal equivalence is formulated using ternary *8-relations and a comonadic lax extension *9 on relations. This supports a graded version of applicative bisimilarity, proves it a congruence via a modal adaptation of Howe’s method, and establishes that modal applicative bisimilarity coincides with applicative bisimilarity distance through Lawvere-style enrichment. The resulting slogan is literal: modal program relations and program distances are two presentations of the same structure (Lago et al., 2021).

Graded monads provide a parallel semantic account focused on observation depth rather than resource use. A graded monad $0$0 with multiplications

$0$1

packages $0$2-step observations, and depth-1 graded monads are characterized by the fact that the entire hierarchy is generated from $0$3 and $0$4. This framework subsumes trace equivalence, completed traces, readiness, failures, simulation-like semantics, bisimilarity, and probabilistic traces, and it supports extraction of expressive graded modal logics via a generic Hennessy–Milner-style theorem (Dorsch et al., 2018).

Resource-bounded type theory shows that graded modalities need not be limited to use counts or necessity. There, the modality $0$5 is read as a computation of type $0$6 certified to consume at most $0$7 resources, where grades inhabit an abstract resource lattice

$0$8

The theory provides guarded introduction, counit, and monotonicity for the modality, proves a syntactic cost soundness theorem

$0$9

and constructs a syntactic term model in $1$0 with cost extraction as a natural transformation and an initiality theorem for resource-bounded models (Mannucci et al., 7 Dec 2025).

Security-oriented multimodality gives another refinement. A short paper on integrity and confidentiality keeps the existing confidentiality modality $1$1 as a graded comonad, adds a separate integrity modality $1$2, and observes that $1$3 behaves as a relative monad over $1$4, with reveal as relative unit and endorse as relative bind. This is a compact but consequential example of graded modal type theory becoming genuinely multi-modal (Marshall et al., 2023).

5. Programming methodology and application domains

In practice, graded modal types are used to express several distinct kinds of property. The papers surveyed here exhibit usage counts, affine bounds, intervals, confidentiality, integrity, timing information, and certified cost bounds. The algebraic presentation differs across applications—preordered semirings, lattices, integers, or abstract resource lattices—but the common pattern is an indexed modality whose grade constrains admissible use.

Interpretation Grade structure Illustrative form
Usage and dataflow preordered semiring $1$5, $1$6
Confidentiality / integrity $1$7 plus $1$8 $1$9
Timing \sqsubseteq0 \sqsubseteq1
Resource bounds \sqsubseteq2 \sqsubseteq3

A particularly practical problem arises when graded modalities interact with datatypes. In Granule, a function may expect a pair of shape \sqsubseteq4 while a caller has \sqsubseteq5. These types represent the same underlying information arranged differently, but are not definitionally equal. The solution is to derive distributive combinators automatically, including push

\sqsubseteq6

and pull

\sqsubseteq7

For products, these become

\sqsubseteq8

The derivation is syntax-directed over datatype structure and implemented in Granule and, via Template Haskell, in Linear Haskell. The same methodology also derives structural combinators such as drop and copyShape (Hughes et al., 2021).

Session-typed concurrency shows graded modalities functioning as disciplined non-linearity. In Granule, the modality \sqsubseteq9 is used to type reusable channels, replicated servers, and multicast payloads. The primitives forkNonLinear, forkReplicate, forkReplicateExactly, and forkMulticast reintroduce carefully controlled forms of sharing and replication into a fundamentally linear session calculus. The paper’s key design lesson is operational: in a call-by-value setting, unrestricted promotion of channel-creating computations is unsound, so safe non-linearity must be reintroduced by specialized graded primitives whose protocol restrictions are reflected in their types (Marshall et al., 2022).

Security applications exploit the same machinery differently. For confidentiality, the two-point semiring

ArBA \xrightarrow{r} B00

with ArBA \xrightarrow{r} B01 supports ordinary graded information-flow control. The extension with integrity adds a second modality and an allowed flow

ArBA \xrightarrow{r} B02

realized as

ArBA \xrightarrow{r} B03

This design is motivated by the claim that integrity is not adequately modeled by merely reversing the confidentiality order (Marshall et al., 2023).

Temporal scheduling provides a different interpretation again. Pulse Schedule Type Theory treats grades as integer time offsets, with assumptions ArBA \xrightarrow{r} B04 and modal types ArBA \xrightarrow{r} B05. A variable at grade ArBA \xrightarrow{r} B06 is usable now, positive grades indicate future availability, and negative grades indicate past availability. A gate of duration ArBA \xrightarrow{r} B07 is typed by shifting input contexts by ArBA \xrightarrow{r} B08, and the semantic model interprets the grading algebra as a symmetric monoidal action of ArBA \xrightarrow{r} B09 on a category of pulse schedules. The result is a linear graded modal calculus in which grading expresses synchronization rather than duplication (Adams, 3 Oct 2025).

Cost analysis illustrates yet another use. In resource-bounded type theory, the modality certifies feasibility under a resource budget, so that boxing is conditional on an already-synthesized cost bound. This suggests that graded modal type theory can internalize not only contextual demand but also operational upper bounds, with the modality functioning as a certification layer rather than as unrestricted promotion (Mannucci et al., 7 Dec 2025).

6. Limitations and current frontiers

A recurring limitation is that not every apparently natural distributive principle is derivable. In the datatype-generic account of push and pull, pull is not derivable for function types, because the required promotion cannot be typed, and neither push nor pull is derived over graded modalities themselves. Pull also requires greatest lower bounds of grades. This sharply separates the fragment where distributive laws are automatic from the fragment where they are not (Hughes et al., 2021).

Several papers also stress that graded necessity should not be identified too quickly with the ordinary exponential of linear logic. One explicit example is the derivable map

ArBA \xrightarrow{r} B10

which ordinary linear logic does not validate as

ArBA \xrightarrow{r} B11

The point is that the behavior of a graded modality depends on the semantics of the chosen grades, not only on its superficial resemblance to ArBA \xrightarrow{r} B12 (Hughes et al., 2021).

Similarly, the relation between modal and pervasive grading is close but not identity. Mutual translations show broad expressivity equivalence, yet they are not inverses, they are not adjoint, and the reverse translation for products and sums requires explicit push constructs on the linear side. Moreover, preserving linearity may require enriching the grade algebra—for example by a product with the none-one-tons semiring—to separate genuinely linear assumptions from merely grade-ArBA \xrightarrow{r} B13 ones (Liepelt et al., 26 Jun 2026).

The metatheoretic status of application-driven extensions is uneven. The session-typing work on non-linear communication is explicit that it does not yet supply a full new safety metatheory for the extended system, instead relying on the call-by-value counterexample and the design of restricted primitives. The integrity/confidentiality work is similarly clear that it does not provide preservation, progress, or noninterference theorems, but a structural modal account. These papers therefore function more as language-design and modal-architecture proposals than as fully closed metatheories (Marshall et al., 2022, Marshall et al., 2023).

Dependent systems expose further complications. The mode-theoretic generalization ArBA \xrightarrow{r} B14 shows how to combine dependency, grading, and adjoint logic, but it also explains why contraction becomes harder to control than in simply typed Adjoint Logic: substitution already contains an implicit contraction principle in the dependent setting. By contrast, the Agda-formalized erasure-oriented theory achieves normalization, decidability of definitional equality, and sound extraction, but only for modalities with a well-behaved zero and with restrictions such as the exclusion of erased matches for weak ArBA \xrightarrow{r} B15-types in the strongest open-term soundness result (Hanukaev et al., 2023, Abel et al., 31 Mar 2026).

The present literature therefore suggests several stable conclusions. First, graded modalities are not a narrow embellishment of linear logic but a common language for coeffects, dependency, quantitative equality, security, scheduling, and cost. Second, the algebra of grades is decisive: different semirings, lattices, or actions yield materially different modal behavior. Third, multi-modal and multi-fragment systems are increasingly central, because a single indexed necessity often does not suffice once one combines dependency, provenance, and resource control. Finally, the theory is converging on two complementary ambitions: richer formal metatheory on the dependent side, and broader semantic unification across modal, coeffectful, categorical, and quantitative perspectives (Moon et al., 2020, Vollmer et al., 2024, Abel et al., 31 Mar 2026).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Graded Modal Type Theory.