English

The compact double category $\mathbf{Int}(\mathbf{Poly}_*)$ models control flow and data transformations

Category Theory 2025-09-09 v1 Programming Languages

Abstract

Hasegawa showed that control flow in programming languages -- while loops and if-then-else statements -- can be modeled using traced cocartesian categories, such as the category Set\mathbf{Set}_* of pointed sets. In this paper we define an operad W\mathscr{W} of wiring diagrams that provides syntax for categories whose control flow moreover includes data transformations, including deleting, duplicating, permuting, and applying pre-specified functions to variables. In the most basic version, the operad underlies Int(Poly)\mathbf{Int}(\mathbf{Poly}_*), where Int(T)\mathbf{Int}(\mathscr{T}) denotes the free compact category on a traced category T\mathscr{T}, as defined by Joyal, Street, and Verity; to do so, we show that Poly\mathbf{Poly}_*, as well as any multivariate version of it, is traced. We show moreover that whenever T\mathscr{T} is uniform -- a condition also defined by Hasegawa and satisfied by Int(T)\mathbf{Int}(\mathscr{T}) -- the resulting Int\mathbf{Int}-construction extends to a double category Int(T)\mathbb{I}\mathbf{nt}(\mathscr{T}), which is compact in the sense of Patterson. Finally, we define a universal property of the double category Int(Poly)\mathbb{I}\mathbf{nt}(\mathbf{Poly}_*) and Int(Set)\mathbb{I}\mathbf{nt}(\mathbf{Set}_*) by which one can track trajectories as they move through the control flow associated to a wiring diagram.

Cite

@article{arxiv.2509.05462,
  title  = {The compact double category $\mathbf{Int}(\mathbf{Poly}_*)$ models control flow and data transformations},
  author = {Grigory Kondyrev and David I. Spivak},
  journal= {arXiv preprint arXiv:2509.05462},
  year   = {2025}
}

Comments

28 pages including many diagrams

R2 v1 2026-07-01T05:23:49.864Z