The SysML view (left) and the categorical wiring-diagram view (right) look similar on purpose: both are “boxes and wires”. This is the key observation emphasised in the Semantics of Cyber-Physical Systems paper: wiring diagrams deliberately resemble engineering block diagrams (e.g. SysML), but add formal compositional semantics. The difference is that the wiring diagram is not just a picture — it is a compositional syntax with a precise semantics.
tap/click a block or wire to highlight the correspondence
toggle Introduce a type error to see what formal checking catches
edit durations/costs to see a tiny “algebra on the diagram”
This is a SysML internal block diagram style: the enclosing block contains parts (tasks) with ports, connected by item flows.
Same structure, different status: in the categorical view the picture is a compositional term in a symmetric monoidal category.
| SysML block-diagram idea | Categorical wiring-diagram idea | Why it matters |
|---|---|---|
| Part (block inside an IBD) | Box / morphism with a typed interface | Each task becomes a well-typed component you can compose. |
| Ports / flow ports (what can flow in/out) | Wires typed by objects (e.g. M, WL) |
Type information can be checked automatically; mismatches are explicit. |
| Connectors + item flow annotations | Wiring (the syntax that defines composition) | The interconnection itself is a first-class object you can reason about. |
| “System of parts” (enclosing block) | Composite morphism obtained by ∘ and ⊗ | The whole is determined by its parts and their wiring (compositionality). |
Take the wire labels as objects in a symmetric monoidal category, and the tasks as morphisms. The full construction is then a single composite morphism built from ⊗ (parallel) and ∘ (series).
Objects (types): S, C, W, P, D, B, T, M, L, WL, SH Generating morphisms (tasks): mix : S ⊗ C ⊗ W → M set : P ⊗ D → L wall : B ⊗ M ⊗ L → WL roof : WL ⊗ T → SH Composite (read from the rightmost box “roof” back to the inputs): buildShell : S ⊗ C ⊗ W ⊗ P ⊗ D ⊗ B ⊗ T → SH buildShell = roof ∘ (wall ⊗ id_T) ∘ (id_B ⊗ mix ⊗ set ⊗ id_T) ∘ σ where σ is the symmetry (wire-reordering) that routes the input bundle to the right boxes.
In practice, you rarely need to write σ by hand: it is precisely what the wiring diagram picture records.
A categorical “semantics” assigns meaning to each box, then computes the meaning of the whole by composition. Below is a toy example: edit numbers/tags and watch the composite update.
| Task (box) | Duration (days) | Cost (£) | Trace tags (comma-separated) |
|---|---|---|---|
mix — Mix mortar |
|||
set — Set out line |
|||
wall — Build wall |
|||
roof — Install roof |