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
impl IRTerm
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Returns true
if the IRTerm is Constant
.
pub fn is_constant_or_compound_constant(&self) -> bool
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§
Source§impl Ord for IRTerm
impl Ord for IRTerm
Source§impl PartialOrd for IRTerm
impl PartialOrd for IRTerm
Source§impl RenameWithSubstitution<IRTerm> for Clause<IRTerm>
impl RenameWithSubstitution<IRTerm> for Clause<IRTerm>
type Output = Clause
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
Source§impl RenameWithSubstitution<IRTerm> for IRTerm
impl RenameWithSubstitution<IRTerm> for IRTerm
type Output = IRTerm
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
Source§impl RenameWithSubstitution<IRTerm> for Literal<IRTerm>
impl RenameWithSubstitution<IRTerm> for Literal<IRTerm>
type Output = Literal
fn rename_with_sub(&self) -> (Self::Output, Substitution<IRTerm>)
Source§impl Substitute<IRTerm> for Clause<IRTerm>
impl Substitute<IRTerm> for Clause<IRTerm>
type Output = Clause
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
Source§impl Substitute<IRTerm> for IRTerm
impl Substitute<IRTerm> for IRTerm
type Output = IRTerm
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
Source§impl Substitute<IRTerm> for Literal<IRTerm>
impl Substitute<IRTerm> for Literal<IRTerm>
type Output = Literal
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
Source§impl Substitute<IRTerm> for Vec<LiteralWithHistory>
impl Substitute<IRTerm> for Vec<LiteralWithHistory>
type Output = Vec<LiteralWithHistory>
fn substitute(&self, s: &Substitution<IRTerm>) -> Self::Output
impl Eq for IRTerm
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
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
impl<I, T> ExtractContext<I, ()> for T
Source§fn 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
Source§impl<T> Indentable for Twhere
T: Display,
impl<T> Indentable for Twhere
T: Display,
Source§fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>
Source§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
Source§fn 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