Decorations and dependent decorations (Over) #
Spec.Decoration Γ spec is concrete nodewise metadata attached to a fixed
protocol tree spec, where Γ : Spec.Node.Context is the realized family of
node-local information. If a node of spec has move space X, then a
decoration provides one value of type Γ X at that node, and recursively
decorates every continuation subtree.
This is the basic way to say "the same protocol tree, but with extra data at each node". Typical examples include:
RoleDecoration, recording who controls a node;- monad decorations, recording which monad a local action uses at a node;
- oracle decorations, recording what oracle interface is available there.
A context may be written directly, or obtained from a telescope
Spec.Node.Schema via Spec.Node.Schema.toContext.
Decoration.Over is the dependent (displayed) variant:
its fibers may depend on the context value drawn from an existing decoration.
Naming note:
Decoration.Over is nested because it is literally a decoration over a fixed
base decoration value. By contrast, ShapeOver and InteractionOver keep the
suffix form because they are the primary generalized syntax and semantics
layers, not dependent objects over a fixed base Shape or Interaction.
Functorial map / map_id / map_comp for both layers are in this file.
Composition along Spec.append is in VCVio.Interaction.Basic.Append.
Because decorations are concrete tree data, they are covariant in node-local
contexts: a context morphism Γ → Δ induces a map from decorations by Γ
to decorations by Δ. The schema-facing API in Decoration.Schema packages
that same idea for realized contexts presented by schemas via
Spec.Node.Schema.SchemaMap.
This file also contains the bridge between the semantic and staged views of
node metadata: decorating a tree by an extended context Γ.extend A is
equivalent to giving a base decoration by Γ together with one dependent
Decoration.Over A layer on top of it.
In particular, if a schema is built as (Spec.Node.Schema.singleton Γ).extend A,
then Decoration.equivOver A spec is exactly the statement that a decoration
of that schema's realized context is the same as a base decoration by Γ
plus one displayed layer over it.
The file concludes by lifting this one-step bridge recursively to arbitrary
schemas: Spec.Decoration.Schema.View is the staged telescope view of a
decoration by S.toContext, and Spec.Decoration.Schema.equivView
identifies that staged view with an ordinary decoration of the realized
context.
Decoration Γ spec is concrete nodewise metadata on the fixed protocol
tree spec, for a realized node context Γ.
If a node of spec has move space X, then the decoration stores one value of
type Γ X at that node, and recursively stores decorations on every subtree.
This is different from Spec.SyntaxOver:
- a decoration is data on a tree;
- syntax is a specification of local participant objects that consumes such data;
Spec.ShapeOveris the functorial refinement of that syntax layer.
Instances For
Natural transformation between per-node decorations, applied recursively.
Instances For
Dependent decoration over d : Decoration Γ spec: at each node, data in
F X γ where γ is the context value from d, plus recursive decorations on
subtrees.
Instances For
Fiberwise map between dependent decoration families over the same base decoration.
Instances For
Transport a dependent decoration across a map of base contexts.
Given:
- a base-context morphism
f : Γ → Δ, and - a fiberwise map
gfromA X γtoB X (f X γ),
this sends a displayed decoration over d : Decoration Γ spec to a displayed
decoration over Decoration.map f spec d.
Instances For
Pack a base decoration and one dependent Over layer into a decoration of the
extended context Γ.extend A.
This is the tree-level realization of a single schema extension step.
Instances For
Unpack a decoration of the extended context Γ.extend A into:
- its base decoration by
Γ, and - its displayed
Decoration.Over Alayer above that base.
This is the inverse structural view to Decoration.ofOver.
Instances For
Equivalence between:
- decorating a tree by the extended context
Γ.extend A, and - decorating it by
Γtogether with oneDecoration.Over Alayer.
This is the main bridge from the semantic "single realized context" view to the staged schema/dependent-decoration view.
Concrete example:
if a schema is built as (Spec.Node.Schema.singleton Tag).extend Data, then
decorations of its realized context Node.Context.extend Tag Data are
equivalent to pairs consisting of:
tags : Decoration Tag spec, anddatas : Decoration.Over Data spec tags.
Instances For
Map decorations along a schema morphism.
This is just Decoration.map viewed through schema-level sources and targets.
Instances For
Decoration.Schema.telescope S spec packages the staged telescope view of
decorations for schema S, together with an equivalence from ordinary
decorations by the realized context S.toContext.
The resulting type is the recursively decomposed form of a decoration:
each snoc in the schema contributes one more displayed Decoration.Over
layer.
Instances For
Decoration.Schema.View S spec is the staged telescope view carried by the
recursive schema decomposition theorem Decoration.Schema.telescope.
Instances For
Unpack an ordinary decoration into the staged telescope view determined by a schema.
Instances For
Pack a staged schema-decoration view back into an ordinary decoration of the realized context.
Instances For
Map the staged telescope view of decorations along a schema morphism.
This is the schema-view analogue of Decoration.Schema.map: pack the staged
view into an ordinary decoration, map that decoration along the schema
morphism, then unpack it into the staged view for the target schema.
Instances For
Project decorations along a syntactic schema prefix.
This is the tree-level forgetting map induced by the schema morphism
Node.Schema.Prefix.toSchemaMap.
Instances For
Equivalence between an ordinary decoration by the realized context of S and
its staged telescope view.
This is the recursive schema-level form of Decoration.equivOver.