State-free responder behavior #
An ordinary state-free responder behavior for P is the terminal
coalgebra M (P ⊸ y). Given a
proof-relevant responder coalgebra, Display.Coalgebra.toM maps a state and
its current witness into the greatest displayed fixed point over that ordinary
behavior:
Display.M (Display.responder S) (R.behavior state).
The displayed fixed point is not a Function.Fiber of a forgetful M-map.
There is only a covariant chart from the total responder display to the base
responder polynomial: a bare query cannot supply the precondition witness
needed by the displayed child. Display.M retains that genuine branching
instead of postulating a nonexistent lens.
Structural state-free reindexing keeps the source and target interface
universes independent. Only its categorical composition laws retain the
homogeneous source/intermediate response-universe constraint of
FreeM.liftM.
The terminal P-coalgebra as a dynamical system whose states are
state-free behaviors.
Equations
- PFunctor.M.terminalSystem = { toFunA := fun (tree : (PFunctor.selfMonomial P.M).A) => PFunctor.M.head tree, toFunB := fun (tree : (PFunctor.selfMonomial P.M).A) => PFunctor.M.children tree }
Instances For
States presenting a fixed ordinary behavior, together with their current displayed witness. This is the indexed seed family used to quotient a state presentation through terminal displayed semantics.
Equations
Instances For
One displayed step on behavior-indexed presentation states.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Map a proof-relevant state presentation into its state-free displayed behavior. Distinct or unreachable presentation states are intentionally identified when they generate the same coinductive evidence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The first unfolding of state-free displayed semantics.
The destructor is the canonical displayed coalgebra on terminal behavior states.
Equations
- PFunctor.Display.Coalgebra.terminal S x✝ displayedTree = displayedTree.dest
Instances For
A map of responder states preserving answers and next states preserves the complete coinductive behavior.
The canonical responder whose states are state-free responder behaviors.
Instances For
The child of a presented responder behavior after a query is the behavior of the presented responder's next state.
Executing a finite program on terminal state-free behavior preserves the ordinary result and replaces the final presentation state by its behavior.
Coinductive displayed response #
Destructor equivalence for one displayed responder observation.
This is the intrinsic form of Aberlé's coinductive DepMealy.appD: a query and
precondition witness produce postcondition data and a displayed continuation
over the selected ordinary behavior child.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Apply one coinductive displayed responder step.
Equations
- PFunctor.Responder.respondDisplayed S displayedBehavior query precondition = (PFunctor.Responder.respondDisplayedEquiv S behavior) displayedBehavior query precondition
Instances For
Transporting a displayed behavior transports its complete dependent
respondDisplayed observation. This function-level form avoids exposing casts
in the postcondition and continuation projections separately.
A cast-free, observation-shaped bisimulation for displayed responder behaviors. Related values return the same evidence for every query and precondition and have related answer-selected continuations.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Observation-shaped responder bisimulation implies equality.
Turn a responder state and its current witness into the corresponding state-free displayed behavior.
Equations
- PFunctor.Responder.toDisplayedBehavior S R I displayedR state witness = PFunctor.Display.Coalgebra.toM R I displayedR state witness
Instances For
The postcondition component of state-free respondDisplayed is exactly the
local displayed responder-coalgebra obligation.
The continuation component of state-free respondDisplayed, transported
along the ordinary behavior-child equation, is the displayed behavior generated
from the locally preserved next-state witness.
Executing a displayed finite program against a state-free behavior presented by a displayed responder agrees with executing it against the presenting responder, and presents the resulting final witness again.
Reindex a state-free responder behavior by using it as the state of the terminal responder and applying ordinary responder reindexing.
Equations
Instances For
State-free behavior reindexing is invariant under equality of its free handler.
The state-free reindexing of a presented behavior agrees with reindexing the presenting responder first.
State-free responder reindexing is contravariantly functorial in the same categorical composition order as state-presented reindexing.
Reindex state-free proof-relevant responder behavior through a displayed
free handler. The construction is the state-free semantics of G3's
reindexCoalgebra, evaluated at the canonical terminal responder.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Displayed state-free reindexing is invariant under simultaneous transport of the base handler and its displayed lift. The sole output transport is the canonical equality of the underlying ordinary behaviors.
The postcondition returned by one state-free displayed reindexing step is exactly the postcondition produced by executing the displayed handler program against the target displayed behavior.
The continuation returned by one state-free displayed reindexing step is the recursively reindexed target continuation produced by displayed program execution, after the canonical ordinary behavior-child transport.
State-free displayed behavior reindexing preserves identity handlers, after the canonical equality of the underlying ordinary behaviors.
Successive state-free displayed behavior reindexing agrees with reindexing by the displayed Kleisli composite, after the canonical equality of the underlying ordinary behaviors.