pub enum Expr<T> {
Term(Term<T>),
Not(Box<Expr<T>>),
And(Vec<Expr<T>>),
Or(Vec<Expr<T>>),
}Variants§
Implementations§
Source§impl<T> Expr<T>
impl<T> Expr<T>
pub fn term(term: Term<T>) -> Self
pub fn term_atom(functor: T) -> Self
pub fn term_compound<I: IntoIterator<Item = Term<T>>>( functor: T, args: I, ) -> Self
pub fn expr_not(expr: Expr<T>) -> Self
pub fn expr_and<I: IntoIterator<Item = Expr<T>>>(args: I) -> Self
pub fn expr_or<I: IntoIterator<Item = Expr<T>>>(args: I) -> Self
pub fn map<U, F: FnMut(T) -> U>(self, f: &mut F) -> Expr<U>
pub fn replace_term<F>(&mut self, f: &mut F)
Source§impl<T: PartialEq> Expr<T>
impl<T: PartialEq> Expr<T>
pub fn contains_term(&self, term: &Term<T>) -> bool
Sourcepub fn distribute_not(self) -> Self
pub fn distribute_not(self) -> Self
e.g. ¬(A ∧ (B ∨ C)) -> ¬A ∨ (¬B ∧ ¬C)
Trait Implementations§
Source§impl<T: Ord> Ord for Expr<T>
impl<T: Ord> Ord for Expr<T>
Source§impl<T: PartialOrd> PartialOrd for Expr<T>
impl<T: PartialOrd> PartialOrd for Expr<T>
impl<T: Eq> Eq for Expr<T>
impl<T> StructuralPartialEq for Expr<T>
Auto Trait Implementations§
impl<T> Freeze for Expr<T>where
T: Freeze,
impl<T> RefUnwindSafe for Expr<T>where
T: RefUnwindSafe,
impl<T> Send for Expr<T>where
T: Send,
impl<T> Sync for Expr<T>where
T: Sync,
impl<T> Unpin for Expr<T>where
T: Unpin,
impl<T> UnsafeUnpin for Expr<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Expr<T>where
T: UnwindSafe,
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.