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
withmultiset2
.Returns: The multiset union of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
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
withmultiset2
.Returns: The multiset intersection of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
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
andmultiset2
.Returns: The multiset difference of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
add
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]¶ Return the multiset addition of
multiset1
andmultiset2
.Returns: The multiset addition of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
substrict
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]¶ Return
multiset1
ifmultiset1
is a subset ofmultiset2
orUndef()
if not.Returns: The substriction of multiset1
andmultiset2
(may returnUndef()
). Also returnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
superstrict
(multiset1: 'P( M x N )', multiset2: 'P( M X N )', _checked=True) → 'P( M X N )'[source]¶ Return
multiset1
ifmultiset1
is a superset ofmultiset2
orUndef()
if not.Returns: The superstriction of multiset1
andmultiset2
(may returnUndef()
). Also returnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
is_subset_of
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool[source]¶ Return whether
multiset1
is a submultiset ofmultiset2
.Returns: True
ifmultiset1
is a submultiset ofmultiset2
,False
if not. ReturnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
is_superset_of
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool[source]¶ Return whether
multiset1
is a supermultiset ofmultiset2
.Returns: True
ifmultiset1
is a supermultiset ofmultiset2
,False
if not. ReturnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
-
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.
add
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Convenience redirection to
Algebra.add
.
-
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
ifobj
is a multiset (an instance ofMultiset
),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.Returns: True
ifobj
is an absolute multiset,False
if not.
-
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
orUndef()
ifset_of_multisets
is not aSet
or any of its members are not instances ofMultiset
.
-
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
orUndef()
ifset_of_multisets
is not aSet
or any of its members are not instances ofMultiset
.