Bisimulation for dynamic concurrent processes #
This file adds the symmetric refinement layer on top of
Concurrent.Refinement.ForwardSimulation.
ForwardSimulation is intentionally one-way: it shows that every behavior of
an implementation can be matched by some behavior of a specification. The
purpose of this file is to package the corresponding two-way notion used when
two systems should count as behaviorally equivalent rather than merely
implementing one another.
The construction is deliberately simple:
- a backward simulation is just a forward simulation with the two systems swapped;
- a bisimulation packages one simulation in each direction; and
- once both directions are available, safety results can be transported either way, provided the chosen fairness assumptions also transfer.
This keeps the equivalence layer aligned with the existing process-centered refinement API rather than introducing a second semantic style.
ForwardSimulation.refl system matchStep is the identity simulation on
system, provided that matchStep relates each transcript to itself.
This is the canonical witness that every system refines itself.
Instances For
BackwardSimulation impl spec matchStep is just a forward simulation from
spec to impl, with the transcript-matching relation reversed accordingly.
So "backward simulation" is only a change of viewpoint, not a second primitive notion.
Instances For
Bisimulation left right matchForth matchBack packages one forward simulation
in each direction between left and right.
By default, the backward transcript-matching relation is the reversal of the forward one.
This is the library's main process-level equivalence witness: each side can match the other's executions while preserving the chosen step relation.
- forth : ForwardSimulation left right fun {pL : left.Proc} {pR : right.Proc} => matchForth
- back : ForwardSimulation right left fun {pL : right.Proc} {pR : left.Proc} => matchBack
Instances For
Swap the two sides of a bisimulation.
This is the symmetry principle for the packaged equivalence witness itself.
Instances For
The identity bisimulation on system, provided that both transcript relations
relate every transcript to itself.
This is the reflexivity principle for the packaged equivalence witness.
Instances For
Transport safety from the right system to the left system under a bisimulation, assuming the chosen fairness predicates transfer along the forward direction.
This is the "use the right-hand system as the proof-oriented model" direction.
Transport safety from the left system to the right system under a bisimulation, assuming the chosen fairness predicates transfer along the backward direction.
This is the same transport principle in the opposite direction.
Safety under fairness assumptions is equivalent across a bisimulation when the fairness assumptions themselves transfer in both directions.
So once fairness transport is established, either side of a bisimulation may be used as the proof-oriented presentation of the protocol.