Uniformly Traced Distributive Copy-Discard Categories
- The paper introduces a unified categorical framework combining copying, discarding, and trace with fixpoint operators to model imperative computation.
- It employs uniformly traced distributive multicategories integrating symmetric premonoidal composition and finite coproducts to derive various program logics.
- The framework models imperative constructs such as variable handling, control flow, and loop invariants, linking abstract theory with practical semantic models.
Searching arXiv for the specified paper and closely related context. Searching arXiv for "(Bonchi et al., 24 Jul 2025) Program Logics via Distributive Monoidal Categories" Uniformly traced distributive copy-discard categories are the categorical structures called imperative categories in "Program Logics via Distributive Monoidal Categories" (Bonchi et al., 24 Jul 2025). They are presented as a foundation for imperative computation and for deriving multiple program logics, including correctness, incorrectness, and relational Hoare logic, from a common algebraic base. In the paper’s formulation, the multicategorical core is a uniformly traced distributive multicategory equipped with copy-discard structure on unary morphisms; an imperative category is then an imperative multicategory with representable coproducts. The structure combines symmetric (pre)monoidal composition, finite coproducts and distributivity, cocommutative comonoids for copying and discarding, and a trace presented as a fixpoint operator. The resulting package is used to model variables, control flow, iteration, and loop invariants within a single denotational and proof-theoretic framework (Bonchi et al., 24 Jul 2025).
1. Base categorical structure
The paper works in the setting of strict symmetric premonoidal and monoidal categories. A strict premonoidal category is a category equipped with a sesquifunctor and a unit object such that, on objects,
and on morphisms the tensor is separately associative and unital:
A morphism is central if for any the interchange axiom holds:
0
A monoidal category is a premonoidal category in which all morphisms are central, and a symmetric premonoidal category has symmetries 1 satisfying the usual coherence equations.
This distinction between monoidal and premonoidal structure is operationally important in the paper. The internal language includes an interchange axiom that axiomatizes centrality on terms; with interchange one recovers monoidality, while dropping interchange models premonoidal effects. This gives the framework a direct connection to effect-sensitive semantics without altering the basic treatment of copying, branching, and looping.
2. Copy-discard and distributive structure
A copy-discard premonoidal category is a symmetric premonoidal category in which each object 2 carries a compatible and central cocommutative comonoid structure, given by a copy morphism 3 and a discard morphism 4. These satisfy coassociativity,
5
cocommutativity,
6
and counitality,
7
They are also compatible with tensor and unit:
8
9
The paper defines a morphism 0 to be deterministic if it preserves copying,
1
and total if it preserves discarding,
2
These notions are used directly in the assignment and guard rules of the derived program logics.
A distributive copy-discard category is then a copy-discard category 3 with chosen finite coproducts, binary 4 and nullary 5, such that the canonical distributors are natural isomorphisms:
6
7
The paper assumes the natural coherence associated with Laplaza-style distributivity, and uses both binary coproducts and unbiased finite coproducts 8 with injections 9 and case maps.
Under the paper’s assumptions, copy and discard are compatible with coproducts. Writing 0 for codiagonal, the paper gives:
1
and
2
It also records an inverse-distributor identity ensuring coherent interaction between tensor, coproduct, and copying. In particular, the structure maps of coproducts are total and deterministic (Bonchi et al., 24 Jul 2025).
The paper explicitly motivates this combination of axioms as a semantics of imperative computation. Copy-discard provides “variable wires,” distributivity and finite coproducts model guards and case analysis, and the distinction between deterministic and total morphisms gives precise hypotheses for assignment and branching principles.
3. Trace, fixpoint, and uniformity
The traced component is formulated multicategorically. Standard traced monoidal structure is recalled through a family
3
satisfying dinaturality, superposing, yanking, and vanishing. In the paper, however, trace is presented through a fixpoint operator on a traced distributive multicategory:
4
Its axioms are:
- morphism naturality:
5
- action naturality:
6
- strength:
7
- duplication:
8
- dinaturality:
9
These axioms encode the usual trace laws in the multicategorical setting. The paper states that yanking and superposing correspond to instances of strength and duplication, dinaturality is the sliding axiom, and vanishing corresponds to special cases of fix with units and empties under representability.
The distinctive additional principle is uniformity. A uniformly traced distributive multicategory, also called an Elgot multicategory in the paper, requires that if
0
then
1
The posetal form strengthens this to forward and backward inequalities: if the premise holds with 2, then the conclusion holds with 3, and if the premise holds with 4, then the conclusion holds with 5.
This posetal uniformity is central to the program-logic applications. The paper states that uniformity formalizes the proof principle that invariance under one unfolding step extends to invariance under the whole loop. In monoidal-categorical terms, its posetal version coincides with Hasegawa’s notion, expressed through the implication that existence of 6 such that
7
implies
8
with a dual formulation for the converse inequality (Bonchi et al., 24 Jul 2025).
4. Internal language and imperative constructs
The paper introduces an internal language for imperative multicategories. Its terms denote morphisms of the free traced distributive copy-discard multicategory, and its types are normalized polynomials, that is, sums of tensors of basic types. A context is written
9
and an index
0
where each label 1 names an exit together with its vector of variable types.
The primitive constructors are return, generator, and loop. Return takes a label in the index and variables in the context and forms a term 2. Generator applies a signature symbol
3
to input variables, together with branch terms. Loop introduces a label and binds variables: if 4, then
5
Three groups of equations organize the language. First, the interchange axiom expresses centrality of independent computations and recovers monoidality from premonoidal structure. Second, the loop axioms express dinaturality, diagonal behavior, and uniformity syntactically. Third, a fixpoint rule states that looping is a fixpoint for label substitution: if 6, then
7
On top of this language, the paper derives combinators for guards, predicates, commands, and states. Guards 8 include left and right constants, negation, conjunction, disjunction, and a branch operator
9
Predicates 0 include
1
together with conjunction, conditional combination 2, and the predicate associated to a guard,
3
Commands 4 include skip, composition, assert, abort, assignment, generator assignment, conditional, and while. The key derived command forms are:
5
6
7
8
9
and
0
The paper records the loop unfolding equation
1
which is used repeatedly in the derived logics (Bonchi et al., 24 Jul 2025).
The denotational semantics theorem interprets every generator and term in any imperative multicategory using normalized coproducts and coactions of labels. Return uses finite-set opposite maps 2 built from copy-discard structure, generator semantics threads inputs via 3 and distributes branches via coactions, and loop semantics uses fixpoint to thread updated and non-updated variables. The paper states that this semantics is sound with respect to the language axioms and complete via the syntactic model.
5. Program logics derived from the axioms
The paper defines validity of triples through inequalities in the poset structure of a posetal imperative category. The basic forms are:
- state correctness: 4;
- predicate correctness: 5;
- assertion correctness: 6;
together with their incorrectness variants obtained by replacing 7 with 8.
For Hoare logic, the paper proves that in any posetal imperative category with 9 and 0 for all 1, the following rules are valid: skip, composition, assignment for deterministic and total expressions, choice, loop, unroll, deterministic-guard if-else, deterministic-guard while, monotonicity, conjunction, fail, assert-then, top, and bottom. The loop principle is especially direct: from
2
infer
3
For deterministic guards, the paper also derives
4
The stated proof ingredients are interchange of predicates and guards, determinism and totality of guards, the definitions of predicates and commands, and posetal uniformity, which discharges loop invariants.
For incorrectness logic, valid rules include skip, composition, composition(error), assignment, non-deterministic assignment via sample, branch rules for the two sides of conditionals, convexity for constant guards, iteration rules, monotonicity, assert, fail, and bottom. The paper explicitly gives:
5
and the iteration step
6
For outcome-like logic, the paper proves analogous rules for predicates: skip, composition, deterministic assignment, sample, unroll, choice under total guards, if-else under total and deterministic guards, an assert rule, convexity for constant guards, monotonicity, and bottom.
The framework also yields relational program logics through couplings. A coupling of 7 and 8 is a morphism
9
such that
0
Strong couplings are those whose image lies in the first summand, and synchronization is obtained by following 1 with the map to that summand. A relational assertion-correctness triple 2 holds if there is a coupling with
3
The paper derives relational Hoare logic rules for skip, composition, assignment, choice, if-else, loop, monotonicity, symmetry, and one-sided rules; it also gives a relational predicate-incorrectness logic formulated with 4 (Bonchi et al., 24 Jul 2025).
6. Models, semantics, and research context
The paper gives several concrete models:
- Set with the maybe monad: 5;
- Set with the powerset monad: 6;
- Set with the discrete subdistribution monad;
- Standard Borel spaces with the measurable subdistribution monad.
These are described as commutative strong monads over cartesian, hence copy-discard, base categories, yielding distributive (pre)monoidal Kleisli categories. Under partial additivity and 7-enrichment assumptions, the Kleisli categories have a uniform trace on coproducts by Jacobs’ theorem. The paper then proves posetal uniformity by adapting Hasuo’s generic trace theory: lax and oplax coalgebra morphisms yield the forward and backward inequalities, and therefore the trace is posetally uniform. Consequently, these Kleisli categories are posetal imperative categories.
The paper’s stated version of Jacobs’ theorem is: if 8 has countable coproducts, 9 is a partially additive monad, the Kleisli category 00 is 01-enriched, and cotuplings are monotone, then 02 has a uniform trace on its coproduct monoidal structure. Combined with commutative strength, this yields imperative categories. This places the abstract axioms in direct contact with standard semantic settings for partiality, relations, and probability.
The paper also provides string-diagram intuition. Return labels are coproduct injections, generator semantics is case analysis, and loop semantics is described through a fixpoint with a coalgebra to a final coalgebra 03, so that
04
capturing “unfolding until exit.” Yanking, sliding, and superposing correspond to loop axioms; distributivity is depicted by wiring boxes across sums; and copy-discard appears as splitters and terminations for variable wires.
In relation to prior work, the paper places its fixpoint axioms in the lineage of Joyal–Street–Verity traced monoidal categories, extending Hasegawa-style uniformity to a posetal multicategorical setting. Its use of distributive categories relies on classical coherence in the sense of Laplaza. Its multicategorical presentation is aligned with cocartesian multicategories and colored Lawvere theories as used by Hermida, Curien, and Cartwright. Its treatment of premonoidal structure connects with Freyd-category and control semantics associated with Power, Robinson, Levy, and Heunen. The distinction between guards and predicates is explicitly compared with effectus theory, and the iteration principles are linked to Elgot and Arbib–Manes traced cocartesian semantics. A plausible implication is that the framework is designed as a unifying algebraic interface across relational, partial, and stochastic semantics while preserving the distinctions between guards and predicates and between correctness and incorrectness reasoning (Bonchi et al., 24 Jul 2025).