mcrl2::aterm::term

Struct ATerm

Source
pub struct ATerm { /* private fields */ }
Expand description

The protected version of ATermRef, mostly derived from it.

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 BasicSort

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for BoolSort

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for DataApplication

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for DataExpression

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for DataFunctionSymbol

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for DataVariable

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for FunctionSort

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl Borrow<ATerm> for SortExpression

Source§

fn borrow(&self) -> &ATerm

Immutably borrows from an owned value. Read more
Source§

impl<'a> Borrow<ATermRef<'a>> for ATerm

Source§

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

Immutably borrows from an owned value. Read more
Source§

impl Clone for ATerm

Source§

fn clone(&self) -> Self

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 ATerm

Source§

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

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

impl Default for ATerm

Source§

fn default() -> ATerm

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

impl Deref for ATerm

Source§

type Target = ATermRef<'static>

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl Display for ATerm

Source§

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

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

impl Drop for ATerm

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<&aterm> for ATerm

Source§

fn from(value: &aterm) -> Self

Converts to this type from the input type.
Source§

impl From<ATerm> for ATermGlobal

Source§

fn from(value: ATerm) -> Self

Converts to this type from the input type.
Source§

impl<T> From<ATerm> for ATermList<T>

Source§

fn from(value: ATerm) -> Self

Converts to this type from the input type.
Source§

impl From<ATerm> for BasicSort

Source§

fn from(term: ATerm) -> BasicSort

Converts to this type from the input type.
Source§

impl From<ATerm> for BoolSort

Source§

fn from(term: ATerm) -> BoolSort

Converts to this type from the input type.
Source§

impl From<ATerm> for DataApplication

Source§

fn from(term: ATerm) -> DataApplication

Converts to this type from the input type.
Source§

impl From<ATerm> for DataEquation

Source§

fn from(value: ATerm) -> Self

Converts to this type from the input type.
Source§

impl From<ATerm> for DataExpression

Source§

fn from(term: ATerm) -> DataExpression

Converts to this type from the input type.
Source§

impl From<ATerm> for DataFunctionSymbol

Source§

fn from(term: ATerm) -> DataFunctionSymbol

Converts to this type from the input type.
Source§

impl From<ATerm> for DataVariable

Source§

fn from(term: ATerm) -> DataVariable

Converts to this type from the input type.
Source§

impl From<ATerm> for FunctionSort

Source§

fn from(term: ATerm) -> FunctionSort

Converts to this type from the input type.
Source§

impl From<ATerm> for SortExpression

Source§

fn from(term: ATerm) -> SortExpression

Converts to this type from the input type.
Source§

impl<T> From<ATermList<T>> for ATerm

Source§

fn from(value: ATermList<T>) -> Self

Converts to this type from the input type.
Source§

impl From<UniquePtr<aterm>> for ATerm

Source§

fn from(value: UniquePtr<aterm>) -> Self

Converts to this type from the input type.
Source§

impl Hash for ATerm

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 BasicSort

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for BoolSort

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for DataApplication

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for DataExpression

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for DataFunctionSymbol

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for DataVariable

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for FunctionSort

Source§

fn into(self) -> ATerm

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

impl Into<ATerm> for SortExpression

Source§

fn into(self) -> ATerm

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

impl Ord for ATerm

Source§

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

Source§

fn eq(&self, other: &Self) -> 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 ATerm

Source§

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

Auto Trait Implementations§

§

impl Freeze for ATerm

§

impl RefUnwindSafe for ATerm

§

impl !Send for ATerm

§

impl Sync for ATerm

§

impl Unpin for ATerm

§

impl UnwindSafe for ATerm

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