Papers
Topics
Authors
Recent
Search
2000 character limit reached

Imperative Multicategories

Updated 7 July 2026
  • Imperative multicategories are multicategorical formalisms that algebraically embed evaluation order, copying, and feedback to model effectful computation.
  • They integrate structural laws like copy–discard, distributivity, and trace, which correspond to imperative programming constructs such as variable management, branching, and looping.
  • The framework supports an internal language that uniformly derives program logics, enabling precise reasoning about correctness and sequential effects in computations.

Searching arXiv for recent and foundational papers on imperative multicategories, effect categories, and related multicategorical semantics. arXiv search query: "imperative multicategories distributive monoidal categories effect categories sequential products Freyd operads" Imperative multicategories are multicategorical formalisms for effectful and imperative computation in which evaluation order, copying and discarding of data, distributivity, and feedback are treated as explicit algebraic structure rather than as secondary meta-level conventions. In "Program Logics via Distributive Monoidal Categories" (Bonchi et al., 24 Jul 2025), an imperative multicategory is a uniformly traced, distributive, copy–discard multicategory, and it supports an internal language from which correctness, incorrectness, and relational Hoare logics are derived. A historically earlier construction appears in "Sequential products in effect categories" (0707.1432), where a cartesian effect category with sequential products induces a multicategory of effectful computations that evaluates arguments in left-to-right order.

1. Formal characterization

A multicategory M\mathcal M consists of a class of objects Obj(M)Obj(\mathcal M), sets of multimorphisms M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n), identities idXM(X;X)id_X\in\mathcal M(X;X), and composition

fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),

satisfying the usual unit and associativity laws. In the imperative setting of (Bonchi et al., 24 Jul 2025), this structure is equipped with cocartesian structure on indices, a strict symmetric monoid (,I)(\otimes,I) on objects, copy–discard structure, and a trace or fixpoint operator.

The cocartesian structure is given by an action

σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)

for each function σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}, subject to functoriality and compatibility with composition. The monoidal structure is distributive in the sense that for fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n) and gM(X;Z1,,Zm)g\in\mathcal M(X';Z_1,\dots,Z_m) one has

Obj(M)Obj(\mathcal M)0

Every object Obj(M)Obj(\mathcal M)1 carries a central cocommutative comonoid

Obj(M)Obj(\mathcal M)2

satisfying coassociativity, counitality, cocommutativity, and compatibility with Obj(M)Obj(\mathcal M)3 and Obj(M)Obj(\mathcal M)4. A morphism Obj(M)Obj(\mathcal M)5 is central if

Obj(M)Obj(\mathcal M)6

for all Obj(M)Obj(\mathcal M)7. A traced distributive multicategory carries

Obj(M)Obj(\mathcal M)8

satisfying dinaturality, diagonal, and uniformity. An imperative multicategory is precisely a uniformly traced, distributive, copy–discard multicategory (Bonchi et al., 24 Jul 2025).

This definition makes imperative phenomena algebraic at the level of multimorphisms. The resulting framework is not restricted to a single effect discipline; rather, it is designed so that the same axioms support multiple program logics and multiple semantic universes.

2. Structural laws and their computational reading

The copy–discard laws encode the usual ability of imperative programs to duplicate and ignore data: Obj(M)Obj(\mathcal M)9 Because these comonoids are central, the framework isolates when structural manipulations commute with computational content and when they do not.

Distributivity expresses the interaction of tensor with coproduct-style branching. In binary form, (Bonchi et al., 24 Jul 2025) writes

M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)0

This is the categorical basis for conditional control flow and guarded choice.

The trace component supplies feedback and looping. In the same source, the trace axioms are presented as Conway-style laws plus uniformity. For M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)1, one defines M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)2, and dinaturality, diagonal, and uniformity regulate how loops behave under reindexing, duplication, and simulation. The paper also formulates these laws through the fixpoint operator on multimorphisms, again with dinaturality, diagonal, and uniformity as the key principles (Bonchi et al., 24 Jul 2025).

