mcrl2::data::data_terms

Struct DataVariable

Source
pub struct DataVariable { /* private fields */ }

Implementations§

Source§

impl DataVariable

Source

pub fn new(tp: &mut TermPool, name: &str) -> DataVariable

Create a new untyped variable with the given name.

Source

pub fn with_sort( tp: &mut TermPool, name: &str, sort: &SortExpressionRef<'_>, ) -> DataVariable

Create a variable with the given sort and name.

Source

pub fn name(&self) -> &str

Returns the name of the variable.

Source

pub fn sort(&self) -> SortExpressionRef<'_>

Returns the sort of the variable.

Source§

impl DataVariable

Source

pub fn copy<'a>(&'a self) -> DataVariableRef<'a>

Methods from Deref<Target = ATermRef<'static>>§

Source

pub fn protect(&self) -> ATerm

Protects the reference on the thread local protection pool.

Source

pub fn protect_global(&self) -> ATermGlobal

Protects the reference on the global protection pool.

Source

pub fn upgrade<'b: 'a>(&'a self, parent: &ATermRef<'b>) -> ATermRef<'b>

This allows us to extend our borrowed lifetime from ’a to ’b based on existing parent term which has lifetime ’b.

The main usecase is to establish transitive lifetimes. For example given a term t from which we borrow u = t.arg(0) then we cannot have u.arg(0) live as long as t since the intermediate temporary u is dropped. However, since we know that u.arg(0) is a subterm of t we can upgrade its lifetime to the lifetime of t using this function.

§Safety

This function might only be used if witness is a parent term of the current term.

Source

pub fn arg(&self, index: usize) -> ATermRef<'_>

Returns the indexed argument of the term

Source

pub fn arguments(&self) -> ATermArgs<'_>

Returns the list of arguments as a collection

Source

pub fn copy(&self) -> ATermRef<'_>

Makes a copy of the term with the same lifetime as itself.

Source

pub fn is_default(&self) -> bool

Returns whether the term is the default term (not initialised)

Source

pub fn is_list(&self) -> bool

Returns true iff this is an aterm_list

Source

pub fn is_empty_list(&self) -> bool

Returns true iff this is the empty aterm_list

Source

pub fn is_int(&self) -> bool

Returns true iff this is a aterm_int

Source

pub fn get_head_symbol(&self) -> SymbolRef<'_>

Returns the head function symbol of the term.

Source

pub fn iter(&self) -> TermIterator<'_>

Returns an iterator over all arguments of the term that runs in pre order traversal of the term trees.

Source

pub fn require_valid(&self)

Panics if the term is default

Trait Implementations§

Source§

impl Borrow<ATerm> for DataVariable

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATermRef<'static>> for DataVariable

Source§

fn borrow(&self) -> &ATermRef<'static>

Immutably borrows from an owned value. Read more
Source§

impl Clone for DataVariable

Source§

fn clone(&self) -> DataVariable

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 DataVariable

Source§

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

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

impl Default for DataVariable

Source§

fn default() -> DataVariable

Returns the “default value” for a type. Read more
Source§

impl Deref for DataVariable

Source§

type Target = ATerm

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Display for DataVariable

Source§

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

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

impl From<ATerm> for DataVariable

Source§

fn from(term: ATerm) -> DataVariable

Converts to this type from the input type.
Source§

impl From<DataVariable> for DataExpression

Source§

fn from(value: DataVariable) -> Self

Converts to this type from the input type.
Source§

impl Hash for DataVariable

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 Into<ATerm> for DataVariable

Source§

fn into(self) -> ATerm

Converts this type into the (usually inferred) input type.
Source§

impl Markable for DataVariable

Source§

fn mark(&self, todo: Todo<'_>)

Marks all the ATermRefs to prevent them from being garbage collected.
Source§

fn contains_term(&self, term: &ATermRef<'_>) -> bool

Should return true iff the given term is contained in the object. Used for runtime checks.
Source§

fn len(&self) -> usize

Returns the number of terms in the instance, used to delay garbage collection.
Source§

fn is_empty(&self) -> bool

Returns true iff the container is empty.
Source§

impl Ord for DataVariable

Source§

fn cmp(&self, other: &DataVariable) -> 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,

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

impl PartialEq for DataVariable

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for DataVariable

Source§

fn partial_cmp(&self, other: &DataVariable) -> 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

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

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

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Eq for DataVariable

Source§

impl StructuralPartialEq for DataVariable

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
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

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

Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V