pub struct SemiNaiveEvaluator { /* private fields */ }Expand description
Semi-naive Datalog evaluator.
Computes the least fixpoint of a set of Datalog rules over a base EDB by iterating only over the delta (newly derived facts) at each round.
Implementations§
Source§impl SemiNaiveEvaluator
impl SemiNaiveEvaluator
Sourcepub fn new(rules: Vec<Rule>, edb: Edb) -> Self
pub fn new(rules: Vec<Rule>, edb: Edb) -> Self
Create a new evaluator with the given rules and EDB.
Sourcepub fn evaluate(&mut self) -> Result<&Idb, QueryError>
pub fn evaluate(&mut self) -> Result<&Idb, QueryError>
Run semi-naive evaluation to fixpoint and return the final IDB.
Algorithm:
- Seed Δ with all EDB facts plus any IDB fact-rules.
- Repeat until Δ is empty: a. For each rule, derive new facts using Δ. b. New facts not already in IDB become the next Δ. c. Add all new facts to IDB.
Auto Trait Implementations§
impl Freeze for SemiNaiveEvaluator
impl RefUnwindSafe for SemiNaiveEvaluator
impl Send for SemiNaiveEvaluator
impl Sync for SemiNaiveEvaluator
impl Unpin for SemiNaiveEvaluator
impl UnsafeUnpin for SemiNaiveEvaluator
impl UnwindSafe for SemiNaiveEvaluator
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