pub struct NfRules<'r, 'i, G, M> { /* private fields */ }Expand description
A rule set as the normalizers consume it: the rules themselves, plus an optional
NfIndex over them.
Two shapes rather than one because the two completion call sites amortize differently.
The critical-pair loop normalizes thousands of reducts against one rule table already
hoisted outside the loop, so an index built alongside it is paid for once — use
indexed. Inter-reduction refills a different rule slice per target
(each target is normalized by all rules but its own), so there is nothing to amortize
over and indexing would cost more than the scan it replaces — use
linear.
Implementations§
Source§impl<'r, 'i, G: Copy + Ord, M: MultiplicityLike> NfRules<'r, 'i, G, M>
impl<'r, 'i, G: Copy + Ord, M: MultiplicityLike> NfRules<'r, 'i, G, M>
Sourcepub fn linear(rules: &'i [NfRuleRef<'r, G, M>]) -> Self
pub fn linear(rules: &'i [NfRuleRef<'r, G, M>]) -> Self
Scan every rule on every step. Correct for any rule set; the right choice when the set is not reused across enough normalizations to pay for an index.
Sourcepub fn indexed(rules: &'i [NfRuleRef<'r, G, M>], index: &'i NfIndex<G>) -> Self
pub fn indexed(rules: &'i [NfRuleRef<'r, G, M>], index: &'i NfIndex<G>) -> Self
Consult index to narrow the rules tested. index must have been built from
exactly this rules slice (NfIndex::rebuild stores positions into it).