name = 'subset/2' slug = 'generate all subsets of a set' description = '''\
subset(Set, Subset)
: the set Subset
is a subset of Set
. This predicate should generate all valid solutions, one by one.
?- subset([1,2,3], SS). SS = [1,2,3] ; SS = [1,2] ; SS = [1,3] ; SS = [1] ; SS = [2,3] ; SS = [2] ; SS = [3] ; SS = [].''' hint = {}