Enum cop::Term

source ·
pub enum Term<C, V> {
    C(C, Args<Term<C, V>>),
    V(V),
}
Expand description

First-order logic term.

Variants§

§

C(C, Args<Term<C, V>>)

Constant with arguments applied to it

§

V(V)

Variable

Implementations§

source§

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

source

pub fn map_constants<D>(self, f: &mut impl FnMut(C) -> D) -> Term<D, V>

Apply function to the constants of the term.

source

pub fn map_vars<W>(self, f: &mut impl FnMut(V) -> Term<C, W>) -> Term<C, W>

Apply function to the variables of the term.

source

pub fn constants(&self) -> Box<dyn Iterator<Item = (&C, usize)> + '_>

Return all constants occurring in the term.

source

pub fn vars(&self) -> Box<dyn Iterator<Item = &V> + '_>

Return all variables occurring in the term.

source§

impl<C: Clone, V: Clone + Eq + Hash> Term<C, V>

source

pub fn subst(self, sub: &HashMap<V, Term<C, V>>) -> Self

Apply a substitution to the term.

source§

impl<C: Eq, V> Term<C, V>

source

pub fn const_unique(&self) -> Vec<(&C, usize)>

Corresponds to leanCoP’s collect_func.

source§

impl<C: Fresh, V> Term<C, V>

source

pub fn skolem(st: &mut C::State, args: Vec<V>) -> Self

Return a fresh Skolem function and apply a sequence of variables.

Trait Implementations§

source§

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

source§

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

Returns a copy 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<C: Debug, V: Debug> Debug for Term<C, V>

source§

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

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

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

source§

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

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

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

source§

fn eq(&self, other: &Term<C, V>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<C: Eq, V: Eq> Eq for Term<C, V>

source§

impl<C, V> StructuralEq for Term<C, V>

source§

impl<C, V> StructuralPartialEq for Term<C, V>

Auto Trait Implementations§

§

impl<C, V> RefUnwindSafe for Term<C, V>where C: RefUnwindSafe, V: RefUnwindSafe,

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. 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 Twhere 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, R> Rewind<PutRewind<T, R>> for Twhere T: Rewind<R>,

source§

fn rewind(&mut self, state: PutRewind<T, R>)

Rewind to some state.
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.