pub(crate) trait SymbolicSolver {
// Required methods
fn stats(&self) -> SymbolicStats;
fn set_query_observer(
&mut self,
observer: Option<Box<dyn Fn(usize) + Send + Sync + 'static>>,
);
fn portfolio_diagnostics(&self) -> Option<&PortfolioDiagnostics>;
fn capture_diagnostics(&mut self);
fn take_diagnostics(&mut self) -> Option<String>;
fn check_available(&self) -> Result<(), SymbolicError>;
fn is_sat(
&mut self,
constraints: &[BoolExpr],
) -> Result<bool, SymbolicError>;
fn model(
&mut self,
constraints: &[BoolExpr],
) -> Result<BTreeMap<String, U256>, SymbolicError>;
// Provided method
fn heuristic_witnesses(&self) -> usize { ... }
}Expand description
Minimal solver backend interface used by the symbolic executor.
Implementations are responsible for translating accumulated symbolic constraints into solver queries, enforcing query budgets, and extracting concrete model values for counterexample replay. The trait is intentionally small so alternate SMT backends can be added without changing the executor entrypoints.
Required Methods§
Sourcefn stats(&self) -> SymbolicStats
fn stats(&self) -> SymbolicStats
Returns solver counters collected by this backend.
Sourcefn set_query_observer(
&mut self,
observer: Option<Box<dyn Fn(usize) + Send + Sync + 'static>>,
)
fn set_query_observer( &mut self, observer: Option<Box<dyn Fn(usize) + Send + Sync + 'static>>, )
Registers a callback invoked after each logical solver query is reserved.
Sourcefn portfolio_diagnostics(&self) -> Option<&PortfolioDiagnostics>
fn portfolio_diagnostics(&self) -> Option<&PortfolioDiagnostics>
Returns aggregate staged-portfolio diagnostics collected by this backend.
Sourcefn capture_diagnostics(&mut self)
fn capture_diagnostics(&mut self)
Captures verbose diagnostics for later rendering instead of writing them live.
Sourcefn take_diagnostics(&mut self) -> Option<String>
fn take_diagnostics(&mut self) -> Option<String>
Takes any captured verbose diagnostics collected by this backend.
Sourcefn check_available(&self) -> Result<(), SymbolicError>
fn check_available(&self) -> Result<(), SymbolicError>
Verifies that the configured solver can be invoked before exploration starts.
Backends should keep this check lightweight and return a SymbolicError with
a stable stop reason when the solver executable or service is unavailable.
Sourcefn is_sat(&mut self, constraints: &[BoolExpr]) -> Result<bool, SymbolicError>
fn is_sat(&mut self, constraints: &[BoolExpr]) -> Result<bool, SymbolicError>
Returns whether the supplied path constraints are satisfiable.
Implementations should count this as one solver query and map solver unknown
or timeout responses into SymbolicError::SolverUnknown or
SymbolicError::Solver, as appropriate.
Sourcefn model(
&mut self,
constraints: &[BoolExpr],
) -> Result<BTreeMap<String, U256>, SymbolicError>
fn model( &mut self, constraints: &[BoolExpr], ) -> Result<BTreeMap<String, U256>, SymbolicError>
Returns a concrete model for all symbolic variables constrained by the path.
The executor uses the returned variable assignments to materialize ABI arguments, calldata, and invariant sequences for concrete replay.
Provided Methods§
Sourcefn heuristic_witnesses(&self) -> usize
fn heuristic_witnesses(&self) -> usize
Returns the number of satisfiable witnesses produced by local hard-arithmetic search.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".