pub struct DataVariable { /* private fields */ }
Implementations§
Source§impl DataVariable
impl DataVariable
Sourcepub fn new(tp: &mut TermPool, name: &str) -> DataVariable
pub fn new(tp: &mut TermPool, name: &str) -> DataVariable
Create a new untyped variable with the given name.
Sourcepub fn with_sort(
tp: &mut TermPool,
name: &str,
sort: &SortExpressionRef<'_>,
) -> DataVariable
pub fn with_sort( tp: &mut TermPool, name: &str, sort: &SortExpressionRef<'_>, ) -> DataVariable
Create a variable with the given sort and name.
Sourcepub fn sort(&self) -> SortExpressionRef<'_>
pub fn sort(&self) -> SortExpressionRef<'_>
Returns the sort of the variable.
Source§impl DataVariable
impl DataVariable
pub fn copy<'a>(&'a self) -> DataVariableRef<'a>
Methods from Deref<Target = ATermRef<'static>>§
Sourcepub fn protect_global(&self) -> ATermGlobal
pub fn protect_global(&self) -> ATermGlobal
Protects the reference on the global protection pool.
Sourcepub fn upgrade<'b: 'a>(&'a self, parent: &ATermRef<'b>) -> ATermRef<'b>
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.
Sourcepub fn is_default(&self) -> bool
pub fn is_default(&self) -> bool
Returns whether the term is the default term (not initialised)
Sourcepub fn is_empty_list(&self) -> bool
pub fn is_empty_list(&self) -> bool
Returns true iff this is the empty aterm_list
Sourcepub fn get_head_symbol(&self) -> SymbolRef<'_>
pub fn get_head_symbol(&self) -> SymbolRef<'_>
Returns the head function symbol of the term.
Sourcepub fn iter(&self) -> TermIterator<'_> ⓘ
pub fn iter(&self) -> TermIterator<'_> ⓘ
Returns an iterator over all arguments of the term that runs in pre order traversal of the term trees.
Sourcepub fn require_valid(&self)
pub fn require_valid(&self)
Panics if the term is default
Trait Implementations§
Source§impl Borrow<ATerm> for DataVariable
impl Borrow<ATerm> for DataVariable
Source§impl Borrow<ATermRef<'static>> for DataVariable
impl Borrow<ATermRef<'static>> for DataVariable
Source§impl Clone for DataVariable
impl Clone for DataVariable
Source§fn clone(&self) -> DataVariable
fn clone(&self) -> DataVariable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more