[][src]Trait egg::Searcher

pub trait Searcher<L, N> where
    L: Language,
    N: Analysis<L>, 
{ fn search_eclass(
        &self,
        egraph: &EGraph<L, N>,
        eclass: Id
    ) -> Option<SearchMatches>;
fn vars(&self) -> Vec<Var>; fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches> { ... } }

The lefthand side of a Rewrite.

A Searcher is something that can search the egraph and find matching substititions. Right now the only significant Searcher is Pattern.

Required methods

fn search_eclass(
    &self,
    egraph: &EGraph<L, N>,
    eclass: Id
) -> Option<SearchMatches>

Search one eclass, returning None if no matches can be found. This should not return a SearchMatches with no substs.

fn vars(&self) -> Vec<Var>

Returns a list of the variables bound by this Searcher

Loading content...

Provided methods

fn search(&self, egraph: &EGraph<L, N>) -> Vec<SearchMatches>

Search the whole EGraph, returning a list of all the SearchMatches where something was found. This just calls search_eclass on each eclass.

Loading content...

Implementors

impl<L: Language, A: Analysis<L>> Searcher<L, A> for Pattern<L>[src]

Loading content...