These laws are significant because they recover standard imperative control constructs from a compact categorical core. In particular, copy–discard governs variable usage, distributivity governs branching, and trace governs iteration. A plausible implication is that imperative multicategories isolate exactly the categorical structure needed to derive a wide range of proof rules without introducing a separate axiom system for each logic.

3. Internal language

The internal language of (Bonchi et al., 24 Jul 2025) is parameterized by a distributive signature M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)3. Its generators

M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)4

represent a multimorphism

M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)5

Variables M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)6 range over a countable set M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)7, labels M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)8 over a countable set M(X;Y1,,Yn)\mathcal M(X;Y_1,\dots,Y_n)9, a context is

idXM(X;X)id_X\in\mathcal M(X;X)0

and an index is

idXM(X;X)id_X\in\mathcal M(X;X)1

Term formation is organized by three primitive rules. The Return rule produces

idXM(X;X)id_X\in\mathcal M(X;X)2

The Generator rule forms

idXM(X;X)id_X\in\mathcal M(X;X)3

The Loop rule forms

idXM(X;X)id_X\in\mathcal M(X;X)4

Among the key derived operations are substitution of variables and labels, the interchange axiom

idXM(X;X)id_X\in\mathcal M(X;X)5

and loop axioms matching the categorical trace laws (Bonchi et al., 24 Jul 2025).

Denotational semantics extends an assignment of idXM(X;X)id_X\in\mathcal M(X;X)6 to an imperative multicategory idXM(X;X)id_X\in\mathcal M(X;X)7 to a unique interpretation

idXM(X;X)id_X\in\mathcal M(X;X)8

Under this interpretation, Return is sent to the coproduct injection, Gen to a composite involving idXM(X;X)id_X\in\mathcal M(X;X)9, and Loop to the trace of a map built from fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),0 and fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),1 (Bonchi et al., 24 Jul 2025).

The internal language matters because it is not merely a notation for existing categorical maps. It is the syntactic vehicle through which proof rules, guarded-command combinators, and semantic soundness are derived uniformly from the axioms.

4. Guarded commands and program logics

On top of the internal language, (Bonchi et al., 24 Jul 2025) derives combinators for an adaptation of Dijkstra’s guarded command language. For a guard fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),2, the paper lists

fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),3

For predicates fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),4, it lists

fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),5

together with substitution. Commands fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),6 include

fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),7

as well as variable assignment and generator assignment. States fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),8 include fM(X;Y1,,Yn),giM(Yi;Zi1,,Zimi)    f(g1,,gn)M(X;Z11,,Znmn),f\in\mathcal M(X;Y_1,\dots,Y_n),\qquad g_i\in\mathcal M(Y_i;Z_{i1},\dots,Z_{im_i}) \;\mapsto\; f\mathbin{\boxdot}(g_1,\dots,g_n)\in\mathcal M(X;Z_{11},\dots,Z_{nm_n}),9, (,I)(\otimes,I)0, (,I)(\otimes,I)1, (,I)(\otimes,I)2, cosubstitution, and mute.

Correctness triples are defined by

(,I)(\otimes,I)3

Incorrectness triples are defined by

(,I)(\otimes,I)4

Relational correctness is defined by the existence of a coupling

(,I)(\otimes,I)5

such that

(,I)(\otimes,I)6

and moreover

(,I)(\otimes,I)7

Relational incorrectness uses (,I)(\otimes,I)8 in place of (,I)(\otimes,I)9 (Bonchi et al., 24 Jul 2025).

The inference rules recovered in this setting include the standard rules for σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)0, composition, assignment, conditionals, while loops, monotonicity, and symmetry. In the Kleisli category of the partial-function monad on σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)1, σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)2, the paper identifies σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)3 with σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)4, interprets conditionals via coproduct case plus distributivity, and interprets

σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)5

as a trace of a map σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)6, yielding the standard loop-invariant rule (Bonchi et al., 24 Jul 2025).

A common misunderstanding is that the program-logical content must be added externally to the category. Here the rules are derived from the internal language and the axioms of the imperative multicategory itself.

5. Sequential products and the induced multicategory of effectful computations

