[−][src]Enum gf::support::lattice::FlatLattice
Lattice constructed from a set by adding dedicated bottom and top elements.
Example
This example uses FlatLattice
to reason about integer values, like in an
integer constant propagation pass.
let a = FlatLattice::from(10u32); let b = FlatLattice::from(20u32); assert_eq!(Meet::meet(&a, &a), a); assert_eq!(Meet::meet(&a, &b), FlatLattice::Bottom); assert_eq!(Join::join(&a, &a), a); assert_eq!(Join::join(&a, &b), FlatLattice::Top);
Variants
Dedicated bottom element, ⊥.
Dedicated top element, ⊤.
Inner element.
Implementations
impl<T> FlatLattice<T>
[src]
pub fn from_vec(vec: Vec<FlatLattice<T>>) -> FlatLattice<Vec<T>>
[src]
Convert from a Vec<FlatLattice<T>>
to FlatLattice<Vec<T>>
.
If the vector contains a ⊥, the result is also ⊥. Otherwise, if the vector contains a ⊤, the result is also ⊤. Otherwise, the result is an inner element.
pub fn as_ref(&self) -> FlatLattice<&T>
[src]
Convert from a &FlatLattice<T>
to FlatLattice<&T>
.
pub fn is_inner(&self) -> bool
[src]
Return whether the FlatLattice
contains an inner element.
pub fn unwrap(self) -> T
[src]
Unwrap an inner element.
Errors
- Panics if
FlatLattice
contains a bottom element. - Panics if
FlatLattice
contains a top element.
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> FlatLattice<U>
[src]
Map inner elements using f
, while preserving dedicated bottom and top
elements.
pub fn map_bottom<F: FnOnce() -> Self>(self, f: F) -> Self
[src]
Map bottom elements using f
, while preserving inner and top elements.
pub fn map_top<F: FnOnce() -> Self>(self, f: F) -> Self
[src]
Map top elements using f
, while preserving inner and bottom elements.
pub fn and_then<U, F: FnOnce(T) -> FlatLattice<U>>(self, f: F) -> FlatLattice<U>
[src]
Map inner elements using f
which may also return bottom or top, while
preserving bottom and top elements.
impl<'a, T: Clone> FlatLattice<&'a T>
[src]
pub fn cloned(self) -> FlatLattice<T>
[src]
Convert from a FlatLattice<&T>
to FlatLattice<T>
by cloning the
element.
impl<'a, T: Copy> FlatLattice<&'a T>
[src]
pub fn copied(self) -> FlatLattice<T>
[src]
Convert from a FlatLattice<&T>
to FlatLattice<T>
by copying the
element.
Trait Implementations
impl<T: Eq> Bottom for FlatLattice<T>
[src]
fn bottom() -> Self
[src]
fn is_bottom(&self) -> bool
[src]
fn to_option(self) -> Option<Self>
[src]
fn reset_to_bottom(&mut self)
[src]
impl<T: Clone> Clone for FlatLattice<T>
[src]
fn clone(&self) -> FlatLattice<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<A: IntoU128> ConstSpaceState<A, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn load(
&mut self,
span: SpaceSpan<A>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<A>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl<A: IntoU128> ConstSpaceState<A, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn load(&mut self, span: SpaceSpan<A>) -> (FlatLattice<Expr>, FlatLattice<Expr>)
[src]
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl ConstSpaceState<BitVec, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn load(
&mut self,
span: SpaceSpan<BitVec>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<BitVec>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl ConstSpaceState<BitVec, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn load(
&mut self,
span: SpaceSpan<BitVec>
) -> (FlatLattice<Expr>, FlatLattice<Expr>)
[src]
&mut self,
span: SpaceSpan<BitVec>
) -> (FlatLattice<Expr>, FlatLattice<Expr>)
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl ConstSpaceState<FlatLattice<BitVec>, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn load(
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>
) -> (FlatLattice<BitVec>, FlatLattice<BitVec>)
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl ConstSpaceState<FlatLattice<BitVec>, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn load(
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>
) -> (FlatLattice<Expr>, FlatLattice<Expr>)
[src]
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>
) -> (FlatLattice<Expr>, FlatLattice<Expr>)
fn load_result(&mut self, span: SpaceSpan<A>) -> Result<V, V>
[src]
impl<T: Copy> Copy for FlatLattice<T>
[src]
impl<T: Debug> Debug for FlatLattice<T>
[src]
impl<T: Eq> Eq for FlatLattice<T>
[src]
impl<T> From<T> for FlatLattice<T>
[src]
impl<T: Hash> Hash for FlatLattice<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Clone + Eq> Join for FlatLattice<T>
[src]
impl<T: Clone + Eq> Meet for FlatLattice<T>
[src]
impl<T: PartialEq> PartialEq<FlatLattice<T>> for FlatLattice<T>
[src]
fn eq(&self, other: &FlatLattice<T>) -> bool
[src]
fn ne(&self, other: &FlatLattice<T>) -> bool
[src]
impl<A: IntoU128> SpaceState<A, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<A>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<A>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl<A: IntoU128> SpaceState<A, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<A>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
[src]
&mut self,
span: SpaceSpan<A>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl SpaceState<BitVec, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<BitVec>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<BitVec>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl SpaceState<BitVec, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<BitVec>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
[src]
&mut self,
span: SpaceSpan<BitVec>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl SpaceState<FlatLattice<BitVec>, FlatLattice<BitVec>> for ConcreteSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
[src]
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>,
value: FlatLattice<BitVec>
) -> (Option<()>, FlatLattice<BitVec>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl SpaceState<FlatLattice<BitVec>, FlatLattice<Expr>> for SymbolicSpaceState
[src]
fn store(
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
[src]
&mut self,
span: SpaceSpan<FlatLattice<BitVec>>,
value: FlatLattice<Expr>
) -> (Option<()>, FlatLattice<Expr>)
fn store_result(
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
[src]
&mut self,
span: SpaceSpan<A>,
value: V
) -> Result<Option<()>, V>
impl<T> StructuralEq for FlatLattice<T>
[src]
impl<T> StructuralPartialEq for FlatLattice<T>
[src]
impl<T: Eq> Top for FlatLattice<T>
[src]
impl<T: Clone + Eq + Ord> ValueSet<T> for FlatLattice<T>
[src]
fn singleton(member: T) -> Self
[src]
fn card(&self) -> FlatLattice<NonZeroUsize>
[src]
fn has_member(&self, value: &T) -> bool
[src]
fn as_singleton(&self) -> FlatLattice<&T>
[src]
fn to_sorted_vec(&self) -> FlatLattice<Vec<T>>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for FlatLattice<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for FlatLattice<T> where
T: Send,
T: Send,
impl<T> Sync for FlatLattice<T> where
T: Sync,
T: Sync,
impl<T> Unpin for FlatLattice<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for FlatLattice<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,