pub enum BitvectorDomain {
    Top(ByteSize),
    Value(Bitvector),
}
Expand description

The BitvectorDomain is a simple abstract domain describing a bitvector of known length.

As values it can only assume a known bitvector or Top(bytesize).

Variants§

§

Top(ByteSize)

The Top value of the domain, representing the case that nothing is known about the actual value.

§

Value(Bitvector)

The exact value of the bitvector is known.

Trait Implementations§

source§

impl AbstractDomain for BitvectorDomain

source§

fn merge(&self, other: &Self) -> Self

merge two values. Returns Top if the values are not equal.

source§

fn is_top(&self) -> bool

Check if the value is Top.

source§

fn merge_with(&mut self, other: &Self) -> &mut Self

Returns an upper bound (with respect to the partial order on the domain) for the two inputs self and other. Read more
source§

impl Add for BitvectorDomain

§

type Output = BitvectorDomain

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
source§

impl Clone for BitvectorDomain

source§

fn clone(&self) -> BitvectorDomain

Returns a copy 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 BitvectorDomain

source§

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

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for BitvectorDomain

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for BitvectorDomain

source§

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

Formats the value using the given formatter. Read more
source§

impl From<ApInt> for BitvectorDomain

source§

fn from(bitvector: Bitvector) -> BitvectorDomain

Converts to this type from the input type.
source§

impl HasTop for BitvectorDomain

source§

fn top(&self) -> BitvectorDomain

Return a Top value with the same bytesize as self.

source§

impl Hash for BitvectorDomain

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Neg for BitvectorDomain

§

type Output = BitvectorDomain

The resulting type after applying the - operator.
source§

fn neg(self) -> Self

Performs the unary - operation. Read more
source§

impl PartialEq for BitvectorDomain

source§

fn eq(&self, other: &BitvectorDomain) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl RegisterDomain for BitvectorDomain

source§

fn bin_op(&self, op: BinOpType, rhs: &Self) -> Self

Evaluate the given binary operation.

For non-shift operations, this function will panic if the operands have different bitsizes.

source§

fn un_op(&self, op: UnOpType) -> Self

Evaluate the given unary operation.

source§

fn subpiece(&self, low_byte: ByteSize, size: ByteSize) -> Self

Extract a sub-bitvector out of a bitvector

source§

fn cast(&self, kind: CastOpType, width: ByteSize) -> Self

Perform a size-changing cast on a bitvector.

source§

fn bin_op_bytesize(&self, op: BinOpType, rhs: &Self) -> ByteSize

Return the bytesize of the result of the given binary operation. Has a generic implementation that should not be overwritten!
source§

impl Serialize for BitvectorDomain

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SizedDomain for BitvectorDomain

source§

fn bytesize(&self) -> ByteSize

Return the bytesize of self.

source§

fn new_top(bytesize: ByteSize) -> BitvectorDomain

Get a Top element with the given bitsize.

source§

impl Sub for BitvectorDomain

§

type Output = BitvectorDomain

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
source§

impl TryToBitvec for BitvectorDomain

source§

fn try_to_bitvec(&self) -> Result<Bitvector, Error>

If the domain represents an absoulute value, return it.

source§

fn try_to_offset(&self) -> Result<i64, Error>

If self represents a single absolute value, try to convert it to a signed integer and return it. Else return an error. Note that the conversion loses information about the bytesize of the value.
source§

impl TryToInterval for BitvectorDomain

source§

fn try_to_interval(&self) -> Result<Interval, Error>

If the domain represents an absolute value, return it as an interval of length one.

source§

fn try_to_offset_interval(&self) -> Result<(i64, i64), Error>

If self represents an interval of absolute values (or can be widened to represent such an interval) then return it as an interval of signed integers of the form (start, end) if the interval is bounded. Else return an error. Note that the conversion loses information about the bytesize of the values contained in the interval.
source§

impl Eq for BitvectorDomain

source§

impl StructuralEq for BitvectorDomain

source§

impl StructuralPartialEq for BitvectorDomain

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,