Finite executions of dynamic concurrent processes #
This file explains what it means to execute a Concurrent.ProcessOver for
finitely many steps.
The important point is that one process step is itself a finite sequential interaction episode. So a finite concurrent execution is not just a list of atomic labels: at each residual state we record one complete sequential transcript of the current step, then continue from the residual process state selected by that transcript.
This file therefore provides two parallel views of finite execution:
ProcessOver.Trace, the exact global execution history for any realized node context; andStep.Observed/ProcessOver.ObservedTrace, the local observations that one fixed party extracts from that history once the node context is projected intoStepContext.
The closed-world Process API is recovered as a specialization of these
generic definitions.
Observed me semantics tr is the exact typed sequence of local observations
available to the fixed party me during one sequential step.
More concretely, suppose the current process step executes along transcript
tr. At each visited node of that transcript, the step semantics determines
what me is allowed to observe there, and Observed records exactly that
piece of local information before continuing to the next node.
So Observed is the step-local projection of the global transcript: it forgets
everything that me is not entitled to see, while preserving the exact local
observation type at every node.
- done
{Party : Type u}
[DecidableEq Party]
{me : Party}
: Observed me PUnit.unit PUnit.unit
The unique observed transcript of a completed sequential step.
- step
{Party : Type u}
[DecidableEq Party]
{me : Party}
{Moves : Type w}
{rest : Moves → Spec}
{node : NodeSemantics Party Moves}
{semantics : (x : Moves) → Spec.Decoration (StepContext Party) (rest x)}
{x : Moves}
{tail : (rest x).Transcript}
(obs : (node.views me).ObsType)
(restObs : Observed me (semantics x) tail)
: Observed me
(have this := (node, semantics);
this)
(have this := ⟨x, tail⟩;
this)
Extend an observed transcript by the local observation available at the current node.
Instances For
The number of visited nodes recorded by an observed sequential transcript.
Instances For
ofTranscript me semantics tr is the canonical observed sequential transcript
induced by the concrete global transcript tr.
It is obtained by replaying tr and, at each visited node, extracting the
observation that the local view for me exposes there.
Instances For
Observed me step tr is the sequence of local observations exposed to me
while the step step executes along the transcript tr.
This is the most convenient step-level type when working with concrete process steps rather than raw decorations.
Instances For
observe me step tr is the canonical observed sequential transcript induced by
running step along tr.
Instances For
ObservedTranscript me resolve step tr is the local observation sequence seen
by me when the generic step step is interpreted through the context
projection resolve : Γ → StepContext Party.
Instances For
observe me resolve step tr is the canonical observed sequential transcript of
step along tr, after projecting the generic step context into
StepContext.
Instances For
Trace process p is a finite execution trace of the residual process state
p.
Each step constructor records one whole sequential transcript for the current
process step, then continues with the residual process selected by that
transcript. The done constructor is available only when the current step has
no complete transcripts at all, so a Trace represents a genuinely terminated
finite execution.
ProcessOver.Trace is therefore the generic finite-history object for the
dynamic concurrent core: one element per process step, where each element
remembers the entire internal interaction episode that realized that step.
- done
{Γ : Spec.Node.Context}
{process : ProcessOver Γ}
{p : process.Proc}
: (∀ (a : (process.step p).spec.Transcript), False) → process.Trace p
A finished execution of a residual process state whose current step has no complete transcripts.
- step
{Γ : Spec.Node.Context}
{process : ProcessOver Γ}
{p : process.Proc}
(tr : (process.step p).spec.Transcript)
: process.Trace ((process.step p).next tr) → process.Trace p
Execute one complete sequential step transcript and continue with the residual process state induced by that transcript.
Instances For
The number of process steps recorded by a finite execution trace.
Instances For
currentControllers resolve trace records the current controlling party of
each executed process step after projecting the generic step context into
StepContext.
Instances For
controllerPaths resolve trace records the full controller path of each
executed process step after projecting the generic step context into
StepContext.
Instances For
events eventMap trace records the external event label attached to each
process step transcript by the stable event map eventMap.
Instances For
tickets ticketMap trace records the stable tickets attached to each process
step transcript by ticketMap.
Instances For
ObservedTrace me resolve process trace is the exact typed sequence of local
observations available to me along the concrete process execution trace,
after interpreting the generic node context through resolve.
- done
{Γ : Spec.Node.Context}
{Party : Type u}
[DecidableEq Party]
{me : Party}
{resolve : Spec.Node.ContextHom Γ (StepContext Party)}
{process : ProcessOver Γ}
{p : process.Proc}
{h : ∀ (a : (process.step p).spec.Transcript), False}
: ObservedTrace me resolve process (Trace.done h)
The unique observed trace of a finished quiescent execution.
- step
{Γ : Spec.Node.Context}
{Party : Type u}
[DecidableEq Party]
{me : Party}
{resolve : Spec.Node.ContextHom Γ (StepContext Party)}
{process : ProcessOver Γ}
{p : process.Proc}
{tr : (process.step p).spec.Transcript}
{tail : process.Trace ((process.step p).next tr)}
(obs : StepOver.ObservedTranscript me resolve (process.step p) tr)
(rest : ObservedTrace me resolve process tail)
: ObservedTrace me resolve process (Trace.step tr tail)
Extend an observed trace by the observed sequential transcript of the current step.
Instances For
The number of process steps recorded by an observed trace.
Instances For
ofTrace me resolve process trace is the canonical observed process trace
induced by the concrete execution trace trace.
Instances For
The canonical observed process trace has the same number of process steps as the underlying execution trace.
The closed-world specialization of ProcessOver.Trace.
Instances For
The closed-world specialization of ProcessOver.ObservedTrace.
Instances For
The number of process steps recorded by an observed closed-world trace.
Instances For
ofTrace me process trace is the canonical observed closed-world process trace
induced by the concrete execution trace trace.
Instances For
The canonical observed closed-world trace has the same number of process steps as the underlying execution trace.