struct IndexedSMTContext {
smt_solver: SMTSolver,
config_ctxs: Vec<ConfigCtx>,
param_to_smt: Rc<HashMap<Parameter, SMTExpr>>,
curr_index: usize,
}Expand description
An indexed SMT Context which creates and manages smt variables for parameters and indexed smt variables for Locations, Variables and Rules
The context keeps track of the current index for locations, variables and rules
Fields§
§smt_solver: SMTSolversmt solver which used to evaluate SMT constraints
config_ctxs: Vec<ConfigCtx>smt variable contexts for configurations
param_to_smt: Rc<HashMap<Parameter, SMTExpr>>mapping from parameter to smt variable
curr_index: usizecurrent index
Implementations§
Source§impl IndexedSMTContext
impl IndexedSMTContext
Sourcefn new<T: ThresholdAutomaton>(
solver_builder: SMTSolverBuilder,
len: usize,
ta: &T,
) -> Self
fn new<T: ThresholdAutomaton>( solver_builder: SMTSolverBuilder, len: usize, ta: &T, ) -> Self
creates a new IndexedSMTContext that creates smt variables
for all indexed locations and shared variables up to index len,
and all parameters
Sourcefn set_curr_index(&mut self, i: usize)
fn set_curr_index(&mut self, i: usize)
updates the current index
Sourcefn get_current_config_ctx(&self) -> &ConfigCtx
fn get_current_config_ctx(&self) -> &ConfigCtx
Get the current configuration context
Get the smt expression for the indexed shared variable at index i
Sourcefn get_indexed_loc_smt(&self, loc: &Location, i: usize) -> SMTExpr
fn get_indexed_loc_smt(&self, loc: &Location, i: usize) -> SMTExpr
Get the smt expression for the indexed location at index i
Sourcefn get_assigned_configs(&mut self, res: SMTSolution) -> Vec<Configuration>
fn get_assigned_configs(&mut self, res: SMTSolution) -> Vec<Configuration>
Extract the assigned configurations
Trait Implementations§
Source§impl GetAssignment<Parameter> for IndexedSMTContext
impl GetAssignment<Parameter> for IndexedSMTContext
Source§impl SMTSolverContext for IndexedSMTContext
impl SMTSolverContext for IndexedSMTContext
Source§fn get_smt_solver(&self) -> &SMTSolver
fn get_smt_solver(&self) -> &SMTSolver
Get the SMT solver associated with this context
Source§fn get_smt_solver_mut(&mut self) -> &mut SMTSolver
fn get_smt_solver_mut(&mut self) -> &mut SMTSolver
Get a mutable reference to the SMT solver associated with this context
§fn assert_and_check_expr(
&mut self,
expr: SExpr,
) -> Result<SMTSolution, SMTSolverError>
fn assert_and_check_expr( &mut self, expr: SExpr, ) -> Result<SMTSolution, SMTSolverError>
Check the satisfiability of the given [
SMTExpr]Source§impl SMTVariableContext<Parameter> for IndexedSMTContext
impl SMTVariableContext<Parameter> for IndexedSMTContext
Source§fn get_expr_for(&self, param: &Parameter) -> Result<SMTExpr, SMTSolverError>
fn get_expr_for(&self, param: &Parameter) -> Result<SMTExpr, SMTSolverError>
Source§fn get_exprs<'a>(&'a self) -> impl IntoIterator<Item = &'a Parameter>where
Parameter: 'a,
fn get_exprs<'a>(&'a self) -> impl IntoIterator<Item = &'a Parameter>where
Parameter: 'a,
Get all expressions for which the current context holds an assignment
Auto Trait Implementations§
impl !Freeze for IndexedSMTContext
impl !RefUnwindSafe for IndexedSMTContext
impl !Send for IndexedSMTContext
impl !Sync for IndexedSMTContext
impl Unpin for IndexedSMTContext
impl !UnwindSafe for IndexedSMTContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more