pub struct AbstractIdentifier(/* private fields */);
Expand description

An abstract identifier is used to identify an object or a value in an abstract state.

Since many program states can be represented by the same abstract state in data-flow analysis, one sometimes needs a way to uniquely identify a variable or a memory object in all of the represented program states. Abstract identifiers achieve this by identifying a time, i.e. a specific abstract state, and a location, i.e. a recipe for computing a concrete value from any concrete state that is represented by the abstract state. The value in question then serves as the identifier. For example, a pointer may uniquely determine the memory object it is pointing to. Or a value may represent the value of a variable at a certain time, whereas the value of the variable in the current state is given as an offset to the value at the identified time.

Since program points may be visited several times during an execution trace (e.g. in loops), the time component of an abstract identifier may not actually determine an unique point in time of an execution trace. In this case the meaning of an abstract identifier depends upon its use case. E.g. it may represent the union of all values at the specific location for each time the program point is visited during an execution trace or it may only represent the value at the last time the program point was visited.

Alternatively, one can also add path hints to an identifier to further distinguish points in time in an execution trace. Path hints are given as a possibly empty array of time identifiers. To prevent infinitely long path hints, each time identifier is only allowed to appear at most once in the array. The specific meaning of the path hints depends upon the use case.

An abstract identifier is given by a time identifier, a location identifier and a path hints array (containing time identifiers).

For the location identifier see AbstractLocation. The time identifier is given by a Tid. If it is the Tid of a basic block, then it describes the point in time before execution of the first instruction in the block. If it is the Tid of a Def or Jmp, then it describes the point in time after the execution of the Def or Jmp.

Implementations§

source§

impl AbstractIdentifier

source

pub fn new(time: Tid, location: AbstractLocation) -> AbstractIdentifier

Create a new abstract identifier.

source

pub fn from_var(time: Tid, variable: &Variable) -> AbstractIdentifier

Create a new abstract identifier where the abstract location is a register. Panics if the register is a temporary register.

source

pub fn from_arg(time: &Tid, arg: &Arg) -> AbstractIdentifier

Create an abstract identifier from a parameter argument.

If the argument is a sub-register, then the created identifier contains the whole base register.

source

pub fn from_global_address( time: &Tid, address: &Bitvector ) -> AbstractIdentifier

Create an abstract identifier from an address into global memory.

source

pub fn with_path_hint(&self, path_hint: Tid) -> Result<Self, Error>

Create a new abstract identifier by pushing the given path hint to the array of path hints of self. Returns an error if the path hint is already contained in the path hints of self.

source

pub fn without_last_path_hint(&self) -> (Self, Option<Tid>)

Create a new abstract identifier by removing the last path hint from the path hint array of self. Return the new identifier together with the removed path hint (or none if self has no path hints).

source

pub fn get_path_hints(&self) -> &[Tid]

Get the path hints array of self.

source

pub fn unwrap_register(&self) -> &Variable

Get the register associated to the abstract location. Panics if the abstract location is not a register but a memory location.

source

pub fn get_tid(&self) -> &Tid

Get the TID representing the time component of the abstract ID.

source

pub fn get_location(&self) -> &AbstractLocation

Get the location component of the abstract ID.

source

pub fn bytesize(&self) -> ByteSize

Get the bytesize of the value represented by the abstract ID.

source

pub fn get_id_with_parent_location( &self, generic_pointer_size: ByteSize ) -> Option<AbstractIdentifier>

If the abstract location of self has a parent location then return the ID one gets when replacing the abstract location in self with its parent location.

Trait Implementations§

source§

impl Clone for AbstractIdentifier

source§

fn clone(&self) -> AbstractIdentifier

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 AbstractIdentifier

source§

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

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

impl Deref for AbstractIdentifier

§

type Target = <Arc<AbstractIdentifierData> as Deref>::Target

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'de> Deserialize<'de> for AbstractIdentifier

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 AbstractIdentifier

source§

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

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

impl Hash for AbstractIdentifier

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 Ord for AbstractIdentifier

source§

fn cmp(&self, other: &AbstractIdentifier) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for AbstractIdentifier

source§

fn eq(&self, other: &AbstractIdentifier) -> 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 PartialOrd for AbstractIdentifier

source§

fn partial_cmp(&self, other: &AbstractIdentifier) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for AbstractIdentifier

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 Eq for AbstractIdentifier

source§

impl StructuralEq for AbstractIdentifier

source§

impl StructuralPartialEq for AbstractIdentifier

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> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

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