Skip to main content

VariableArityCache

Struct VariableArityCache 

Source
pub struct VariableArityCache<G: DenseId, O: DenseId, C: Tagged + Clone + Copy + Hash + Eq, L: DenseId, const TRACK: bool = true, const PROOFS: bool = false> { /* private fields */ }

Implementations§

Source§

impl<G: DenseId + Hash, O: DenseId + Hash, C: Tagged + Clone + Copy + Hash + Eq + Debug, L: DenseId, const TRACK: bool, const PROOFS: bool> VariableArityCache<G, O, C, L, TRACK, PROOFS>

Source

pub fn new() -> Self

Source

pub fn len(&self) -> L

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, id: L) -> VariableArityNode<G, O>

Source

pub fn set(&mut self, id: L, node: VariableArityNode<G, O>)

Source

pub fn children_vec(&self, node: &VariableArityNode<G, O>) -> Vec<C>

Source

pub fn pool_get(&self, i: usize) -> C

Source

pub fn pool_set(&mut self, i: usize, value: C)

Source

pub fn probe(&self, op: O, elems: &[C]) -> Option<G>

Source

pub fn insert(&mut self, global_id: G, op: O, elems: &[C]) -> L

Source

pub fn probe_or_insert( &mut self, global_id: G, op: O, elems: &[C], ) -> InsertResult<G, L>

Source

pub fn node_get(&self, id: L) -> VariableArityNode<G, O>

Source

pub fn node_set(&mut self, id: L, node: VariableArityNode<G, O>)

Source

pub fn recanonize_node<V: VarCanon<G, C>>( &mut self, local_id: L, find: impl Fn(G) -> G, buf: &mut Vec<C>, collisions: &mut Vec<(G, G)>, touched: &mut Vec<G>, mode: CanonMode<G>, )

Recanonize a single node’s children. buf is a caller-owned scratch buffer, cleared internally. Pushes collision pair into collisions if the new canonical form matches an existing node. When PROOFS=true, saves the original node+children to history on first recanonize.

Source

pub fn original_children(&self, global_id: G, out: &mut Vec<C>) -> bool

Retrieve the original (pre-recanonize) children for a node by global id. Linear scan of the history store. Appends children to out. Returns true if found.

Source

pub fn mark(&mut self, shrink: ShrinkPolicy) -> PoolCacheToken

Source

pub fn restore(&mut self, token: PoolCacheToken)

Trait Implementations§

Source§

impl<G: DenseId + Hash, O: DenseId + Hash, C: Tagged + Clone + Copy + Hash + Eq + Debug, L: DenseId, const TRACK: bool, const PROOFS: bool> Default for VariableArityCache<G, O, C, L, TRACK, PROOFS>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Freeze for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Freeze, Vec<C, usize, InlineStore<C, usize>, TRACK>: Freeze, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Freeze, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Freeze, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Freeze, Vec<L>: Freeze,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> RefUnwindSafe for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: RefUnwindSafe, Vec<C, usize, InlineStore<C, usize>, TRACK>: RefUnwindSafe, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: RefUnwindSafe, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: RefUnwindSafe, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: RefUnwindSafe, Vec<L>: RefUnwindSafe,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Send for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Send, Vec<C, usize, InlineStore<C, usize>, TRACK>: Send, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Send, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Send, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Send, Vec<L>: Send,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Sync for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Sync, Vec<C, usize, InlineStore<C, usize>, TRACK>: Sync, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Sync, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Sync, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Sync, Vec<L>: Sync,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> Unpin for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: Unpin, Vec<C, usize, InlineStore<C, usize>, TRACK>: Unpin, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: Unpin, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: Unpin, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: Unpin, Vec<L>: Unpin,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> UnsafeUnpin for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: UnsafeUnpin, Vec<C, usize, InlineStore<C, usize>, TRACK>: UnsafeUnpin, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnsafeUnpin, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: UnsafeUnpin, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: UnsafeUnpin, Vec<L>: UnsafeUnpin,

§

impl<G, O, C, L, const TRACK: bool, const PROOFS: bool> UnwindSafe for VariableArityCache<G, O, C, L, TRACK, PROOFS>
where Vec<VariableArityNode<G, O>, L, InlineStore<VariableArityNode<G, O>, L>, TRACK>: UnwindSafe, Vec<C, usize, InlineStore<C, usize>, TRACK>: UnwindSafe, HashMap<StoredKey<L>, (), PassthroughBuildHasher>: UnwindSafe, Option<Vec<VariableArityNode<G, O>, usize, InlineStore<VariableArityNode<G, O>, usize>, TRACK>>: UnwindSafe, Option<Vec<C, usize, InlineStore<C, usize>, TRACK>>: UnwindSafe, Vec<L>: 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> 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, 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.