pub struct Rule {
pub id: RuleId,
pub premises: Vec<Literal>,
pub conclusion: Literal,
pub kind: RuleKind,
}Expand description
A rule: premises → conclusion, either strict or defeasible.
Fields§
§id: RuleIdUnique rule id within a rule set.
premises: Vec<Literal>Premises (antecedents).
conclusion: LiteralConclusion (consequent).
kind: RuleKindWhether the rule is strict (indefeasible) or defeasible.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn strict(id: RuleId, premises: Vec<Literal>, conclusion: Literal) -> Self
pub fn strict(id: RuleId, premises: Vec<Literal>, conclusion: Literal) -> Self
Construct a strict rule.
Sourcepub fn defeasible(
id: RuleId,
premises: Vec<Literal>,
conclusion: Literal,
) -> Self
pub fn defeasible( id: RuleId, premises: Vec<Literal>, conclusion: Literal, ) -> Self
Construct a defeasible rule.
Sourcepub fn is_defeasible(&self) -> bool
pub fn is_defeasible(&self) -> bool
Whether this rule is defeasible.
Trait Implementations§
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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> 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.