A foundational precursor is the framework of effect categories in (0707.1432). There, σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)7 is a cartesian weak category of pure arrows, σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)8 is a larger weak category of effectful arrows containing σ:M(X;Yσ(1),,Yσ(m))M(X;Y1,,Yn)\sigma^\star : \mathcal M(X;Y_{\sigma(1)},\dots,Y_{\sigma(m)}) \to \mathcal M(X;Y_1,\dots,Y_n)9 as a wide subcategory, strong equations σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}0 form a congruence on σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}1, and semi-equations σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}2 form a preorder satisfying transitivity, substitution, and replacement by pure post-composition. The effect category is required to extend the cartesian structure of σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}3 through semi-terminal objects and semi-products.

For σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}4 and pure σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}5, the semi-product

σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}6

is characterized by

σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}7

Because identities are pure, one may define the left sequential product

σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}8

This operation satisfies unit laws up to σ:{1,,m}{1,,n}\sigma:\{1,\dots,m\}\to\{1,\dots,n\}9, associativity up to the canonical associator, and compatibility with swap or braiding (0707.1432).

From this structure one builds an induced multicategory. Its objects are those of fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)0, and an fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)1-ary arrow

fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)2

is represented by a fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)3-arrow

fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)4

built by iterating left sequential products and then projecting out the final result. Composition is defined by sequential composition in fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)5, padded by identities and rebracketing maps. The resulting multicategory is associative and unital up to the congruence fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)6 (0707.1432).

The concrete examples in the same source are partiality and global state. For partiality, fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)7 and fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)8 with the usual domain-inclusion preorder; the sequential product runs the left component first and diverges if that component diverges. For global state, fM(X;Y1,,Yn)f\in\mathcal M(X;Y_1,\dots,Y_n)9 consists of maps gM(X;Z1,,Zm)g\in\mathcal M(X';Z_1,\dots,Z_m)0, pure maps are lifted state-preserving functions, and the sequential product threads state from left to right. These examples make explicit that the multicategory is not merely many-input syntax: it is an algebra of ordered effectful evaluation.

The literature considered here presents two closely related emphases. In (Bonchi et al., 24 Jul 2025), multimorphisms are written in the form

gM(X;Z1,,Zm)g\in\mathcal M(X';Z_1,\dots,Z_m)1

with trace, distributivity, and copy–discard as primitive categorical structure. In (0707.1432), the induced multicategory is presented in the more familiar orientation

gM(X;Z1,,Zm)g\in\mathcal M(X';Z_1,\dots,Z_m)2

where the key primitive is the left sequential product. This suggests that “imperative multicategory” names a family of multicategorical formalisms whose common concern is ordered effectful composition rather than a single fixed variance convention.

A further related development is the one-object Freyd-multicategorical semantics of "Multicategorical Semantics for Untyped Effects" (Grunfeld et al., 20 May 2026). That work addresses the fact that, for untyped effectful call-by-value languages, “there is no canonical notion of simultaneous substitution of computations, since evaluation order is semantically meaningful.” It therefore takes single computation substitutions, that is, binding steps, as primitive, represents computation substitution by finite sequential lists composed by concatenation, and formalizes the construction via Freyd operads and their substitution PROPs. The paper proves representability, a left adjoint to restriction to codomain gM(X;Z1,,Zm)g\in\mathcal M(X';Z_1,\dots,Z_m)3, and soundness, initiality, and completeness for untyped computational lambda-calculus with procedures and higher-order functions (Grunfeld et al., 20 May 2026).

The comparison with monads is stated explicitly in that work: a strong monad on a CCC gives a one-sorted Freyd category but still enforces simultaneous substitution in the Kleisli category, collapsing order, whereas the multicategorical approach separates pure values from effectful computations and retains sequential substitution as primitive (Grunfeld et al., 20 May 2026). Read together with (0707.1432) and (Bonchi et al., 24 Jul 2025), this places imperative multicategories within a broader categorical program in which sequencing is not reconstructed from ordinary cartesian structure but built into the semantic core.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (3)

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 Imperative Multicategories.