Trait puffin::algebra::term::Subterms

source ·
pub trait Subterms<M: Matcher> {
    fn find_subterm_same_shape(&self, term: &Term<M>) -> Option<&Term<M>>;
    fn find_subterm<P: Fn(&&Term<M>) -> bool + Copy>(
        &self,
        filter: P
    ) -> Option<&Term<M>>; fn filter_grand_subterms<P: Fn(&Term<M>, &Term<M>) -> bool + Copy>(
        &self,
        predicate: P
    ) -> Vec<((usize, &Term<M>), &Term<M>)> ; }

Required Methods§

Implementations on Foreign Types§

Finds a subterm with the same type as term

Finds a subterm in this vector

Finds all grand children/subterms which match the predicate.

A grand subterm is defined as a subterm of a term in self.

Each grand subterm is returned together with its parent and the index of the parent in self.

Implementors§