pub struct AbstractInterpretation {
pub domain: HashMap<String, IntervalDomain>,
}Expand description
Abstract interpretation engine using the interval domain.
Fields§
§domain: HashMap<String, IntervalDomain>Abstract domain for each tracked variable.
Implementations§
Source§impl AbstractInterpretation
impl AbstractInterpretation
Sourcepub fn bind(&mut self, var: impl Into<String>, value: f64)
pub fn bind(&mut self, var: impl Into<String>, value: f64)
Bind a variable to a concrete value (singleton interval).
Sourcepub fn bind_interval(
&mut self,
var: impl Into<String>,
interval: IntervalDomain,
)
pub fn bind_interval( &mut self, var: impl Into<String>, interval: IntervalDomain, )
Bind a variable to an abstract interval.
Sourcepub fn get(&self, var: &str) -> IntervalDomain
pub fn get(&self, var: &str) -> IntervalDomain
Return the abstract value of a variable, or top() if unknown.
Sourcepub fn analyze_loop(
&mut self,
var: &str,
delta: IntervalDomain,
max_iter: usize,
) -> IntervalDomain
pub fn analyze_loop( &mut self, var: &str, delta: IntervalDomain, max_iter: usize, ) -> IntervalDomain
Analyze a simple loop that adds delta to var each iteration for at
most max_iter iterations, using widening to ensure termination.
Returns the post-loop interval for var.
Sourcepub fn widening(
&self,
prev: &IntervalDomain,
next: &IntervalDomain,
) -> IntervalDomain
pub fn widening( &self, prev: &IntervalDomain, next: &IntervalDomain, ) -> IntervalDomain
Widening operator: extends the interval to ensure convergence.
If the lower bound decreases it goes to -∞; if the upper bound
increases it goes to +∞.
Sourcepub fn narrowing(
&self,
prev: &IntervalDomain,
next: &IntervalDomain,
) -> IntervalDomain
pub fn narrowing( &self, prev: &IntervalDomain, next: &IntervalDomain, ) -> IntervalDomain
Narrowing operator: refines an over-approximation using additional concrete information.
Sourcepub fn is_non_negative(&self, var: &str) -> bool
pub fn is_non_negative(&self, var: &str) -> bool
Check that var is always non-negative under the current abstraction.
Sourcepub fn is_bounded(&self, var: &str) -> bool
pub fn is_bounded(&self, var: &str) -> bool
Check that var is bounded (finite interval bounds).
Trait Implementations§
Source§impl Clone for AbstractInterpretation
impl Clone for AbstractInterpretation
Source§fn clone(&self) -> AbstractInterpretation
fn clone(&self) -> AbstractInterpretation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AbstractInterpretation
impl Debug for AbstractInterpretation
Auto Trait Implementations§
impl Freeze for AbstractInterpretation
impl RefUnwindSafe for AbstractInterpretation
impl Send for AbstractInterpretation
impl Sync for AbstractInterpretation
impl Unpin for AbstractInterpretation
impl UnsafeUnpin for AbstractInterpretation
impl UnwindSafe for AbstractInterpretation
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.