Powerset

Struct Powerset 

Source
pub struct Powerset { /* private fields */ }
Expand description

Powerset lattice

Implementations§

Source§

impl Powerset

Source

pub fn new(nb_leaves: usize, max_iter_len: usize) -> Result<Powerset, String>

Powerset constructor

  • Leaves labels are generated automatically
  • nb_leaves: usize : number of leaves
  • max_iter_len: usize : maximal size for an iterator on the powerset
  • Output: the powerset or an error, when the number of leaves exceeds 128
Source

pub fn new_with_label( leaves_names: &[String], max_iter_len: usize, ) -> Result<Powerset, String>

Powerset constructor with predefined leaves labels

  • Leaves labels are provided
    • The labels should be different: if this condition is not met, this should not affect the computations, but it would make the results less readable
  • leaves_names: &[String] : list of leaves described by their names
  • max_iter_len: usize : maximal size for an iterator on the powerset
  • Output: the powerset or an error, when the number of leaves exceeds 128
Source

pub fn set_iterators(self) -> Self

Implement powerset iterators with a view to use methods IterableLattice::unsafe_bottom_to_top and IterableLattice::unsafe_top_to_bottom

  • These iterators are not defined by the powerset constructor due to the amount of resources required for some large powersets
  • Output: powerset implementing the iterators

Trait Implementations§

Source§

impl Archive for Powerset

Source§

type Archived = ArchivedPowerset

The archived representation of this type. Read more
Source§

type Resolver = PowersetResolver

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
Source§

