Block-diagram comparison: SysML Internal Block Diagram → categorical wiring diagram (wall + roof)

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”

1) “Standard” SysML-style Internal Block Diagram (IBD)

ibd [block] ConstructWeatherproofShell Parts (tasks) with flow ports; connectors carry item flows Sand (S) Cement (C) Water (W) Bricks (B) Pegs+Line (P) Drawing (D) Roof trusses (T) Shell (SH) mix : MixMortar in: S, C, W out: Mortar (M) set : SetOutLine in: P, D out: Line (L) wall : BuildWall in: B, M, L out: Walls (WL) roof : InstallRoof in: WL, T out: Shell (SH) Mortar (M) Trusses (T) Line (L) Walls (WL)

This is a SysML internal block diagram style: the enclosing block contains parts (tasks) with ports, connected by item flows.

2) Categorical wiring diagram view (string diagram)

Wiring diagram (SMC string diagram) Boxes are morphisms; wires are typed interfaces (objects) mix S ⊗ C ⊗ W → M set P ⊗ D → L wall B ⊗ M ⊗ L → WL roof WL ⊗ T → SH S C W P D B T M T L WL SH

Same structure, different status: in the categorical view the picture is a compositional term in a symmetric monoidal category.

3) Mapping: SysML → categorical wiring diagram

SysML block-diagram ideaCategorical wiring-diagram ideaWhy 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).
Type-check status will appear here.

4) Formalism for this particular diagram

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.

5) Tiny semantics demo: compositional schedule, cost, and traceability

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
Total duration (mix ∥ set)
—
Total duration (all sequential)
—
Total cost
—
Trace union
—