def symmetric_difference(other)
      if other.is_a?(RelativeComplement)
        # A ⊖ ~B = (A ∖ ¬B) | (¬B ∖ A)
        #        = (A ∩ B)  | (¬B ∩ ¬A)
        #        = (B ∖ ¬A) | (¬A ∖ B)
        #        = ~A ⊖ B
        intersection(other.complement).
          union(other.intersection(complement))
      else
        # A ⊖ B = (A ∖ B) | (B ∖ A)
        #       = (A ∪ B) - (A ∩ B)
        other = Cantor.build(other)

        if other.empty?
          self
        else
          union(other).difference(intersection(other))
        end
      end
    end
def symmetric_difference(other)
      if other.is_a?(RelativeComplement)
        # A ⊖ ~B = (A ∖ ¬B) | (¬B ∖ A)
        #        = (A ∩ B)  | (¬B ∩ ¬A)
        #        = (B ∖ ¬A) | (¬A ∖ B)
        #        = ~A ⊖ B
        intersection(other.complement).
          union(other.intersection(complement))
      else
        # A ⊖ B = (A ∖ B) | (B ∖ A)
        #       = (A ∪ B) - (A ∩ B)
        other = Cantor.build(other)

        if other.empty?
          self
        else
          union(other).difference(intersection(other))
        end
      end
    end
(see AbstractSet#symmetric_difference)