unsafe fn resolve( &self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
Source§

impl Clone for Powerset

Source§

fn clone(&self) -> Powerset

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ComplementedLattice for Powerset

Source§

unsafe fn unsafe_not(&self, element: &Self::Item) -> Self::Item

Unsafe logical negation Read more
Source§

fn not( &self, safe_element: &SafeElement<Self::Item>, ) -> Result<SafeElement<Self::Item>, String>

Logical negation Read more
Source§

fn co_assignment( &self, assignment: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>
where Self::Item: Ord + Hash,

Compute the co-assignment of an assignment Read more
Source§

impl Debug for Powerset

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Powerset

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<__D: Fallible + ?Sized> Deserialize<Powerset, __D> for Archived<Powerset>

Source§

fn deserialize(&self, deserializer: &mut __D) -> Result<Powerset, __D::Error>

Deserializes using the given deserializer
Source§

impl HashedTypeDef for Powerset

Source§

const TYPE_HASH_NATIVE: u128 = 205_679_758_547_736_158_701_104_755_242_467_695_097u128

native hash computation
Source§

const TYPE_HASH_LE: u128 = _

hash encoded to little endianess
Source§

const TYPE_HASH_BE: u128 = _

hash encoded to big endianess
Source§

const UUID: Uuid = _

hash encoded to Uuid
Source§

impl IterableLattice for Powerset

Source§

type IntoIterUp = IntoIter<u128slx>

Type of iterator for iterating lattice from bottom to top
Source§

type IntoIterDown = IntoIter<u128slx>

Type of iterator for iterating lattice from top to bottom
Source§

unsafe fn unsafe_bottom_to_top(&self) -> Result<Self::IntoIterUp, String>

Unsafe iterator of the full lattice, non decreasing with inference; Read more
Source§

unsafe fn unsafe_top_to_bottom(&self) -> Result<Self::IntoIterDown, String>

Unsafe iterator of the full lattice, non increasing with inference; Read more
Source§

fn bottom_to_top(&self) -> Result<IntoIter<SafeElement<Self::Item>>, String>

Safe iterator of the full lattice, non decreasing with inference; Read more
Source§

fn top_to_bottom(&self) -> Result<IntoIter<SafeElement<Self::Item>>, String>

Safe iterator of the full lattice, non increasing with inference; Read more
Source§

impl Lattice for Powerset

Source§

type Item = u128slx

Type for encoding lattice elements: Read more
Source§

fn rand_lattice<R: Rng>(rng: &mut R) -> Self

Random lattice generator (for tests) Read more
Source§

fn rand_element<R: Rng>(&self, rng: &mut R) -> SafeElement<Self::Item>

Random element generator (for tests); elements are built safe Read more
Source§

fn ref_lattice_hash(&self) -> &u128slx

Reference to lattice hash
Source§

fn contains(&self, element: &Self::Item) -> bool

Test if element is from lattice Read more
Source§

fn ref_bottom(&self) -> &SafeElement<Self::Item>

Reference to least element of the lattice Read more
Source§

fn ref_top(&self) -> &SafeElement<Self::Item>

Reference to greatest element of the lattice Read more
Source§

unsafe fn unsafe_meet( &self, element_left: &Self::Item, element_right: &Self::Item, ) -> Self::Item

Unsafe greatest lower bound Read more
Source§

unsafe fn unsafe_join( &self, element_left: &Self::Item, element_right: &Self::Item, ) -> Self::Item

Unsafe least upper bound Read more
Source§

fn from_str(&self, s: &str) -> Result<SafeElement<Self::Item>, String>

Parse safe element from str Read more
Source§

fn to_string(&self, element: &SafeElement<Self::Item>) -> Result<String, String>

Format safe element into String Read more
Source§

fn lattice_hash(&self) -> u128slx

Lattice hash Read more
Source§

fn bottom(&self) -> SafeElement<Self::Item>

Least element of the lattice Read more
Source§

fn top(&self) -> SafeElement<Self::Item>

Greatest element of the lattice Read more
Source§

fn is_bottom( &self, safe_element: &SafeElement<Self::Item>, ) -> Result<bool, String>

Is safe element the least element of the lattice? Read more
Source§

fn is_top(&self, safe_element: &SafeElement<Self::Item>) -> Result<bool, String>

Is safe element the greatest element of the lattice? Read more
Source§

unsafe fn unsafe_is_bottom(&self, element: &Self::Item) -> bool

Is unsafe element the least element of the lattice? Read more
Source§

unsafe fn unsafe_is_top(&self, element: &Self::Item) -> bool

Is unsafe element the greatest element of the lattice? Read more
Source§

fn meet( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<SafeElement<Self::Item>, String>

Greatest lower bound Read more
Source§

fn meet_some<'a, I>(&self, it: I) -> Result<SafeElement<Self::Item>, String>
where I: IntoIterator<Item = &'a SafeElement<Self::Item>>, Self: 'a,

Greatest lower bound of a collection Read more
Source§

fn join( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<SafeElement<Self::Item>, String>

Least upper bound Read more
Source§

fn join_some<'a, I>(&self, it: I) -> Result<SafeElement<Self::Item>, String>
where I: IntoIterator<Item = &'a SafeElement<Self::Item>>, Self: 'a,

Least upper bound of a collection Read more
Source§

fn check_safe<T>(&self, element: T) -> Result<SafeElement<Self::Item>, String>
where T: Into<Self::Item>,

Check if unsafe element is in lattice and then build safe element Read more
Source§

fn rand_elements<R: Rng, I>( &self, len: usize, rng: &mut R, ) -> I::Type<SafeElement<Self::Item>>
where I: CollectionFamily1,

Elements collection generator (for tests); elements are built safe Read more
Source§

fn assignment(&self) -> AssignmentBuilder<Self::Item>
where Self::Item: Eq + Ord + Hash,

Init a new assignment builder Read more
Source§

fn assignment_with_capacity( &self, capacity: usize, ) -> AssignmentBuilder<Self::Item>
where Self::Item: Eq + Ord + Hash,

Init a new assignment builder with capacity Read more
Source§

fn prunable( &self, length_mid: u32, length_max: u32, ) -> AssignmentBuilder<Self::Item>
where Self::Item: Eq + Ord + Hash,

Init a new prunable assignment builder Read more
Source§

fn prunable_with_capacity( &self, length_mid: u32, length_max: u32, capacity: usize, ) -> AssignmentBuilder<Self::Item>
where Self::Item: Eq + Ord + Hash,

Init a new prunable assignment builder with capacity Read more
Source§

unsafe fn unsafe_cover(&self, left: &Self::Item, right: &Self::Item) -> bool

Unsafe test if left and right cover top, ie. union of left and right is top Read more
Source§

unsafe fn unsafe_disjoint(&self, left: &Self::Item, right: &Self::Item) -> bool

Unsafe test if left and right are disjoint Read more
Source§

unsafe fn unsafe_implies_join( &self, left: &Self::Item, right: &Self::Item, ) -> bool

Unsafe test if left implies (i.e. is contained by) right Read more
Source§

unsafe fn unsafe_implied_join( &self, left: &Self::Item, right: &Self::Item, ) -> bool

Unsafe test if left is implied by (i.e. contains) right Read more
Source§

unsafe fn unsafe_implies_meet( &self, left: &Self::Item, right: &Self::Item, ) -> bool

Unsafe test if left implies (i.e. is contained by) right Read more
Source§

unsafe fn unsafe_implied_meet( &self, left: &Self::Item, right: &Self::Item, ) -> bool

Unsafe test if left is implied by (i.e. contains) right Read more
Source§

fn cover( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left and right cover top, ie. union of left and right is top Read more
Source§

fn disjoint( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left and right are disjoint Read more
Source§

fn implies_join( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left implies (i.e. is contained by) right Read more
Source§

fn implied_join( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left is implied by (i.e. contains) right Read more
Source§

fn implies_meet( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left implies (i.e. is contained by) right Read more
Source§

fn implied_meet( &self, left: &SafeElement<Self::Item>, right: &SafeElement<Self::Item>, ) -> Result<bool, String>

Test if left is implied by (i.e. contains) right Read more
Source§

impl LatticeWithLeaves for Powerset

Source§

type IntoIterLeaves = IntoIter<<Powerset as Lattice>::Item, f64slx>

Type of leaves iterator
Source§

unsafe fn unsafe_leaves(&self) -> Result<Self::IntoIterLeaves, String>

Unsafe iterator of the weighted leaves of the lattice Read more
Source§

unsafe fn unsafe_leaf(&self, u: usize) -> Result<&Self::Item, String>

Get unsafe leaf at rank u Read more
Source§

unsafe fn unsafe_weighted_leaf( &self, u: usize, ) -> Result<(&Self::Item, &f64slx), String>

Get unsafe weighted leaf at rank u Read more
Source§

fn weighted_leaf( &self, u: usize, ) -> Result<(SafeElement<Self::Item>, f64slx), String>

Get safe weighted leaf at rank u Read more
Source§

fn leaf(&self, u: usize) -> Result<SafeElement<Self::Item>, String>

Get safe leaf at rank u Read more
Source§

fn leaves(&self) -> Result<IntoIter<(SafeElement<Self::Item>, f64slx)>, String>

Iterator of the safe weighted leaves of the lattice Read more
Source§

fn mass_to_pignistic( &self, mass: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform mass to pignistic probability Read more
Source§

impl<__S: Fallible + ?Sized> Serialize<__S> for Powerset

Source§

fn serialize(&self, serializer: &mut __S) -> Result<Self::Resolver, __S::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
Source§

impl Serialize for Powerset

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<U> ArchSized for U

Source§

type Archivable = U

Type of the slx data
Source§

fn arch_sized(&self) -> Result<ArchData<<U as ArchSized>::Archivable>, String>

Build the archive data from a slx data reference Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> ArchiveUnsized for T
where T: Archive,

Source§

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
Source§

type MetadataResolver = ()

The resolver for the metadata of this type. Read more
Source§

unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )

Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
Source§

unsafe fn resolve_unsized( &self, from: usize, to: usize, resolver: Self::MetadataResolver, out: *mut RelPtr<Self::Archived, <isize as Archive>::Archived>, )

Resolves a relative pointer to this value with the given from and to and writes it to the given output. Read more
Source§

impl<L> BeliefTransform for L
where L: IterableLattice, <L as Lattice>::Item: Ord + Hash,

Source§

fn mass_to_commonality( &self, mass: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform mass to commonality Read more
Source§

fn mass_from_commonality( &self, commonality: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform commonality to mass Read more
Source§

fn mass_to_implicability( &self, mass: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform mass to implicability Read more
Source§

fn mass_from_implicability( &self, implicability: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform implicability to mass Read more
Source§

fn mass_to_credibility( &self, mass: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform mass to credibility Read more
Source§

fn mass_from_credibility( &self, credibility: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform credibility to mass Read more
Source§

fn mass_to_plausibility( &self, mass: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform mass to plausibility Read more
Source§

fn implicability_to_credibility( &self, implicability: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform implicability to credibility Read more
Source§

fn implicability_from_credibility( &self, credibility: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform credibility to implicability Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<L> ComplementedBeliefTransform for L

Source§

fn mass_from_plausibility( &self, plausibility: &Assignment<Self::Item>, ) -> Result<Assignment<Self::Item>, String>

Transform plausibility to mass Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, O> FromSlx<T> for O
where T: SlxInto<O>,

Source§

fn from_slx(slx: T) -> O

Convert slx data into original data Read more
Source§

impl<T> HashedTypeMethods for T

Source§

fn type_hash_native<REF>() -> u128
where Self: HashedTypeDef<REF>,

return native type hash
Source§

fn type_hash_le<REF>() -> u128
where Self: HashedTypeDef<REF>,

return little endianess type hash
Source§

fn type_hash_be<REF>() -> u128
where Self: HashedTypeDef<REF>,

return big endianess type hash
Source§

fn type_uuid<REF>() -> Uuid
where Self: HashedTypeDef<REF>,

return uuid derived from type hash
Source§

fn type_uuid_hyphenated<REF>() -> String
where Self: HashedTypeDef<REF>,

return uuid hyphenated string
Source§

fn self_type_hash_native<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return native type hash from instance
Source§

fn self_type_hash_le<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return little endianess type hash from instance
Source§

fn self_type_hash_be<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

return big endianess type hash from instance
Source§

fn self_type_uuid<REF>(&self) -> Uuid
where Self: HashedTypeDef<REF>,

return type hash-derived uuid from instance
Source§

fn self_type_uuid_hyphenated<REF>(&self) -> String
where Self: HashedTypeDef<REF>,

return uuid hyphenated string from instance
Source§

impl<T> HashedTypeUuid for T

Source§

fn type_hash_native<REF>() -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return native type hash
Source§

fn type_hash_le<REF>() -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return little endianess type hash
Source§

fn type_hash_be<REF>() -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return big endianess type hash
Source§

fn type_uuid<REF>() -> Uuid
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return uuid derived from type hash
Source§

fn type_uuid_hyphenated<REF>() -> String
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return uuid hyphenated string
Source§

fn self_type_hash_native<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return native type hash from instance
Source§

fn self_type_hash_le<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return little endianess type hash from instance
Source§

fn self_type_hash_be<REF>(&self) -> u128
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return big endianess type hash from instance
Source§

fn self_type_uuid<REF>(&self) -> Uuid
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return type hash-derived uuid from instance
Source§

fn self_type_uuid_hyphenated<REF>(&self) -> String
where Self: HashedTypeDef<REF>,

👎Deprecated since 0.1.2: please use HashedTypeMethods trait
return uuid hyphenated string from instance
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, O> IntoSlx<T> for O
where T: SlxFrom<O>,

Source§

fn slx(self) -> T

Convert original data into slx data Read more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Serializer + ?Sized,

Source§

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
Source§

fn serialize_metadata(&self, _: &mut S) -> Result<(), <S as Fallible>::Error>

Serializes the metadata for the given type.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> SlxData for T