Calculates the power set of a set.