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§
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>)> ⓘ
Implementations on Foreign Types§
source§impl<M: Matcher> Subterms<M> for Vec<Term<M>>
impl<M: Matcher> Subterms<M> for Vec<Term<M>>
source§fn find_subterm_same_shape(&self, term: &Term<M>) -> Option<&Term<M>>
fn find_subterm_same_shape(&self, term: &Term<M>) -> Option<&Term<M>>
Finds a subterm with the same type as term
source§fn find_subterm<P: Fn(&&Term<M>) -> bool + Copy>(
&self,
predicate: P
) -> Option<&Term<M>>
fn find_subterm<P: Fn(&&Term<M>) -> bool + Copy>(
&self,
predicate: P
) -> Option<&Term<M>>
Finds a subterm in this vector
source§fn filter_grand_subterms<P: Fn(&Term<M>, &Term<M>) -> bool + Copy>(
&self,
predicate: P
) -> Vec<((usize, &Term<M>), &Term<M>)> ⓘ
fn filter_grand_subterms<P: Fn(&Term<M>, &Term<M>) -> bool + Copy>(
&self,
predicate: P
) -> Vec<((usize, &Term<M>), &Term<M>)> ⓘ
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
.