The correspondence between monoidal categories and graphical languages of diagrams has been studied extensively, leading to applications in quantum computing and communication, systems theory, circuit design and more. From the categorical perspective, diagrams can be specified using (name-free) combinators which enjoy elegant equational properties. However, conventional notations for diagrammatic structures, such as hardware description languages (VHDL, VERILOG) or graph languages (DOT), use a different style, which is flat, relational, and reliant on extensive use of names (labels). Such languages are not known to enjoy nice syntactic equational properties. However, since they make it relatively easy to specify (and modify) arbitrary diagrammatic structures they are more popular than the combinator style. In this paper we show how the two approaches to diagram syntax can be reconciled and unified in a way that does not change the semantics and the existing equational theory. Additionally, we give sound and complete equational theories for the combined syntax.
Specifying graphsGraphs and their visual representations (diagrams) are an appealing way of describing many kinds of systems, in particular circuits. Work originated in the study of quantum computation [1] has exploited the connection between various classes of graphs and monoidal categories, going back to the seminal work of Joyal and Street [14], to add a layer of structure which makes reasoning about and with diagrams not just intuitive but also mathematically rigorous. Subsequently this connection was extended in many surprising and interesting directions, from computational linguistics [17], to modelling signal flow [4] and synchronous [9] or asynchronous [8] circuits. New automated reasoning tools based on diagrams, rather than the usual linear algebraic syntax, are a particularly exciting development (see http://globular.science/). This convenient and elegant interplay between the dual categorical and diagrammatic methods are by now a mature and rich area of research [18].Although these developments convincingly establish the usefulness of categorical diagrammatics in reasoning about many kinds of systems, we note that little has been suggested in terms of a workable syntax which is conceptually compatible with it, but also with conventional notations, which are unstructured and relational. Examples of the latter are hardware description languages such as VERILOG and VHDL, or graph languages such as DOT (see http://www.graphviz.org/). Indeed, in the literature the categorical combinators are usually taken as an implicit diagram syntax. Whereas such a syntax is expressive enough to describe the desired classes of graphs, it is often not as convenient as the alternatives. Although categorical combinators can be elegant and succinct in certain situation, point-free languages of combinators generally hold little appeal as concrete syntax (e.g. APL).Conventional diagram syntax lacks structure. It is a "flat" relational description of the graph. Whereas th...