algebraixlib.algebras.multisets module¶
This module contains the algebra of multisets.
-
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 binary union of
multiset1
withmultiset2
.Returns: The 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 binary intersection of
multiset1
withmultiset2
.Returns: The 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 difference of
multiset1
andmultiset2
.Returns: The difference of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
static
addition
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'[source]¶ Return the addition of
multiset1
andmultiset2
.Returns: The 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 the substriction of
multiset1
andmultiset2
.Returns: multiset1
ifmultiset1
is a subset ofmultiset2
orUndef()
if not. Also returnUndef()
ifmultiset1
ormultiset2
are not instances ofSet
.
-
static
superstrict
(multiset1: 'P( M x N )', multiset2: 'P( M X N )', _checked=True) → 'P( M X N )'[source]¶ Return the superstriction of
multiset1
andmultiset2
.Returns: multiset1
ifmultiset1
is a superset ofmultiset2
orUndef()
if not. 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 subset ofmultiset2
.Returns: True
ifmultiset1
is a subset 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 superset ofmultiset2
.Returns: True
ifmultiset1
is a superset ofmultiset2
,False
if not. ReturnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.Note
Reasonably up to date up to here. I haven’t yet worked on the rest.
-
static
-
algebraixlib.algebras.multisets.
union
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Return the binary union of
multiset1
withmultiset2
.Returns: The union of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
intersect
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Return the binary intersection of
multiset1
withmultiset2
.Returns: The intersection of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
minus
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Return the difference of
multiset1
andmultiset2
.Returns: The difference of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
addition
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Return the addition of
multiset1
andmultiset2
.Returns: The addition of multiset1
andmultiset2
orUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
substrict
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → 'P( M x N )'¶ Return the substriction of
multiset1
andmultiset2
.Returns: multiset1
ifmultiset1
is a subset ofmultiset2
orUndef()
if not. Also returnUndef()
ifmultiset1
ormultiset2
are not instances ofSet
.
-
algebraixlib.algebras.multisets.
superstrict
(multiset1: 'P( M x N )', multiset2: 'P( M X N )', _checked=True) → 'P( M X N )'¶ Return the superstriction of
multiset1
andmultiset2
.Returns: multiset1
ifmultiset1
is a superset ofmultiset2
orUndef()
if not. Also returnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
is_subset_of
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool¶ Return whether
multiset1
is a subset ofmultiset2
.Returns: True
ifmultiset1
is a subset ofmultiset2
,False
if not. ReturnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
is_superset_of
(multiset1: 'P( M x N )', multiset2: 'P( M x N )', _checked=True) → bool¶ Return whether
multiset1
is a superset ofmultiset2
.Returns: True
ifmultiset1
is a superset ofmultiset2
,False
if not. ReturnUndef()
ifmultiset1
ormultiset2
are not instances ofMultiset
.Note
Reasonably up to date up to here. I haven’t yet worked on the rest.
-
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
True
ifobj
is a member of the ground set of this algebra.Returns: True
ifobj
is an instance ofMultiset
.
-
algebraixlib.algebras.multisets.
is_absolute_member
(obj: algebraixlib.mathobjects.mathobject.MathObject) → bool[source]¶ Return
True
ifobj
is a member of the absolute ground set of this algebra.return: True
ifobj
is an absolute set.Note
This function calls
get_ground_set()
onobj
.
-
algebraixlib.algebras.multisets.
demultify
(multiset: 'P( M x N )', _checked=True) → 'P( M )'[source]¶
-
algebraixlib.algebras.multisets.
big_union
(multiset: 'PP( M x N )', _checked=True) → 'P( M x N )'[source]¶ Return the union of all members of
multiset
.Returns: The union of all members of multiset
orUndef()
ifmultiset
or any of its members are not instances ofMultiset
.
-
algebraixlib.algebras.multisets.
big_intersect
(multisets: 'PP( M x N )', _checked=True) → 'P( M x N )'[source]¶ Return the intersection of all members of
multiset
.Returns: The intersection of all members of multiset
orUndef()
ifmultiset
or any of its members are not instances ofMultiset
.