Trait egg::Searcher [−][src]
pub trait Searcher<L, N> where
L: Language,
N: Analysis<L>, {
fn search_eclass(
&self,
egraph: &EGraph<L, N>,
eclass: Id
) -> Option<SearchMatches<'_, L>>;
fn vars(&self) -> Vec<Var>;
fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches<'_, L>> { ... }
fn n_matches(&self, egraph: &EGraph<L, N>) -> usize { ... }
fn get_pattern_ast(&self) -> Option<&PatternAst<L>> { ... }
}
Expand description
Required methods
fn search_eclass(
&self,
egraph: &EGraph<L, N>,
eclass: Id
) -> Option<SearchMatches<'_, L>>
fn search_eclass(
&self,
egraph: &EGraph<L, N>,
eclass: Id
) -> Option<SearchMatches<'_, L>>
Search one eclass, returning None if no matches can be found. This should not return a SearchMatches with no substs.
Provided methods
fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches<'_, L>>
fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches<'_, L>>
Search the whole EGraph
, returning a list of all the
SearchMatches
where something was found.
This just calls search_eclass
on each eclass.
Returns the number of matches in the e-graph
fn get_pattern_ast(&self) -> Option<&PatternAst<L>>
fn get_pattern_ast(&self) -> Option<&PatternAst<L>>
For patterns, return the ast directly as a reference