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 Unit → ProbComp Unit that resolves the
intermediate monad into the denotational target.
Common instantiations:
m = ProbComp,close = id: coin-flip-only protocols. UseprocessSemanticsProbComp.m = OracleComp (unifSpec + roSpec),close = fun mx => (simulateQ impl mx).run' ∅: protocols in the random oracle model, whereimplcombines aunifSpecidentity lift withrandomOracle(or anyQueryImpl). UseprocessSemanticsOracle.
Main definitions #
Spec.Sampler m specprovides anm Xcomputation at each node of aSpectree, resolving each move in the intermediate monad.Spec.sampleTranscriptexecutes a sampler to produce a full transcript inm.StepOver.sampleruns one step by sampling a transcript and applying the continuation.ProcessOver.runStepsiteratessamplefor a fixed number of steps.UC.processSemanticsconstructs aSemantics (openTheory Party)from a closing morphism, initial state, step sampler, fuel count, and observation function.UC.processSemanticsProbCompis the specialization form = ProbComp.UC.processSemanticsOracleconstructs semantics for protocols with shared oracle access, usingsimulateQto close.
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:
ProbCompfor coin-flip-only protocols.OracleComp (unifSpec + roSpec)for protocols with shared random oracle access, where samplers can issue oracle queries viaquery.
Instances For
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
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
Run fuel steps of a process, starting from state s, using a
state-dependent sampler at each step.
Instances For
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 Unit → ProbComp 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
processSemanticsProbComp is the specialization of processSemantics for
m = ProbComp (coin-flip-only protocols with no shared oracles).
Instances For
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 onunifSpec, lazy-cached on the hash)initOracle := ∅(empty random oracle cache)