BddVarManager

Struct BddVarManager 

Source
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: BDDManager

The 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

§shared_interval_to_bdd: HashMap<Variable, HashMap<Interval, BDD>>

Mapping for each variable from unprimed interval to the corresponding BDD

§shared_primed_interval_to_bdd: HashMap<Variable, HashMap<Interval, 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

Source

pub fn new(mgr: BDDManager, automaton: &IntervalThresholdAutomaton) -> Self

creates a new BDDVarManager

Source

fn initialize(&mut self, aut: &IntervalThresholdAutomaton)

initializes the bdd_var_manager

  1. create unprimed and primed location vars
  2. create unprimed and primed shared variable intervals
  3. create bdd_variables to represent rules
  4. create ordered vectors for all unprimed and primed bdd variables
Source

fn initialize_loc_vars(&mut self, aut: &IntervalThresholdAutomaton)

initializes all unprimed and primed bdd variables for locations

Source

fn initialize_shared_vars(&mut self, aut: &IntervalThresholdAutomaton)

initializes all unprimed and primed bdd variables for shared variables

Source

fn initialize_rule_vars(&mut self, aut: &IntervalThresholdAutomaton)

Source

pub fn get_location_var( &self, loc: &Location, ) -> Result<&BDD, BDDVarManagerError>

get the BDD variable for a location

Source

pub fn get_primed_location_var( &self, loc: &Location, ) -> Result<&BDD, BDDVarManagerError>

get the primed BDD variable for a location

Source

pub fn get_shared_interval_bdd( &self, shared: &Variable, interval: &Interval, ) -> Result<&BDD, BDDVarManagerError>

get the BDD variables for a shared variable

Source

pub fn get_primed_shared_interval_bdd( &self, shared: &Variable, interval: &Interval, ) -> Result<&BDD, BDDVarManagerError>

get the primed BDD variables for a shared variable

Source

pub fn get_rule_bdd( &self, rule: &IntervalTARule, ) -> Result<&BDD, BDDVarManagerError>

get the BDD for an abstract rule

Source

pub fn get_bdd_true(&self) -> BDD

get the constant true BDD

Source

pub fn get_bdd_false(&self) -> BDD

get the constant false BDD

Source

fn new_location_var(&mut self, loc: &Location)

creates and stores a new bdd variable to represent a given location

Source

fn new_primed_location_var(&mut self, loc: &Location)

creates and stores a new primed bdd variable to represent a given location

Source

fn new_shared_var(&mut self, shared: &Variable)

creates and stores a new bdd variable to represent the interval of a shared variable

Source

fn new_primed_shared_var(&mut self, shared: &Variable)

creates and stores a new primed bdd variable to represent the interval of a shared variable

Source

fn new_rule_var(&mut self)

creates and stores a new bdd variable to represent a rule

Source

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

Source

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

Source

fn create_unprimed_primed_vecs(&mut self)

Creates an ordered vector for all unprimed and primed bdd variables

Source

pub fn swap_unprimed_primed_bdd_vars(&self, cur: &BDD) -> BDD

Swaps all unprimed and primed bdd variables for cur

Source

pub fn exists_unprimed(&self, cur: &BDD) -> BDD

abstracts all bdd variables for unprimed locations and unprimed shared variables for a given bdd

Source

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

Source

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

Source§

fn clone(&self) -> BddVarManager

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BddVarManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.