

def used_constants(*terms):
    '\n    Returns a frozenset of constants used in given terms.\n    '
    t = (terms[0] if (len(terms) == 1) else terms)
    if (type(t) is Const):
        return frozenset((t,))
    elif (type(t) in (tuple, Var, Apply, Eq, Ite, Not, And, Or, Implies, Iff, ForAll, Exists)):
        return union(*(used_constants(x) for x in t))
    elif hasattr(t, 'args'):
        return union(*(used_constants(x) for x in t.args))
    else:
        assert False, type(t)

dataset/ETHPy150Open Microsoft/ivy/ivy/logic_util.py used_constants/original