pub trait Frontend {
type Seed: Clone;
type Walk;
// Required methods
fn run(&self, seed: &Self::Seed) -> Result<RunResult, String>;
fn walk(&self, seed: &Self::Seed, log: &[BranchRec]) -> Option<Self::Walk>;
fn flip(&self, walk: &mut Self::Walk, i: usize) -> Solution;
fn site(&self, walk: &Self::Walk, i: usize) -> u64;
fn model_inputs(
&self,
model: &Model,
walk: &Self::Walk,
) -> Vec<(String, u64)>;
fn apply_inputs(
&self,
seed: &Self::Seed,
inputs: &[(String, u64)],
) -> Self::Seed;
// Provided methods
fn walk_gaps(&self, _walk: &Self::Walk) -> Vec<String> { ... }
fn walk_sinks(&self, _walk: &Self::Walk) -> Vec<SinkRec> { ... }
}Expand description
What a frontend must provide for the loop to run.
The four obligations are exactly the soundness contract: run is
deterministic, walk is a sound over-approximation of run’s prefix, and
model_inputs/apply_inputs round-trip a model onto a runnable seed.
Required Associated Types§
Required Methods§
Sourcefn run(&self, seed: &Self::Seed) -> Result<RunResult, String>
fn run(&self, seed: &Self::Seed) -> Result<RunResult, String>
Run the reference engine concretely. Determinism is the frontend’s
obligation; an engine-level failure is Err, not a trap.
Sourcefn walk(&self, seed: &Self::Seed, log: &[BranchRec]) -> Option<Self::Walk>
fn walk(&self, seed: &Self::Seed, log: &[BranchRec]) -> Option<Self::Walk>
Replay the concrete log symbolically. None when the walk cannot force
the path (a replay or lift limitation); the caller records that fact.
Sourcefn flip(&self, walk: &mut Self::Walk, i: usize) -> Solution
fn flip(&self, walk: &mut Self::Walk, i: usize) -> Solution
Pose the flip query at decision i of the forced walk.
Provided Methods§
Sourcefn walk_gaps(&self, _walk: &Self::Walk) -> Vec<String>
fn walk_gaps(&self, _walk: &Self::Walk) -> Vec<String>
Gap notes the walk itself recorded (unsupported opcode, replay drift, …).
Sourcefn walk_sinks(&self, _walk: &Self::Walk) -> Vec<SinkRec>
fn walk_sinks(&self, _walk: &Self::Walk) -> Vec<SinkRec>
Sinks reached on the walked path.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".