The Operad of Wiring Diagrams
David I. Spivak ยท 2013 ยท
arXiv:1305.0297
Prereqs: basic comfort with typed functions. ๐ Fritz 2020 helps but isn't required.
A wiring diagram is a box with typed input and output ports. Composing boxes means plugging outputs into inputs โ the types must match. This is the syntax layer: how components connect, before you decide what they compute.
Boxes and ports
A box has typed input ports and typed output ports. It's an interface specification โ no implementation yet. Think of a function signature without the body.
Boxes compose by wiring outputs to inputs. The types constrain which wirings are legal โ you can't plug a "type Z" output into a "type X" input. The composite is itself a box, with its own input and output ports. This is operadic composition: boxes all the way down.
Supplier assignment
Wiring a diagram means assigning a supplier to each input port. Every input must get its value from exactly one output port (or from an external input of the outer box). The assignment must respect types: a port of type T can only be wired to an output of type T.
Composing boxes
The operad operation: given an outer box with inner boxes wired together, collapse the inner structure into a single box. The composite box has the outer box's interface. The internal wiring is hidden โ encapsulation.
Operadic composition is associative
The key property: composing (A then B) then C gives the same wiring diagram as composing A then (B then C). The wiring diagram operad is a genuine operad โ composition is associative and there's an identity (the box that passes all ports through unchanged).
Notation reference
| Paper | Scheme | Meaning |
|---|---|---|
| X = (X_in, X_out) | (make-box name ins outs) | Box with typed ports |
| ฯ: Y_in โ X_out โ Z_in | supplier assignment | Wiring function |
| W(X; Yโ,โฆ,Yโ) | (compose-boxes ...) | Wiring diagram with n inner boxes |
| id_X | (lambda (x) x) | Identity box (pass-through) |
| โ | (pipe f g) | Operadic composition |
Neighbors
Other paper pages
- ๐ Fritz 2020 โ the semantics (Markov categories) that fills these boxes
- ๐ Capucci 2021 โ cybernetic lenses as wiring diagrams with feedback
- ๐ Hedges 2018 โ game theory via compositional diagrams
Foundations (Wikipedia)
Translation notes
The examples on this page use lists and symbols to represent typed ports and wiring. Spivak's paper works with operads in the category of typed finite sets โ the supplier assignment is a genuine function between coproducts. For example: the wiring diagram above connects two boxes with string labels. In the paper, the same construction uses typed finite sets with a function ฯ from inner input ports to the disjoint union of outer inputs and other boxes' outputs. The compositional structure is identical. The set-theoretic precision is not.
Every example is Simplified.
Read the paper. Start at ยง2 for the operad definition, ยง3 for propagation of properties through wiring.
Framework connection: The Natural Framework pipeline is a wiring diagram in Spivak's operad โ the operad gives the syntax of how stages connect, while Markov categories give the semantics. (
The Natural Framework)