[][src]Trait gf::support::lattice::ValueSet

pub trait ValueSet<T: Clone + Eq + Ord>: Join + Meet {
    fn singleton(member: T) -> Self;
fn card(&self) -> FlatLattice<NonZeroUsize>;
fn has_member(&self, value: &T) -> bool;
fn as_singleton(&self) -> FlatLattice<&T>;
fn to_sorted_vec(&self) -> FlatLattice<Vec<T>>; }

A lattice that can view its elements as value sets of type T.

Common implementations

Required methods

fn singleton(member: T) -> Self

Create a singleton set from member.

fn card(&self) -> FlatLattice<NonZeroUsize>

Return the set cardinality where ⊥ means 0 and ⊤ means infinite or too many to count.

fn has_member(&self, value: &T) -> bool

Return whether the set contains value.

fn as_singleton(&self) -> FlatLattice<&T>

Return the single member of a singleton set.

If the set is empty, returns ⊥. If the set has multiple members, returns ⊤.

fn to_sorted_vec(&self) -> FlatLattice<Vec<T>>

Return the set members as a sorted vector.

If the set is empty, returns ⊥. If the set has inifinite members or too many members to store in a vector, retuens ⊤.

Loading content...


impl<T: Clone + Eq + Ord> ValueSet<T> for FlatLattice<T>[src]

Loading content...