pub trait DecidablePred<A> {
// Required method
fn decide_pred(&self, a: &A) -> Decision<()>;
// Provided methods
fn filter_slice<'a>(&self, xs: &'a [A]) -> Vec<&'a A> { ... }
fn any_slice(&self, xs: &[A]) -> bool { ... }
fn all_slice(&self, xs: &[A]) -> bool { ... }
fn count_slice(&self, xs: &[A]) -> usize { ... }
}Expand description
A decidable predicate P : A → Prop.
Given any a : A, can compute whether P(a) holds.
Required Methods§
Sourcefn decide_pred(&self, a: &A) -> Decision<()>
fn decide_pred(&self, a: &A) -> Decision<()>
Decide whether the predicate holds for a.
Provided Methods§
Sourcefn filter_slice<'a>(&self, xs: &'a [A]) -> Vec<&'a A>
fn filter_slice<'a>(&self, xs: &'a [A]) -> Vec<&'a A>
Filter a slice, keeping elements satisfying the predicate.
Sourcefn any_slice(&self, xs: &[A]) -> bool
fn any_slice(&self, xs: &[A]) -> bool
Check whether any element of a slice satisfies the predicate.
Sourcefn all_slice(&self, xs: &[A]) -> bool
fn all_slice(&self, xs: &[A]) -> bool
Check whether all elements of a slice satisfy the predicate.
Sourcefn count_slice(&self, xs: &[A]) -> usize
fn count_slice(&self, xs: &[A]) -> usize
Count elements of a slice satisfying the predicate.