Navigation
Synopsis The powerset (excluding the empty set) of a set value.
Function set[set[&T]] power1(set[&T] st)
Usage import Set;
Description Returns all subsets (excluding the empty set) of s.
Examples
rascal>import Set;
ok
rascal>power1({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 power1({-15, -16, 16, 9, 10}) is

Question [2].
power1({"Orange", "Basil"}) == 



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.