def difference(t1: set[Tag], t2: set[Tag]):
    """Return a set of predicates representing the difference

    If the difference is empty, will return a contradictory set of predicates.
    """

    p1, n1 = decompose_tags(t1)
    p2, n2 = decompose_tags(t2)

    pos = p1.union(n2 - n1)
    neg = n1.union(p2 - p1)

    return pos.union(Negated(n) for n in neg)
Return a set of predicates representing the difference

    If the difference is empty, will return a contradictory set of predicates.
    
infinigen/core/tags.py