Skip to main content

NfRules

Struct NfRules 

Source
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>

Source

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.

Source

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).

Trait Implementations§

Source§

impl<'r, 'i, G: Clone, M: Clone> Clone for NfRules<'r, 'i, G, M>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'r, 'i, G: Copy, M: Copy> Copy for NfRules<'r, 'i, G, M>

Auto Trait Implementations§

§

impl<'r, 'i, G, M> Freeze for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: Freeze, Option<&'i NfIndex<G>>: Freeze,

§

impl<'r, 'i, G, M> RefUnwindSafe for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: RefUnwindSafe, Option<&'i NfIndex<G>>: RefUnwindSafe,

§

impl<'r, 'i, G, M> Send for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: Send, Option<&'i NfIndex<G>>: Send,

§

impl<'r, 'i, G, M> Sync for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: Sync, Option<&'i NfIndex<G>>: Sync,

§

impl<'r, 'i, G, M> Unpin for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: Unpin, Option<&'i NfIndex<G>>: Unpin,

§

impl<'r, 'i, G, M> UnsafeUnpin for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: UnsafeUnpin, Option<&'i NfIndex<G>>: UnsafeUnpin,

§

impl<'r, 'i, G, M> UnwindSafe for NfRules<'r, 'i, G, M>
where &'i [NfRuleRef<'r, G, M>]: UnwindSafe, Option<&'i NfIndex<G>>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.