algebraixlib.algebras.multisets module

This module contains the algebra of multisets and related functionality.

class algebraixlib.algebras.multisets.Algebra[source]

Bases: object

Provide the operations and relations that are members of the algebra of multisets.

This class contains only static member functions. Its main purpose is to provide a namespace for and highlight the operations and relations that belong to the algebra of multisets. All member functions are also available at the enclosing module scope.

static union(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]

Return the multiset union of multiset1 with multiset2.

Returns:The multiset union of multiset1 and multiset2 or Undef() if multiset1 or multiset2 are not instances of Multiset.
static intersect(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]

Return the multiset intersection of multiset1 with multiset2.

Returns:The multiset intersection of multiset1 and multiset2 or Undef() if multiset1 or multiset2 are not instances of Multiset.
static minus(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]

Return the multiset difference of multiset1 and multiset2.

Returns:The multiset difference of multiset1 and multiset2 or Undef() if multiset1 or multiset2 are not instances of Multiset.
static addition(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]

Return the multiset addition of multiset1 and multiset2.

Returns:The multiset addition of multiset1 and multiset2 or Undef() if multiset1 or multiset2 are not instances of Multiset.
static substrict(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]

Return multiset1 if multiset1 is a subset of multiset2 or Undef() if not.

Returns:The substriction of multiset1 and multiset2 (may return Undef()). Also return Undef() if multiset1 or multiset2 are not instances of Multiset.
static superstrict(multiset1: 'P( M x N )', multiset2: 'P( M X N )', _checked=True) → 'P( M X N )'[source]

Return multiset1 if multiset1 is a superset of multiset2 or Undef() if not.

Returns:The superstriction of multiset1 and multiset2 (may return Undef()). Also return Undef() if multiset1 or multiset2 are not instances of Multiset.
static is_subset_of(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool[source]

Return whether multiset1 is a submultiset of multiset2.

Returns:True if multiset1 is a submultiset of multiset2, False if not. Return Undef() if multiset1 or multiset2 are not instances of Multiset.
static is_superset_of(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool[source]

Return whether multiset1 is a supermultiset of multiset2.

Returns:True if multiset1 is a supermultiset of multiset2, False if not. Return Undef() if multiset1 or multiset2 are not instances of Multiset.
algebraixlib.algebras.multisets.union(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'

Convenience redirection to Algebra.union.

algebraixlib.algebras.multisets.intersect(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'

Convenience redirection to Algebra.intersect.

algebraixlib.algebras.multisets.minus(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'

Convenience redirection to Algebra.minus.

algebraixlib.algebras.multisets.addition(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'

Convenience redirection to Algebra.addition.

algebraixlib.algebras.multisets.substrict(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'

Convenience redirection to Algebra.substrict.

algebraixlib.algebras.multisets.superstrict(multiset1: 'P( M x N )', multiset2: 'P( M X N )', _checked=True) → 'P( M X N )'

Convenience redirection to Algebra.superstrict.

algebraixlib.algebras.multisets.is_subset_of(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool

Convenience redirection to Algebra.is_subset_of.

algebraixlib.algebras.multisets.is_superset_of(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool

Convenience redirection to Algebra.is_superset_of.

algebraixlib.algebras.multisets.get_name() → str[source]

Return the name and ground set of this algebra in string form.

algebraixlib.algebras.multisets.get_ground_set() → algebraixlib.structure.Structure[source]

Return the ground set of this algebra.

algebraixlib.algebras.multisets.get_absolute_ground_set() → algebraixlib.structure.Structure[source]

Return the absolute ground set of this algebra.

algebraixlib.algebras.multisets.is_member(obj: algebraixlib.mathobjects.mathobject.MathObject) → bool[source]

Return whether obj is a member of the ground set of this algebra.

Returns:True if obj is an instance of Multiset, False if not.
algebraixlib.algebras.multisets.is_absolute_member(obj: algebraixlib.mathobjects.mathobject.MathObject) → bool[source]

Return whether obj is a member of the absolute ground set of this algebra.

return:True if obj is an absolute set, False if not.

Note

This function calls get_ground_set() on obj.

algebraixlib.algebras.multisets.demultify(multiset: 'P( M x N )', _checked=True) → 'P( M )'[source]

Return a set based on multiset that contains all elements without multiples.

algebraixlib.algebras.multisets.big_union(set_of_multisets: 'PP( M x N )', _checked=True) → 'P( M x N )'[source]

Return the set_of_multisets union of all members of set_of_multisets.

Returns:The multiset union of all members of set_of_multisets or Undef() if set_of_multisets is not a Set or any of its members are not instances of Multiset.
algebraixlib.algebras.multisets.big_intersect(set_of_multisets: 'PP( M x N )', _checked=True) → 'P( M x N )'[source]

Return the multiset intersection of all members of multiset.

Returns:The multiset intersection of all members of set_of_multisets or Undef() if set_of_multisets is not a Set or any of its members are not instances of Multiset.