Dynamic concurrent processes #
This file introduces the semantic center of the concurrent Interaction
layer.
The structural syntax in Concurrent.Spec is a useful source language, but it
is not the only natural presentation of concurrency. Many systems are better
viewed as a residual process which, at any moment, exposes one finite
sequential interaction episode; completing that episode yields the next
residual process.
That is the viewpoint formalized here.
The file is organized in two levels:
StepOver Γ PandProcessOver Γare the generic forms, parameterized by a realized node contextΓ;Step Party PandProcess Partyare the closed-world specializations whose node metadata is exactlyNodeSemantics Party.
So the intended reading is:
- a step is one finite local protocol episode,
- a process is an unbounded sequence of such steps obtained by continuation,
- and controller / observation metadata lives in a node context rather than being built into the process infrastructure itself.
This design stays continuation-first, but is more general than the structural
tree frontend: cyclic or unbounded behavior is represented by the residual
state type, while each individual step remains a finite Interaction.Spec.
NodeSemantics Party X records the local semantic data attached to one
sequential interaction node whose move space is X.
It packages two orthogonal pieces of information:
controllers xis the controller-path contribution associated to choosing the movex : X;viewsassigns to each party its local view of the chosen movex : X.
The controller-path contribution and the local views are intentionally stored
separately. Many natural systems align them so that the first controller in
controllers x has local view active, but this file does not force that
relationship definitionally.
Any desired coherence law can be imposed later as a separate well-formedness
predicate.
- controllers : X → List Party
- views : Party → Multiparty.LocalView X
Instances For
The closed-world node context used by the current concurrent semantics.
At a node with move space X, the context value is exactly the
NodeSemantics Party X describing:
- which parties are recorded as controllers of the chosen move, and
- what each party locally observes of that move.
This is the context whose specialization recovers the existing closed-world
Step / Process APIs.
Instances For
StepOver Γ P is one finite sequential interaction episode whose nodes are
decorated by realized context Γ, and whose completion produces the next
residual process state P.
Fields:
specis the shape of the sequential interaction episode;semanticsdecorates that sequential tree by node-local contextΓ;nextmaps a complete transcript of that episode to the next residual process state.
The important point is that a StepOver is not restricted to a single
atomic event. One concurrent step may itself be a short sequential protocol:
for example, a scheduler choice followed by a payload choice, or a small
request/response exchange treated as one logical concurrent transition.
So StepOver is the right object when the concurrency layer should expose
finite sequential structure inside each global step, rather than flattening
everything into atomic transitions.
- spec : Spec
- semantics : Spec.Decoration Γ self.spec
- next : self.spec.Transcript → P
Instances For
Map the node-local context carried by a step along a realized context morphism.
This changes only the metadata decorating the step protocol. The underlying
sequential interaction tree and the continuation next are left unchanged.
Instances For
ProcessOver Γ is a continuation-based concurrent process whose current step
episodes are decorated by realized context Γ.
From any residual process state p : Proc, the process exposes exactly one
step protocol step p : StepOver Γ Proc. Running that step to completion
produces the next residual state.
So ProcessOver should be read as:
a system whose behavior unfolds as a sequence of finite step protocols.
This is the generic semantic center for the concurrent layer. Structural
trees, flat machines, and future frontends can all compile into ProcessOver
by choosing an appropriate node-local context Γ.
- Proc : Type v
Instances For
Map the node-local context carried by a process along a realized context morphism.
This changes only the metadata exposed at each step. The residual state space and transition structure are preserved.
Instances For
Every ProcessOver Γ is an F-coalgebra for the StepOver Γ endofunctor.
Binary-choice interleaving of two processes with different node contexts.
Given processes p₁ over Γ₁ and p₂ over Γ₂, context morphisms mapping
each into a common target context Δ, and a scheduler decoration in Δ for
the ULift Bool choice node, produce a single ProcessOver Δ whose state
space is p₁.Proc × p₂.Proc.
At each step, a scheduler node chooses left (true) or right (false), then
the selected subprocess's step protocol runs with its decoration mapped into
Δ. Only the selected component of the product state advances.
Instances For
Post-composing mapContext g distributes over interleave: the result is
the same interleaving with each injection pre-composed by g.
Pre-composing both operands with mapContext distributes into the
interleave injections via ContextHom.comp.
Specialization of interleave_mapContext when only the left operand
is pre-composed with mapContext.
Specialization of interleave_mapContext when only the right operand
is pre-composed with mapContext.
A stable external label for each complete step transcript of a process.
The point of an EventMap is to attach one comparison-friendly label to a
whole step, independently of how much internal sequential structure that step
contains.
Instances For
A stable ticket for each complete step transcript of a process.
Tickets are the intended handles for fairness and liveness: instead of talking about unstable frontier events whose types change from state to state, later semantic layers can talk about these stable identifiers.
Instances For
TranscriptRel left right is a relation between one complete step transcript
of left and one complete step transcript of right.
This is the generic step-matching interface consumed by refinement and
bisimulation. No controller or observation structure is assumed here; those
become special cases once the surrounding contexts are projected into
StepContext.
Instances For
The permissive step relation that accepts every pair of complete step transcripts.
Instances For
Reverse a step-matching relation by flipping its two transcript arguments.
Instances For
Conjunction of step-matching relations.
Instances For
ProcessOver.Labeled is a process equipped with a stable external event label
for each complete step transcript.
- toProcess : ProcessOver Γ
- Event : Type w₃
Instances For
ProcessOver.Ticketed is a process equipped with a stable ticket for each
complete step transcript.
These tickets are the obligation identifiers used by the fairness and liveness layers.
- toProcess : ProcessOver Γ
- Ticket : Type w₃
Instances For
ProcessOver.System Γ augments a process over context Γ by the standard
verification predicates used throughout VCVio.
Instances For
The closed-world specialization of StepOver.
Here the node context is fixed to StepContext Party, so every node carries
the usual controller-path and local-view data for that party universe.
Instances For
controllerPath step tr is the controller sequence exposed by the concrete
step transcript tr.
Every visited node contributes the controller list recorded for the chosen move at that node. These per-node contributions are concatenated along the whole step transcript.
So if a step internally consists of, say, "the scheduler chooses a branch, then Alice chooses a payload", the controller path records both pieces in order.
Instances For
Instances For
currentController? step tr is the head of the controller path exposed by the
concrete transcript tr, if such a controller exists.
This is the most immediate "who controlled this step?" projection. It is only the first controller because one step may internally contain several controlled subchoices.
Instances For
Closed-world controller-path projection for a StepOver specialized to
StepContext Party.
This bridge keeps the old dot-notation ergonomics after the StepOver
cutover: downstream closed-world code can still write
(process.step p).controllerPath tr.
Instances For
Closed-world current-controller projection for a StepOver specialized to
StepContext Party.
Instances For
The closed-world specialization of ProcessOver.
This is the process type consumed by the current execution, run, observation, refinement, fairness, and liveness layers.
Instances For
The closed-world specialization of ProcessOver.TranscriptRel.
Instances For
Process.Labeled is a closed-world process together with a stable event label
for each complete step transcript.
Instances For
Process.Ticketed is a closed-world process together with a stable ticket for
each complete step transcript.
These tickets are the obligation identifiers used later by the fairness and liveness layers.
Instances For
Process.System augments a closed-world process by the standard verification
predicates used throughout VCVio and in transition-system-style frameworks.
Its parent field toProcess is the dynamic semantics; the remaining fields are
verification metadata on top of that semantics:
initmarks initial residual states;assumptionsrecords ambient assumptions on runs;safeis the intended state safety predicate;invis the intended inductive invariant.
This keeps the semantic object and the proof obligations separate while still bundling them in one place for refinement and liveness statements.