def difference(other)
      if other.is_a?(RelativeComplement)
        # A ∖ ¬B = A ∩ B
        intersection(other.complement)
      elsif other.is_a?(AbstractSet)
        if other.empty?
          self
        else
          # A ∖ B = A ∩ ¬B
          hash = @hash.clone.delete_if{|o,_| other.include?(o) }

          if hash.empty?
            NullSet.build
          else
            RelativeSet.new(hash)
          end
        end
      else
        difference(Cantor.build(other))
      end
    end
def difference(other)
      if other.is_a?(RelativeComplement)
        # A ∖ ¬B = A ∩ B
        intersection(other.complement)
      elsif other.is_a?(AbstractSet)
        if other.empty?
          self
        else
          # A ∖ B = A ∩ ¬B
          hash = @hash.clone.delete_if{|o,_| other.include?(o) }

          if hash.empty?
            NullSet.build
          else
            RelativeSet.new(hash)
          end
        end
      else
        difference(Cantor.build(other))
      end
    end
(see AbstractSet#difference)