Witness-preserving responder presentations #
A PresentationHom preserves the totalized one-step semantics of a responder
together with its dependent witness. This module owns the generic identity,
composition, terminal-semantics, and displayed-reindexing principles;
lens-specific specializations live in Responder.Lens.
The terminology is structural. A
Display.Coalgebra (Display.responder S) R.out I supplies, for every responder
state and current witness in I, the displayed response and next-state witness
required by S. toDisplayedBehavior coinduces that local data into an
inhabitant of Display.M (Display.responder S) (R.behavior state), and a
PresentationHom maps between two such state-and-witness presentations while
commuting with their complete one-step data.
Neither S nor I is restricted to propositions. Applications may interpret
them as preconditions, postconditions, and invariants, in which case these
objects can witness a verification result. They may instead carry traces,
resources, logical relations, or other Type-valued annotations. The public
names therefore say displayed or witness-preserving, not verified.
One witness-preserving responder step on the total state-and-witness presentation. The result packages the ordinary behavior, current displayed postcondition data, next responder state, and preserved next-state witness.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Extensionality for a totalized displayed responder step. Separating the
ordinary behavior, displayed postcondition, and continuation components keeps
dependent Sigma/HEq plumbing out of presentation and coherence proofs.
Sigma-erasing a displayed behavior is the ordinary behavior of its total state-and-witness presentation.
A homomorphism between witness-preserving responder presentations. The state
and witness maps remain split so the latter visibly respects its dependent
state index; an arbitrary homomorphism of total sigma coalgebras would erase
that useful presentation structure. The sole law says that mapping a source
state and witness commutes with the complete totalized
witness-preserving step. Because answers, postconditions, next states, and next
witnesses are packaged together, the law requires neither HEq nor exposed
casts.
- toState : SourceState → TargetState
Map the underlying responder state.
- toWitness (state : SourceState) : SourceWitness state → TargetWitness (self.toState state)
Map its dependent witness into the fiber over the mapped state.
- map_step (state : SourceState) (witness : SourceWitness state) : displayedTotalStep S target TargetWitness displayedTarget ⟨self.toState state, self.toWitness state witness⟩ = (IPFunctor.sigmaPFunctor S.responder.mStep).map (fun (stateAndWitness : (state : SourceState) × SourceWitness state) => ⟨self.toState stateAndWitness.fst, self.toWitness stateAndWitness.fst stateAndWitness.snd⟩) (displayedTotalStep S source SourceWitness displayedSource ⟨state, witness⟩)
Instances For
The induced map on total state-and-witness sigma types.
Instances For
Transport a dependent witness map along equality of its state map.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Presentation homomorphisms are determined by their state and dependent witness maps; preservation proofs are propositionally irrelevant.
Identity homomorphism of a displayed responder presentation.
Equations
Instances For
Composition of displayed presentation homomorphisms.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Map any displayed responder presentation to its terminal state-free semantics. This is the reusable boundary between state-presented and state-free displayed behavior.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The base behavior equality carried by a displayed presentation homomorphism.
Displayed terminal semantics is natural under a displayed presentation homomorphism.
Presenting a reindexed displayed responder through terminal state-free semantics is a displayed presentation homomorphism.
Equations
- One or more equations did not get rendered due to their size.
Instances For
State-free displayed reindexing agrees with reindexing the presenting displayed responder, after the ordinary presentation equality.