[−][src]Trait gf::support::lattice::ValueSet
A lattice that can view its elements as value sets of type T
.
Common implementations
FlatLattice
is like a singleton, tracking at most one distinct value, good for concrete-like implementation states.
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 ⊤.