pub struct IndexCtx {
loc_to_index: HashMap<Location, ACSLocation>,
index_to_loc: HashMap<ACSLocation, Location>,
var_to_index: HashMap<Variable, CSVariable>,
index_to_var: HashMap<CSVariable, Variable>,
interval_to_index: Vec<HashMap<Interval, ACSInterval>>,
index_to_interval: Vec<HashMap<ACSInterval, Interval>>,
}Expand description
Context providing a mapping from locations, variables and intervals to indices or in this case types that can be used as indices
Fields§
§loc_to_index: HashMap<Location, ACSLocation>Map from [Location]s to ACSLocations
index_to_loc: HashMap<ACSLocation, Location>Map from ACSLocations to [Location]s
var_to_index: HashMap<Variable, CSVariable>Map from [Variable]s to CSVariables
index_to_var: HashMap<CSVariable, Variable>Map from CSVariables to [Variable]s
interval_to_index: Vec<HashMap<Interval, ACSInterval>>Map from a CSVariable and an [Interval] to ACSInterval
index_to_interval: Vec<HashMap<ACSInterval, Interval>>Map from a CSVariable and an ACSInterval to an [Interval]
Implementations§
Source§impl IndexCtx
impl IndexCtx
Sourcepub fn new(ta: &IntervalThresholdAutomaton) -> Self
pub fn new(ta: &IntervalThresholdAutomaton) -> Self
Create a new IndexCtx for the given interval threshold automaton
Sourcepub fn to_cs_loc(&self, loc: &Location) -> ACSLocation
pub fn to_cs_loc(&self, loc: &Location) -> ACSLocation
Translate from a [Location] to the corresponding ACSLocation
Sourcepub fn get_loc(&self, loc: &ACSLocation) -> &Location
pub fn get_loc(&self, loc: &ACSLocation) -> &Location
Translate from a ACSLocation to the corresponding [Location]
Sourcepub fn locations(&self) -> impl Iterator<Item = (&Location, &ACSLocation)>
pub fn locations(&self) -> impl Iterator<Item = (&Location, &ACSLocation)>
Iterate over all locations in the index
Sourcepub fn to_cs_var(&self, var: &Variable) -> CSVariable
pub fn to_cs_var(&self, var: &Variable) -> CSVariable
Translate from a [Variable] to the corresponding CSVariable
Sourcepub fn get_var(&self, var: &CSVariable) -> &Variable
pub fn get_var(&self, var: &CSVariable) -> &Variable
Translate from a CSVariable to the corresponding [Variable]
Sourcepub fn variables(&self) -> impl Iterator<Item = (&Variable, &CSVariable)>
pub fn variables(&self) -> impl Iterator<Item = (&Variable, &CSVariable)>
Iterate over all variables in the context
Sourcepub fn to_cs_interval(&self, var: &CSVariable, i: &Interval) -> ACSInterval
pub fn to_cs_interval(&self, var: &CSVariable, i: &Interval) -> ACSInterval
Translate from an [Interval] of CSVariable to the corresponding
ACSInterval
Sourcepub fn get_interval(&self, var: &CSVariable, i: &ACSInterval) -> &Interval
pub fn get_interval(&self, var: &CSVariable, i: &ACSInterval) -> &Interval
Translate from an ACSInterval of CSVariable to the corresponding
[Interval]
Sourcepub fn interval_exists(&self, var: &CSVariable, interval: ACSInterval) -> bool
pub fn interval_exists(&self, var: &CSVariable, interval: ACSInterval) -> bool
Check whether the interval ACSInterval for variable CSVariable
exists
Sourcepub fn intervals(
&self,
var: &CSVariable,
) -> impl Iterator<Item = (&Interval, &ACSInterval)>
pub fn intervals( &self, var: &CSVariable, ) -> impl Iterator<Item = (&Interval, &ACSInterval)>
Iterate over all intervals of the given CSVariable
Trait Implementations§
impl StructuralPartialEq for IndexCtx
Auto Trait Implementations§
impl Freeze for IndexCtx
impl RefUnwindSafe for IndexCtx
impl Send for IndexCtx
impl Sync for IndexCtx
impl Unpin for IndexCtx
impl UnwindSafe for IndexCtx
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