Skip to main content

SMTVariableContext

Trait SMTVariableContext 

Source
pub trait SMTVariableContext<T> {
    // Required methods
    fn get_expr_for(&self, expr: &T) -> Result<SMTExpr, SMTSolverError>;
    fn get_exprs<'a>(&'a self) -> impl IntoIterator<Item = &'a T>
       where T: 'a;

    // Provided method
    fn get_solution<'a>(
        &'a self,
        solver: &mut SMTSolver,
        res: SMTSolution,
    ) -> Result<HashMap<T, u32>, SMTSolverError>
       where T: 'a + Eq + Hash + Clone { ... }
}
Expand description

Trait of a context that provides mapping from type declaring SMT variables T to associated SMT expression

This trait is implemented by contexts that can provide the corresponding SMTExpr for a given expression stored in the context. Implementing this trait allows to encode integer and boolean expressions into SMTExprs.

Required Methods§

Source

fn get_expr_for(&self, expr: &T) -> Result<SMTExpr, SMTSolverError>

Get the corresponding SMTExpr for the given expression of type T

This function returns an error if the expression is not stored in the context, or it tried to declare a variable and the connection to the SMT solver broke.

Source

fn get_exprs<'a>(&'a self) -> impl IntoIterator<Item = &'a T>
where T: 'a,

Get all expressions for which the current context holds an assignment

Provided Methods§

Source

fn get_solution<'a>( &'a self, solver: &mut SMTSolver, res: SMTSolution, ) -> Result<HashMap<T, u32>, SMTSolverError>
where T: 'a + Eq + Hash + Clone,

Get the solution assignment

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Hash + Eq + DeclaresVariable> SMTVariableContext<T> for HashMap<T, SExpr>

Source§

fn get_expr_for(&self, expr: &T) -> Result<SMTExpr, SMTSolverError>

Source§

fn get_exprs<'a>(&'a self) -> impl IntoIterator<Item = &'a T>
where T: 'a,

Implementors§

Source§

impl SMTVariableContext<Location> for ConfigCtx

Source§

impl SMTVariableContext<Location> for StaticSMTContext

Source§

impl SMTVariableContext<Parameter> for ConfigCtx

Source§

impl SMTVariableContext<Parameter> for StaticSMTContext

Source§

impl SMTVariableContext<Variable> for ConfigCtx

Source§

impl SMTVariableContext<Variable> for StaticSMTContext

Source§

impl<TA, C> SMTVariableContext<Rule> for LazyStepContext<TA, C>
where TA: ThresholdAutomaton, C: SMTVariableContext<Parameter> + SMTVariableContext<Location> + SMTVariableContext<Variable>,