Enum IRTerm

Source
pub enum IRTerm {
    Constant(String),
    UserVariable(String),
    Array(Vec<IRTerm>),
    AuxiliaryVariable(u32),
    RenamedVariable(u32, Box<IRTerm>),
    AnonymousVariable(u32),
}

Variants§

§

Constant(String)

§

UserVariable(String)

§

Array(Vec<IRTerm>)

§

AuxiliaryVariable(u32)

Primarily used to establish f-string constraints.

§

RenamedVariable(u32, Box<IRTerm>)

§

AnonymousVariable(u32)

It should be safe to assume that a given AnonymousVariable(i) will not appear again in the AST.

Implementations§

Source§

impl IRTerm

Source

pub fn is_constant(&self) -> bool

Returns true if the IRTerm is Constant.

Source

pub fn is_constant_or_compound_constant(&self) -> bool

Source

pub fn is_underlying_anonymous_variable(&self) -> bool

Returns true if the IRTerm is AnonymousVariable or it was renamed from an AnonymousVariable.

Source

pub fn as_constant(&self) -> Option<&str>

Source

pub fn get_original(&self) -> &IRTerm

Gets the original IRTerm from a renamed one, or returns itself.

Source

pub fn is_anonymous_variable(&self) -> bool

Returns true if the irterm is AnonymousVariable.

Source§

impl IRTerm

Source

pub fn variables(&self, include_anonymous: bool) -> HashSet<IRTerm>

Trait Implementations§

Source§

impl Auxiliary for IRTerm

Source§

fn aux(anonymous: bool) -> IRTerm

Source§

impl Clone for IRTerm

Source§

fn clone(&self) -> IRTerm

Returns a duplicate 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 IRTerm

Source§

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

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

impl Display for IRTerm

Source§

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

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

impl From<ModusTerm> for IRTerm

Source§

fn from(modus_term: ModusTerm) -> Self

Converts to this type from the input type.
Source§

impl Ground for IRTerm

Source§

fn is_ground(&self) -> bool

Source§

impl Hash for IRTerm

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 IRTerm

Source§

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

Source§

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

Source§

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

Source§

fn rename(&self) -> IRTerm

Source§

impl RenameWithSubstitution<IRTerm> for Clause<IRTerm>

Source§

impl RenameWithSubstitution<IRTerm> for IRTerm

Source§

impl RenameWithSubstitution<IRTerm> for Literal<IRTerm>

Source§

impl RenameWithSubstitution<IRTerm> for Vec<Literal<IRTerm>>

Source§

impl Substitute<IRTerm> for Clause<IRTerm>

Source§

impl Substitute<IRTerm> for IRTerm

Source§

impl Substitute<IRTerm> for Literal<IRTerm>

Source§

impl Substitute<IRTerm> for Vec<Literal<IRTerm>>

Source§

impl Substitute<IRTerm> for Vec<LiteralWithHistory>

Source§

type Output = Vec<LiteralWithHistory>

Source§

fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output

Source§

impl Eq for IRTerm

Source§

impl StructuralPartialEq for IRTerm

Auto Trait Implementations§

§

impl Freeze for IRTerm

§

impl RefUnwindSafe for IRTerm

§

impl Send for IRTerm

§

impl Sync for IRTerm

§

impl Unpin for IRTerm

§

impl UnwindSafe for IRTerm

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

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

Compare self to key and return their ordering.
Source§

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

Source§

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

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

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

Source§

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

Compare self to key and return true if they are equal.
Source§

impl<I, T> ExtractContext<I, ()> for T

Source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Indentable for T
where T: Display,

Source§

fn indented(self, indent: &str) -> Indented<'_, Self>

Wrap this object so that its Display representation is indented with the given indent. Each non-empty line of the formatted output will be prefixed with the indent. Read more
Source§

fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>

Wrap this object so that its Display representation is indented with the given indent. Each non-empty line except for the first of the formatted output will be prefixed with the indent. Read more
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<I> RecreateContext<I> for I

Source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
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§

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.