Whole-tree strategies over interaction syntax #
This file turns local syntax into whole-tree strategy families. It sits after
SyntaxOver and ShapeOver: syntax describes one node, shape adds local
continuation reindexing, and StrategyOver recursively interprets that syntax
over an entire FreeM tree.
Whole-tree local strategy induced by lens-indexed local syntax.
At leaves it returns the output family. At a control node it presents the local
node object supplied by syn, whose continuation family is recursively the
strategy for the abstract branch selected by the lens.
Instances For
A local homomorphism between two lens-executed StrategyOver fibers.
The source and target may use different local syntax objects and different
agents, while sharing the same control lens and node-context decoration.
At each node, mapNode translates the source node object into the target node
object after recursive continuations have already been translated.
Instances For
Map a lens-executed whole-tree strategy along a local homomorphism, while also mapping its leaf output family.
The recursion follows runtime directions through PathAlong l spec; the lens
maps each runtime direction back to the corresponding control branch.
Instances For
A local homomorphism between two StrategyOver fibers while changing the
node-local context through φ.
This is the context-changing analogue of StrategyOver.Hom: the source node
at context value γ is translated to a target node at context value φ γ.
Instances For
Map a whole-tree strategy across a local context-changing homomorphism.
The context decoration is mapped structurally by the same context map φ.
Instances For
A context-changing homomorphism between functorial shapes, natural in recursive continuation maps.
The naturality field is the reason mapContext commutes with
ShapeOver.mapOutput: translating a node after mapping its continuations is
the same as mapping continuations after translating the node.
- mapNode_map {pos : P.A} {γ : Γ pos} {A B C D : Q.B (l.toFunA pos) → Type w} (f₁ : (d : Q.B (l.toFunA pos)) → A d → B d) (f₂ : (d : Q.B (l.toFunA pos)) → A d → C d) (g₁ : (d : Q.B (l.toFunA pos)) → B d → D d) (g₂ : (d : Q.B (l.toFunA pos)) → C d → D d) (comm : ∀ (d : Q.B (l.toFunA pos)) (x : A d), g₁ d (f₁ d x) = g₂ d (f₂ d x)) (node : shape₁.Node agent₁ pos γ A) : self.mapNode g₁ (shape₁.map f₁ node) = shape₂.map g₂ (self.mapNode f₂ node)
Instances For
The whole-tree strategy induced by SyntaxOver.forAgent syn agent is the
agent fiber of the original participant-indexed whole-tree strategy.
Whole-tree families for SyntaxOver.comap f syn are exactly families for syn
evaluated on the mapped decoration.
View a functorial shape as a local strategy homomorphism on one agent fiber.
Instances For
Map leaf outputs through a whole lens-executed strategy.
This is the recursive global form of the local ShapeOver.map field. The
runtime path index is PathAlong l spec, so it applies equally to plain specs
and to control specs such as Oracle.Spec executed through a lens.
Instances For
Context-changing strategy maps commute with functorial output maps.
Whole-tree families for ShapeOver.comap f shape are exactly families for
shape evaluated on the mapped decoration.