Skip to main content

Term

Enum Term 

Source
pub enum Term<V, L, C> {
    Var(V),
    Lit(L),
    Cons(C, Vec<Term<V, L, C>>),
}

Variants§

§

Var(V)

§

Lit(L)

§

Cons(C, Vec<Term<V, L, C>>)

Implementations§

Source§

impl<V, L, C> Term<V, L, C>

Source

pub fn is_var(&self) -> bool

Source

pub fn is_lit(&self) -> bool

Source

pub fn is_cons(&self) -> bool

Source

pub fn height(&self) -> usize

Source

pub fn size(&self) -> usize

Source§

impl<L: Copy, C: Copy> Term<Ident, L, C>

Source

pub fn tag_ctx(&self, ctx: usize) -> Term<IdentCtx, L, C>

Source§

impl<V: Copy, L: Copy, C: Copy> Term<V, L, C>

Source

pub fn to_atom(&self) -> Option<Term<V, L, Infallible>>

Source§

impl<V: Copy, L: Copy> Term<V, L, Infallible>

Source

pub fn to_term<C>(&self) -> Term<V, L, C>

Source§

impl<V: Copy + Eq, L, C> Term<V, L, C>

Source

pub fn occurs(&self, x: &V) -> bool

Source

pub fn free_vars(&self) -> Vec<V>

Source§

impl<V: Copy + Eq + Hash, L: Copy, C: Copy> Term<V, L, C>

Source

pub fn substitute(&self, map: &HashMap<V, Term<V, L, C>>) -> Term<V, L, C>

Trait Implementations§

Source§

impl<V: Clone, L: Clone, C: Clone> Clone for Term<V, L, C>

Source§

fn clone(&self) -> Term<V, L, C>

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<V: Debug, L: Debug, C: Debug> Debug for Term<V, L, C>

Source§

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

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

impl<V: Display, L: Display, C: Display> Display for Term<V, L, C>

Source§

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

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

impl<V: PartialEq, L: PartialEq, C: PartialEq> PartialEq for Term<V, L, C>

Source§

fn eq(&self, other: &Term<V, L, C>) -> 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<V, L, C> StructuralPartialEq for Term<V, L, C>

Auto Trait Implementations§

§

impl<V, L, C> Freeze for Term<V, L, C>
where V: Freeze, L: Freeze, C: Freeze,

§

impl<V, L, C> RefUnwindSafe for Term<V, L, C>

§

impl<V, L, C> Send for Term<V, L, C>
where V: Send, L: Send, C: Send,

§

impl<V, L, C> Sync for Term<V, L, C>
where V: Sync, L: Sync, C: Sync,

§

impl<V, L, C> Unpin for Term<V, L, C>
where V: Unpin, L: Unpin, C: Unpin,

§

impl<V, L, C> UnsafeUnpin for Term<V, L, C>

§

impl<V, L, C> UnwindSafe for Term<V, L, C>
where V: UnwindSafe, L: UnwindSafe, C: UnwindSafe,

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<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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V