Skip to content

Lesson 04 · Meaning

Algebras: Semantics of Composition

Explain how an algebra over an operad assigns meaning so composition of syntax equals composition of meaning.

~14 min Semantics and Applications
operad-algebrasyntax-semanticsfunctoriality-as-compositionality

Syntax is not enough

An operad says how pieces may be wired. An algebra says what the pieces mean. Compositionality becomes a theorem-shaped guarantee: the meaning of a nested diagram is the nested combination of the meanings of its parts — not a separate ad-hoc interpretation.

Syntax map vs semantic map

Syntax → semantics

Operad (syntax)

θ ∘ (θ₁, θ₂)

Nested wiring / multi-ary operation tree

α

Algebra (meaning)

α(θ)∘(α(θ₁),α(θ₂))

Maps, relations, processes on the same arities

Compositionality is exactly the square: interpret-then-compose equals compose-then-interpret.

From diagram to meaning

Start with syntax

A nested wiring diagram (operad element).

Choosing a semantics

Do you need executable behavior or only constraints?

Functoriality is the engineer’s checklist item

When someone says a toolchain is compositional, demand the algebra: what is X, what does each box mean as a map Xⁿ → X (or relation, or process), and where is the proof or test that nesting diagrams nests meanings? Without that, “compositional” is branding.

Check yourself

Retrieval practice — feedback explains why.

Q1An algebra over an operad primarily supplies:
Q2The equation α(θ ∘ θᵢ) = α(θ) ∘ α(θᵢ) expresses:
Q3In the Rel algebra on wiring diagrams, boxes are interpreted as:

Explain it back

For a wiring diagram you care about, name two different algebras (e.g. behavior vs cost vs latency). Do both respect the same composition law?

Sources · claim ledger

  • An operad encodes families of n-ary operations together with composition along trees, a unit 1-ary operation, and (for symmetric operads) permutation actions compatible with composition.

    Operad — Wikipedia (Boardman–Vogt 1968; May 1972) · verified 2026-07-28

  • The algebra Rel of mathematical relations on the wiring-diagram operad lets wiring diagrams structure relational database queries; circuit diagrams appear as a special case.

    Spivak, The operad of wiring diagrams · verified 2026-07-28

  • Compositionality requires that the meaning of a composite system is determined by the meanings of its parts and the way they are composed — formalized when semantics is an algebra over a composition operad.

    Spivak wiring diagrams + standard categorical usage · verified 2026-07-28

  • Classical applications of operads include characterizing iterated loop spaces and encoding algebraic structures (e.g. algebras over the Lie operad are Lie algebras).

    Operad — Wikipedia · verified 2026-07-28