Backends given by a step function #
Many concrete backends are a total function taking a concrete state and an operation to the next state, the answer and a native trace (a cost count, say). This module states the execution relation, the client runner and the semantic implementation of such a backend once, so that each data structure supplies only its step function and its correctness proof.
Main definitions #
StepResult: the next state, answer and trace of one step.Execution.ofStep: the execution relation of a step function.RunResult,Execution.run: the value, final state and per-operation traces of running an adaptive client with a step function.StateTransitionImpl.ofStep: a semantic implementation of a deterministic specification by a step function, from step correctness alone.
Main results #
Execution.executes_run: the runner produces anExecutesderivation.
The outcome of one step of a concrete backend: the next state, the answer and a native trace.
- state : C
The concrete state after the step.
- answer : β
The answer returned to the client.
- trace : τ
The native trace of the step, such as its cost.
The outcome of running an adaptive client on a concrete backend: the client's value, the final state and the native trace of each operation, in call order.
- value : α
The value returned by the client.
- state : C
The concrete state after the last operation.
- traces : List τ
The native traces of the operations, in call order.
The execution relation of a step function: c steps under o to c' with answer a and
trace t exactly when step c o = ⟨c', a, t⟩.
Run an adaptive client with a step function, recording the trace of each operation.
The runner of a step function produces a derivation of its execution relation.
A semantic implementation of a deterministic specification by a step function. Totality holds
because the step function is total, so only step correctness is required: from a represented
state, every admissible operation answers as D.stepFn and reaches a represented state.