Midnight.Passport.Semantics
Attaches semantics to the architecture diagram via the standard free category + interpretation functors recipe:
C_arch— the free strict monoidal category generated by the channelsArchChan(objects are wire lists over them) and the boxesArchBox(morphisms) of the architecture.architectureᶜis the architecture rebuilt in this category.- Syntax functor
syn : C_arch → FMTerm— the object-generator mapchanName : ArchChan → Stringtogether withsynBox, which sends each box to its namedgen. Because the objects differ (ArchChanvsString),syntransports alongchanName; it recovers thearchitectureterm verbatim. - Semantics generator data — each channel to a
Channeland eachArchBoxto aMachine. By the universal property of the free strict monoidal category this data induces a monoidal functorC_arch → Machineonce the Machine category is packaged as such.
The diagram below is the image of architectureᶜ under the syntax functor
(architectureˢ); it is rendered straight from that term — compiled to Graphviz
DOT and laid out by dot — so it cannot drift from the definitions on this page.
architectureˢ denotes.1. Object generators: the architecture's channels
The objects of C_arch are freely generated by the channel names, enumerated as
ArchChan: an object is a wire list over ArchChan, and the tensor is
concatenation (Var/_⊗₀_/unit are the same sugar FMTerm provides over
String).
2. Morphism generators: exactly the boxes of architecture
The morphism generators are the architecture's components — one ArchBox
constructor per box, indexed by its domain and codomain object-terms. Restricting
the generators to exactly these boxes is what makes C_arch the free category
of the architecture (rather than of arbitrary named morphisms).
3. architecture, rebuilt in C_arch
The architecture itself is a single morphism CHAIN → User in C_arch: the
blockchain enters at the bottom boundary (it is the environment's wire, read
by accountCustody), and three layers of boxes are composed left-to-right,
the CHAIN wire threading through the first.
4. Syntax functor C_arch → FMTerm
The object part is Φ = map chanName; the morphism part is synBox, sending
each box to the correspondingly-named gen. Since the two categories have
different object generators (ArchChan vs String), the functor syn
transports the object indices through chanName — the map-++ rewrites
discharge that chanName distributes over the tensor. architectureˢ is the
image of architectureᶜ; it is the term the diagram above is rendered from.
5. Semantics interpretation: generators → Machine
The semantics is given as generator data: a Channel per channel and a Machine
per box. A ChannelModel fixes the objects (and lifts them to the functor's
object map ⟦_⟧₀); a MachineModel fixes the machines and reads them off as the
morphism map ⟦_⟧₁ : ArchBox → Machine. Together they are the data of a
symmetric monoidal functor C_arch → Machine.