pub struct BddVarManager {
manager: BDDManager,
loc_vars: HashMap<Location, BDD>,
loc_vars_primed: HashMap<Location, BDD>,
variable_vars: HashMap<Variable, Vec<BDD>>,
variable_vars_primed: HashMap<Variable, Vec<BDD>>,
shared_interval_to_bdd: HashMap<Variable, HashMap<Interval, BDD>>,
shared_primed_interval_to_bdd: HashMap<Variable, HashMap<Interval, BDD>>,
rule_vars: Vec<BDD>,
rule_to_bdd: HashMap<IntervalTARule, BDD>,
unprimed_vars_vec: Vec<BDD>,
primed_vars_vec: Vec<BDD>,
}Expand description
Manager for BDD variables for an underlying IntervalThresholdAutomaton
Fields§
§manager: BDDManagerThe BDD manager
loc_vars: HashMap<Location, BDD>BDD variables for each location
loc_vars_primed: HashMap<Location, BDD>Location successor BDD variables
variable_vars: HashMap<Variable, Vec<BDD>>BDD variables for each variable
variable_vars_primed: HashMap<Variable, Vec<BDD>>Variable successor BDD variables
Mapping for each variable from unprimed interval to the corresponding BDD
Mapping for each variable from primed interval to the correspond BDD
rule_vars: Vec<BDD>BDD variables to represent the rule_id
rule_to_bdd: HashMap<IntervalTARule, BDD>Mapping from abstract rule to the corresponding BDD
unprimed_vars_vec: Vec<BDD>All unprimed bdd variables for locations and shared variables
primed_vars_vec: Vec<BDD>All primed bdd variables for locations and shared variables
Implementations§
Source§impl BddVarManager
impl BddVarManager
Sourcepub fn new(mgr: BDDManager, automaton: &IntervalThresholdAutomaton) -> Self
pub fn new(mgr: BDDManager, automaton: &IntervalThresholdAutomaton) -> Self
creates a new BDDVarManager
Sourcefn initialize(&mut self, aut: &IntervalThresholdAutomaton)
fn initialize(&mut self, aut: &IntervalThresholdAutomaton)
initializes the bdd_var_manager
- create unprimed and primed location vars
- create unprimed and primed shared variable intervals
- create bdd_variables to represent rules
- create ordered vectors for all unprimed and primed bdd variables
Sourcefn initialize_loc_vars(&mut self, aut: &IntervalThresholdAutomaton)
fn initialize_loc_vars(&mut self, aut: &IntervalThresholdAutomaton)
initializes all unprimed and primed bdd variables for locations
initializes all unprimed and primed bdd variables for shared variables
fn initialize_rule_vars(&mut self, aut: &IntervalThresholdAutomaton)
Sourcepub fn get_location_var(
&self,
loc: &Location,
) -> Result<&BDD, BDDVarManagerError>
pub fn get_location_var( &self, loc: &Location, ) -> Result<&BDD, BDDVarManagerError>
get the BDD variable for a location
Sourcepub fn get_primed_location_var(
&self,
loc: &Location,
) -> Result<&BDD, BDDVarManagerError>
pub fn get_primed_location_var( &self, loc: &Location, ) -> Result<&BDD, BDDVarManagerError>
get the primed BDD variable for a location
get the BDD variables for a shared variable
get the primed BDD variables for a shared variable
Sourcepub fn get_rule_bdd(
&self,
rule: &IntervalTARule,
) -> Result<&BDD, BDDVarManagerError>
pub fn get_rule_bdd( &self, rule: &IntervalTARule, ) -> Result<&BDD, BDDVarManagerError>
get the BDD for an abstract rule
Sourcepub fn get_bdd_true(&self) -> BDD
pub fn get_bdd_true(&self) -> BDD
get the constant true BDD
Sourcepub fn get_bdd_false(&self) -> BDD
pub fn get_bdd_false(&self) -> BDD
get the constant false BDD
Sourcefn new_location_var(&mut self, loc: &Location)
fn new_location_var(&mut self, loc: &Location)
creates and stores a new bdd variable to represent a given location
Sourcefn new_primed_location_var(&mut self, loc: &Location)
fn new_primed_location_var(&mut self, loc: &Location)
creates and stores a new primed bdd variable to represent a given location
creates and stores a new bdd variable to represent the interval of a shared variable
creates and stores a new primed bdd variable to represent the interval of a shared variable
Sourcefn new_rule_var(&mut self)
fn new_rule_var(&mut self)
creates and stores a new bdd variable to represent a rule
Sourcefn encode_bitwise_bdd(&self, index: u32, bdd_vars: &[BDD]) -> BDD
fn encode_bitwise_bdd(&self, index: u32, bdd_vars: &[BDD]) -> BDD
Given index and a vector of bdd variables,
Returns the bitwise encoded bdd for index if enough bdd variables are provided
Sourcepub fn get_unchanged_interval_bdd(
&self,
shared: &Variable,
) -> Result<BDD, BDDVarManagerError>
pub fn get_unchanged_interval_bdd( &self, shared: &Variable, ) -> Result<BDD, BDDVarManagerError>
Constructs a constraint which checks that the bdd variables for an unprimed and primed shared variable are unchanged
Sourcefn create_unprimed_primed_vecs(&mut self)
fn create_unprimed_primed_vecs(&mut self)
Creates an ordered vector for all unprimed and primed bdd variables
Sourcepub fn swap_unprimed_primed_bdd_vars(&self, cur: &BDD) -> BDD
pub fn swap_unprimed_primed_bdd_vars(&self, cur: &BDD) -> BDD
Swaps all unprimed and primed bdd variables for cur
Sourcepub fn exists_unprimed(&self, cur: &BDD) -> BDD
pub fn exists_unprimed(&self, cur: &BDD) -> BDD
abstracts all bdd variables for unprimed locations and unprimed shared variables for a given bdd
Sourcepub fn exists_primed(&self, cur: &BDD) -> BDD
pub fn exists_primed(&self, cur: &BDD) -> BDD
abstracts all primed bdd variables for primed locations and primed shared variables for a given bdd cur
Sourcepub fn exists_rule_vars(&self, cur: &BDD) -> BDD
pub fn exists_rule_vars(&self, cur: &BDD) -> BDD
abstracts all bdd variables for rule_ids for a given bdd cur
Trait Implementations§
Source§impl Clone for BddVarManager
impl Clone for BddVarManager
Source§fn clone(&self) -> BddVarManager
fn clone(&self) -> BddVarManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BddVarManager
impl !RefUnwindSafe for BddVarManager
impl !Send for BddVarManager
impl !Sync for BddVarManager
impl Unpin for BddVarManager
impl !UnwindSafe for BddVarManager
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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