pub enum Literal {
Atom(String),
Neg(String),
}Expand description
A propositional literal: an atom or its negation.
Variants§
Implementations§
Source§impl Literal
impl Literal
Sourcepub fn atom(name: impl Into<String>) -> Self
pub fn atom(name: impl Into<String>) -> Self
Construct a positive literal.
§Panics (debug builds)
Panics if name starts with the reserved prefix __applicable_,
which is used internally by crate::aspic::StructuredSystem::add_undercut_rule
to encode undercut attacks. Use add_undercut_rule to target a
defeasible rule rather than constructing the literal directly.
Sourcepub fn neg(name: impl Into<String>) -> Self
pub fn neg(name: impl Into<String>) -> Self
Construct a negated literal.
§Panics (debug builds)
Panics if name starts with the reserved prefix __applicable_.
See Self::atom for context.
Sourcepub fn is_contrary_of(&self, other: &Literal) -> bool
pub fn is_contrary_of(&self, other: &Literal) -> bool
Check whether two literals are contraries of each other.
Trait Implementations§
Source§impl Ord for Literal
impl Ord for Literal
Source§impl PartialOrd for Literal
impl PartialOrd for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnsafeUnpin for Literal
impl UnwindSafe for Literal
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.