Skip to content

Lesson 03 · Syntax

Wiring Diagrams & Hierarchical Open Systems

Read and nest wiring diagrams as morphisms of an operad of open systems (Spivak).

~14 min Operads as Composition Laws
wiring-diagramportsnestingoperad-of-diagrams

Pictures that are mathematics

Wiring diagrams are not decoration. In Spivak’s framework they are the morphisms of an operad: an outer interface, inner boxes with their own interfaces, and wires that identify ports. Nesting a diagram inside a box is operadic composition.

Interactive wiring diagram

Open system · wiring diagram

Wiring diagram with ports and optional nestingouter system Xin₀in₁outAB (nested)B₁B₂

Outer ports are the interface of X. Filling boxes is operadic composition: B itself is a diagram of B₁ and B₂.

From flat glue to hierarchical nesting

Many boxes, one spaghetti of wires — hard to reuse.

Wiring diagrams vs informal architecture sketches

Informal sketch

  • Boxes mean “components” loosely
  • Wires untyped
  • Nesting is a PowerPoint layer
  • Reuse by copy-paste

Wiring operad

  • Boxes are open systems with ports
  • Wires are typed equalities/flows
  • Nesting is composition in T
  • Reuse by substitution

Ports are typed names

A port is a named, typed locus on a boundary — voltage terminal, HTTP channel, SQL relation sort, agent mailbox. Wires assert equalities (or directed flows) between ports. Illegal wires (type mismatch, wrong direction) are rejected at the syntax layer, before any semantics is chosen.

Draw a legal nesting

  1. 01Draw the outer boundary and label its ports.
  2. 02Place inner boxes; label each box’s ports.
  3. 03Wire internal ports to each other or to the outer boundary.
  4. 04Confirm every wire respects types and directions.
  5. 05Treat the filled outer box as a single operation ready to nest inside a larger diagram.

Check yourself

Retrieval practice — feedback explains why.

Q1In Spivak’s operad of wiring diagrams, composition corresponds to:
Q2A port is best described as:
Q3Why can illegal wires be caught before choosing semantics?

Explain it back

Sketch a wiring diagram for a system you own: outer box, inner boxes, ports, and wires. Where does hierarchy currently live only in docs?

Sources · claim ledger