# NOT RUN {
# absolute complement
setcomplement(Set$new(1, 2, 3, universe = Reals$new()))
setcomplement(Set$new(1, 2, universe = Set$new(1, 2, 3, 4, 5)))
# complement of two sets
Set$new(-2:4) - Set$new(2:5)
setcomplement(Set$new(1, 4, "a"), Set$new("a", 6))
# complement of two intervals
Interval$new(1, 10) - Interval$new(5, 15)
Interval$new(1, 10) - Interval$new(-15, 15)
Interval$new(1, 10) - Interval$new(-1, 2)
# complement of mixed set types
Set$new(1:10) - Interval$new(5, 15)
Set$new(5, 7) - Tuple$new(6, 8, 7)
# FuzzySet-Set returns a FuzzySet
FuzzySet$new(1, 0.1, 2, 0.5) - Set$new(2:5)
# Set-FuzzySet returns a Set
Set$new(2:5) - FuzzySet$new(1, 0.1, 2, 0.5)
# complement of conditional sets
ConditionalSet$new(function(x, y, simplify = TRUE) x >= y) -
ConditionalSet$new(function(x, y, simplify = TRUE) x == y)
# complement of special sets
Reals$new() - NegReals$new()
Rationals$new() - PosRationals$new()
Integers$new() - PosIntegers$new()
# }
Run the code above in your browser using DataLab