Navigation
Synopsis Determine the powerset of a set.
Function set[set[&T]] power(set[&T] st)
Usage import Set;
Description Returns a set with all subsets of s.
Examples
rascal>import Set;
ok
rascal>power({1,2,3,4});
set[set[int]]: {
  {},
  {1},
  {2},
  {1,3,4},
  {2,3,4},
  {1,2,3,4},
  {1,2},
  {3},
  {1,3},
  {4},
  {2,3},
  {1,4},
  {1,2,3},
  {2,4},
  {1,2,4},
  {3,4}
}

Questions
Question [1].
The type of power({17, 16, -17, 4, -11}) is

Question [2].
power({"Gooseberry", "Nutmeg"}) == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.