예제 #1
0
    def get_ground_set(self) -> _structure.Structure:
        """Return the :term:`ground set` of the lowest-level algebra of this :class:`Multiset`."""
        if len(self.data) == 0:
            return _structure.Structure()

        elements_ground_set = _structure.Union(elem.get_ground_set()
                                               for elem in self.data)
        if len(elements_ground_set.data) == 1:
            return _structure.PowerSet(
                _structure.CartesianProduct(
                    _misc.get_single_iter_elem(elements_ground_set.data),
                    _structure.GenesisSetN()))
        else:
            return _structure.PowerSet(
                _structure.CartesianProduct(elements_ground_set,
                                            _structure.GenesisSetN()))
예제 #2
0
 def get_ground_set(self) -> _structure.Structure:
     """Return the :term:`ground set` of the lowest-level algebra of ``self``.
     """
     return _structure.CartesianProduct(self.left.get_ground_set(),
                                        self.right.get_ground_set())
예제 #3
0
def get_absolute_ground_set() -> _structure.Structure:
    """Return the :term:`absolute ground set` of this :term:`algebra`."""
    return _structure.PowerSet(
        _structure.CartesianProduct(_relations.get_absolute_ground_set(),
                                    _structure.GenesisSetN()))
예제 #4
0
def get_ground_set() -> _structure.Structure:
    """Return the :term:`ground set` of this :term:`algebra`."""
    return _structure.PowerSet(
        _structure.CartesianProduct(_structure.GenesisSetM(),
                                    _structure.GenesisSetN()))