예제 #1
0
def is_member(obj: _mo.MathObject) -> bool:
    """Return ``True`` if ``obj`` is a member of the :term:`ground set` of this :term:`algebra`.

    .. note:: This function may call :meth:`~.MathObject.get_ground_set` on ``obj``. The result
        of this operation is cached.
    """
    _mo.raise_if_not_mathobject(obj)
    if not obj.cached_is_relation and not obj.cached_is_not_relation:
        obj.cache_is_relation(obj.get_ground_set().is_subset(get_ground_set()))
    return obj.cached_is_relation