Documentation

VCVio.Interaction.UC.CorruptionModel

Corruption models as bundled environment alphabets #

A corruption model is a named choice of "what corruption events look like and how they update the bookkeeping state" — it picks the event alphabet, the bookkeeping state schema, and the per-event reaction. Different models capture different parts of the corruption design space:

This file defines the framework's generic corruption-model bundle and the bundled-process abbreviation CorruptionModel.Process. Concrete models live alongside (one file each); the framework is intentionally agnostic to which models exist.

Why a structure bundle, not a typeclass #

A model is a named choice the user explicitly makes at every proof site (pick MomentaryCorruption.model here, pick StaticCorruption.model there). It is not an implementation detail we want resolved automatically by instance synthesis, so the right shape is a first-class value. Being a value also means we can write functions over models (lift one model to another, take products of models) without the awkwardness of typeclass-level constructions.

Three fields, no more #

The bundle is intentionally minimal:

Things deliberately not in the bundle:

The bundle is the right API for "I want to write a process / proof / lemma that is generic over the corruption model" — declare (M : CorruptionModel) and use M.Event, M.State, M.envAction, M.Process Party Δ.

A corruption model bundles an event alphabet, a bookkeeping state schema, and a per-event reaction. Concrete models (MomentaryCorruption, a future StaticCorruption, etc.) are values of this type.

The three fields are independent of any particular party identity: Event and State may or may not be keyed by MachineId. A model that is, exposes MachineId-keyed events through its own concrete Event constructor (e.g. MomentaryCorruption.Alphabet.compromise (m : MachineId Sid Pid)), not through a parameter on CorruptionModel.

  • Event : Type

    The event alphabet recognised by the model.

  • State : Type

    The bookkeeping state carried between events.

  • envAction : EnvAction self.Event self.State

    The per-event reaction updating State on each Event.

Instances For
    @[reducible, inline]
    abbrev Interaction.UC.CorruptionModel.Process (M : CorruptionModel) (m : Type w → Type w') (Party : Type u) (Δ : PortBoundary) :
    Type (max (max (max u (v + 1)) (w + 1)) w')

    The corruption-aware open process abbreviation for a fixed model.

    Specialises EnvOpenProcess to the model's event alphabet and state, fixing the env-channel slot to M.envAction's (Event, State). The underlying open process is supplied by the user; the model determines how environment events update the bookkeeping state.

    The two OpenProcess universes (v, w) (process state and move spaces) are exposed; Party is whatever the user pairs the model with. For the canonical MomentaryCorruption instantiation, Party will be MachineId Sid Pid and the model fixes Event := MomentaryCorruption.Alphabet Sid Pid.

    Instances For