Calculates and returns the powerset of a Set.

powerset(x, simplify = FALSE)

## Arguments

x Set logical, if TRUE then tries to simplify the result to a Set otherwise creates an object of class PowersetSet.

Set

## Details

A powerset of a set, S, is defined as the set of all subsets of S, including S itself and the empty set.

Other operators: setcomplement(), setintersect(), setpower(), setproduct(), setsymdiff(), setunion()
# simplify = FALSE is default
powerset(Set$new(1, 2)) #> ℘({1, 2}) powerset(Set$new(1, 2), simplify = TRUE)
powerset(Interval$new()) #> ℘([-∞,+∞]) # powerset of powersets powerset(powerset(Reals$new()))
#> ℘(℘(ℝ)) powerset(powerset(Reals$new()))$properties\$cardinality
#> [1] "Beth3"