Reference. Rendering string diagrams recursively
String diagrams are a graphical language used to represent processes that can be composed sequentially or in parallel, which correspond graphically to horizontal or vertical juxtaposition. In this paper we demonstrate how to compute the layout of a string diagram by folding over its algebraic representation in terms of sequential and parallel composition operators. The algebraic representation can be seen as a term of a free monoidal category or a proof tree for a small fragment of linear logic. This contrasts to existing non-compositional approaches that use graph layout techniques. The key innovation is storing the diagrams in binary space-partition trees, maintaining a right-trapezoidal shape for the diagram’s outline as an invariant. We provide an implementation in Haskell, using an existing denotational graphics library called Diagrams. Our renderer also supports adding semantics to diagrams to serve as a compiler, with matrix algebra used as an example.
Cite
Cites 14 works (1 here)
With notes (1)
Compositional Game Theory ghani-2018-compositional
External (13)
- Categorical Foundations of Gradient-Based Learning (2021)
- DisCoPy: Monoidal Categories in Python (2020)
- Foundations of brick diagrams (2019)
- A synthetic approach to Markov kernels, conditional independence, and theorems on sufficient statistics (2019)
- Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning (2017)
- The algebra of open and interconnected systems (2016)
- Interacting Bialgebras Are Frobenius (2014)
- Mathematical Foundations for a Compositional Distributional Model of Meaning (2010)
- A Survey of Graphical Languages for Monoidal Categories (2009)
- Characterizing tileorders (1993)
- The geometry of tensor calculus, I (1991)
- Rendering string diagrams with Haskell’s Diagrams library
- Diagrams library manual