Documentation

VCVio.Interaction.UC.Runtime

Runtime execution semantics for open processes #

This file bridges the structural OpenProcess layer to probabilistic computation (ProbComp) by defining how to execute a closed process.

The core runtime primitives (Spec.Sampler, sampleTranscript, StepOver.sample, ProcessOver.runSteps) are parameterized by an arbitrary monad m : Type → Type. This generality lets the execution intermediate monad carry oracle access (random oracles, CRS, etc.) shared across all parties. The processSemantics constructor then takes a closing morphism m UnitProbComp Unit that resolves the intermediate monad into the denotational target.

Common instantiations:

Main definitions #

Universe constraints #

The runtime layer requires the spec and state type universes to be 0, since ProbComp : Type → Type operates in Type. This is satisfied by concrete protocols whose move types and state types live in Type.

A Sampler for spec : Spec.{0} provides an m X computation at each node whose move space is X, plus recursive samplers for every subtree.

The monad m is the intermediate execution monad. Typical choices:

  • ProbComp for coin-flip-only protocols.
  • OracleComp (unifSpec + roSpec) for protocols with shared random oracle access, where samplers can issue oracle queries via query.
Instances For
    noncomputable def Interaction.Spec.sampleTranscript {m : TypeType} [Monad m] (spec : Spec) :
    Sampler m specm spec.Transcript

    Execute a sampler to produce a full transcript of spec in the monad m.

    At each node the sampler monadically chooses a move; that move determines which subtree to continue sampling.

    Instances For
      noncomputable def Interaction.Concurrent.StepOver.sample {m : TypeType} [Monad m] {Γ : Spec.Node.Context} {P : Type} (step : StepOver Γ P) (sampler : Spec.Sampler m step.spec) :
      m P

      Run one step of a ProcessOver by sampling a transcript from the step's spec and applying the continuation to get the next state.

      Instances For
        noncomputable def Interaction.Concurrent.ProcessOver.runSteps {m : TypeType} [Monad m] {Γ : Spec.Node.Context} (process : ProcessOver Γ) (sampler : (p : process.Proc) → Spec.Sampler m (process.step p).spec) :
        process.Procm process.Proc

        Run fuel steps of a process, starting from state s, using a state-dependent sampler at each step.

        Instances For
          noncomputable def Interaction.UC.processSemantics (Party : Type u) {m : TypeType} [Monad m] (close : m UnitProbComp Unit) (init : (p : Interaction.UC.Closed✝ Party) → p.Proc) (sampler : (p : Interaction.UC.Closed✝¹ Party) → (s : p.Proc) → Spec.Sampler m (p.step s).spec) (fuel : ) (observe : (p : Interaction.UC.Closed✝² Party) → p.Procm Unit) :

          Construct a Semantics for the open-process theory, parameterized by an intermediate execution monad m and a closing morphism close.

          The execution runs entirely in m: the sampler produces moves, multi-step iteration threads them, and the observer extracts the final judgment. The closing morphism close : m UnitProbComp Unit then maps the whole execution into ProbComp Unit for the computational observation layer.

          See processSemanticsProbComp for the coin-flip-only specialization and processSemanticsOracle for the shared-oracle specialization.

          Instances For
            noncomputable def Interaction.UC.processSemanticsProbComp (Party : Type u) (init : (p : Interaction.UC.Closed✝ Party) → p.Proc) (sampler : (p : Interaction.UC.Closed✝¹ Party) → (s : p.Proc) → Spec.Sampler ProbComp (p.step s).spec) (fuel : ) (observe : (p : Interaction.UC.Closed✝² Party) → p.ProcProbComp Unit) :

            processSemanticsProbComp is the specialization of processSemantics for m = ProbComp (coin-flip-only protocols with no shared oracles).

            Instances For
              noncomputable def Interaction.UC.processSemanticsOracle (Party : Type u) {ι : Type} {superSpec : OracleSpec ι} {σ : Type} (impl : QueryImpl superSpec (StateT σ ProbComp)) (initOracle : σ) (init : (p : Interaction.UC.Closed✝ Party) → p.Proc) (sampler : (p : Interaction.UC.Closed✝¹ Party) → (s : p.Proc) → Spec.Sampler (OracleComp superSpec) (p.step s).spec) (fuel : ) (observe : (p : Interaction.UC.Closed✝² Party) → p.ProcOracleComp superSpec Unit) :

              processSemanticsOracle constructs semantics for protocols with shared oracle access (random oracles, CRS, etc.).

              The intermediate monad is OracleComp superSpec, where superSpec describes all oracles available during execution. Oracle queries are resolved by simulateQ impl into StateT σ ProbComp, and the oracle state is initialized to initOracle.

              For a protocol in the random oracle model, a typical instantiation is:

              • superSpec := unifSpec + (D →ₒ R) (uniform sampling plus hash oracle)
              • impl := HasQuery.toQueryImpl.liftTarget _ + randomOracle (identity on unifSpec, lazy-cached on the hash)
              • initOracle := ∅ (empty random oracle cache)
              Instances For