Skip to main content

MatchSet

Struct MatchSet 

Source
pub struct MatchSet<Cfg: EGraphConfig> {
    pub count: usize,
    /* private fields */
}
Expand description

Flat, stride-packed storage for all matches of a query.

Each variable kind occupies a single Vec with stride entries per match. Stride = number of variables of that kind (from MatchShape). Rest data lives in shared append-only pools; per-match spans are strided.

Fields§

§count: usize

Implementations§

Source§

impl<Cfg: EGraphConfig> MatchSet<Cfg>

Source

pub fn new(shape: &MatchShape) -> Self

Source

pub fn empty() -> Self

A shapeless set (every stride zero); given a real shape by Self::reshape before first use. What lets one warm store serve queries of different shapes across a whole saturation.

Source

pub fn reshape(&mut self, shape: &MatchShape)

Adopt a query’s shape: set the strides and drop stored matches, keeping every flat allocation (the warm-reuse discipline across queries).

Source

pub fn push(&mut self, m: &Match<Cfg>)

Append one match.

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Source

pub fn get_node(&self, v: VarId, j: usize) -> Cfg::G

Source

pub fn get_mult(&self, v: MultVarId, j: usize) -> Cfg::M

Source

pub fn get_lit_val(&self, v: LitValVarId, j: usize) -> Cfg::V

Source

pub fn set_node(&mut self, v: VarId, j: usize, val: Cfg::G)

Source

pub fn set_mult(&mut self, v: MultVarId, j: usize, val: Cfg::M)

Source

pub fn seq_slice(&self, v: SeqVarId, j: usize) -> &[Cfg::G]

Source

pub fn set_slice(&self, v: SetVarId, j: usize) -> &[Cfg::G]

Source

pub fn mset_slice(&self, v: MsetVarId, j: usize) -> &[Cfg::C]

Source

pub fn clear(&mut self)

Drop the stored matches without releasing storage (the MatchPool warm-reuse discipline, for consumers that keep a MatchSet across queries).

Auto Trait Implementations§

§

impl<Cfg> Freeze for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: Freeze, Vec<<Cfg as EGraphConfig>::M>: Freeze, Vec<<Cfg as EGraphConfig>::V>: Freeze, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: Freeze, Vec<<Cfg as EGraphConfig>::C>: Freeze,

§

impl<Cfg> RefUnwindSafe for MatchSet<Cfg>

§

impl<Cfg> Send for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: Send, Vec<<Cfg as EGraphConfig>::M>: Send, Vec<<Cfg as EGraphConfig>::V>: Send, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: Send, Vec<<Cfg as EGraphConfig>::C>: Send,

§

impl<Cfg> Sync for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: Sync, Vec<<Cfg as EGraphConfig>::M>: Sync, Vec<<Cfg as EGraphConfig>::V>: Sync, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: Sync, Vec<<Cfg as EGraphConfig>::C>: Sync,

§

impl<Cfg> Unpin for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: Unpin, Vec<<Cfg as EGraphConfig>::M>: Unpin, Vec<<Cfg as EGraphConfig>::V>: Unpin, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: Unpin, Vec<<Cfg as EGraphConfig>::C>: Unpin,

§

impl<Cfg> UnsafeUnpin for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: UnsafeUnpin, Vec<<Cfg as EGraphConfig>::M>: UnsafeUnpin, Vec<<Cfg as EGraphConfig>::V>: UnsafeUnpin, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: UnsafeUnpin, Vec<<Cfg as EGraphConfig>::C>: UnsafeUnpin,

§

impl<Cfg> UnwindSafe for MatchSet<Cfg>
where Vec<<Cfg as EGraphConfig>::G>: UnwindSafe, Vec<<Cfg as EGraphConfig>::M>: UnwindSafe, Vec<<Cfg as EGraphConfig>::V>: UnwindSafe, Vec<(<Cfg as EGraphConfig>::Index, <Cfg as EGraphConfig>::Index)>: UnwindSafe, Vec<<Cfg as EGraphConfig>::C>: 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.