pub enum IRTerm {
Constant(String),
UserVariable(String),
AuxiliaryVariable(u32),
RenamedVariable(u32, Box<IRTerm>),
AnonymousVariable(u32),
}
Variants
Constant(String)
UserVariable(String)
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
sourceimpl IRTerm
impl IRTerm
sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true
if the IRTerm is Constant
.
sourcepub fn is_underlying_anonymous_variable(&self) -> bool
pub fn is_underlying_anonymous_variable(&self) -> bool
Returns true
if the IRTerm is AnonymousVariable
or it was
renamed from an AnonymousVariable
.
pub fn as_constant(&self) -> Option<&str>
sourcepub fn get_original(&self) -> &IRTerm
pub fn get_original(&self) -> &IRTerm
Gets the original IRTerm from a renamed one, or returns itself.
sourcepub fn is_anonymous_variable(&self) -> bool
pub fn is_anonymous_variable(&self) -> bool
Returns true
if the irterm is AnonymousVariable
.
Trait Implementations
sourceimpl Ord for IRTerm
impl Ord for IRTerm
sourceimpl PartialOrd<IRTerm> for IRTerm
impl PartialOrd<IRTerm> for IRTerm
sourcefn partial_cmp(&self, other: &IRTerm) -> Option<Ordering>
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 · sourcefn lt(&self, other: &Rhs) -> bool
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 · sourcefn le(&self, other: &Rhs) -> bool
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
sourceimpl RenameWithSubstitution<IRTerm> for IRTerm
impl RenameWithSubstitution<IRTerm> for IRTerm
type Output = IRTerm
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
sourceimpl RenameWithSubstitution<IRTerm> for Literal<IRTerm>
impl RenameWithSubstitution<IRTerm> for Literal<IRTerm>
type Output = Literal<IRTerm>
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
sourceimpl RenameWithSubstitution<IRTerm> for Clause<IRTerm>
impl RenameWithSubstitution<IRTerm> for Clause<IRTerm>
type Output = Clause<IRTerm>
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
sourceimpl Substitute<IRTerm> for Vec<LiteralWithHistory>
impl Substitute<IRTerm> for Vec<LiteralWithHistory>
type Output = Vec<LiteralWithHistory>
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
sourceimpl Substitute<IRTerm> for IRTerm
impl Substitute<IRTerm> for IRTerm
type Output = IRTerm
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
sourceimpl Substitute<IRTerm> for Literal<IRTerm>
impl Substitute<IRTerm> for Literal<IRTerm>
type Output = Literal
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
sourceimpl Substitute<IRTerm> for Vec<Literal<IRTerm>>
impl Substitute<IRTerm> for Vec<Literal<IRTerm>>
type Output = Vec<Literal<IRTerm>>
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
sourceimpl Substitute<IRTerm> for Clause<IRTerm>
impl Substitute<IRTerm> for Clause<IRTerm>
type Output = Clause<IRTerm>
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
impl Eq for IRTerm
impl StructuralEq for IRTerm
impl StructuralPartialEq for IRTerm
Auto Trait Implementations
impl RefUnwindSafe for IRTerm
impl Send for IRTerm
impl Sync for IRTerm
impl Unpin for IRTerm
impl UnwindSafe for IRTerm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
sourcefn extract_context(self, _original_input: I)
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
impl<T> Indentable for T where
T: Display,
impl<T> Indentable for T where
T: Display,
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
sourceimpl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
sourcefn recreate_context(_original_input: I, tail: I) -> I
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more