pub struct ConclusionIndex { /* private fields */ }Expand description
Index for fast lookup of rules by their conclusions
This is similar to RETE’s beta memory but specialized for backward chaining. Instead of matching conditions, we match rule conclusions (actions) to goals.
Implementations§
Source§impl ConclusionIndex
impl ConclusionIndex
Sourcepub fn from_rules(rules: &[Rule]) -> Self
pub fn from_rules(rules: &[Rule]) -> Self
Build index from a collection of rules
Sourcepub fn remove_rule(&mut self, rule_name: &str)
pub fn remove_rule(&mut self, rule_name: &str)
Remove a rule from the index
Sourcepub fn find_candidates(&self, goal_pattern: &str) -> HashSet<String>
pub fn find_candidates(&self, goal_pattern: &str) -> HashSet<String>
Sourcepub fn stats(&self) -> IndexStats
pub fn stats(&self) -> IndexStats
Get statistics about the index
Trait Implementations§
Source§impl Clone for ConclusionIndex
impl Clone for ConclusionIndex
Source§fn clone(&self) -> ConclusionIndex
fn clone(&self) -> ConclusionIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConclusionIndex
impl Debug for ConclusionIndex
Auto Trait Implementations§
impl Freeze for ConclusionIndex
impl RefUnwindSafe for ConclusionIndex
impl Send for ConclusionIndex
impl Sync for ConclusionIndex
impl Unpin for ConclusionIndex
impl UnwindSafe for ConclusionIndex
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