blob: 80745f62c5420db3f79c18b833f86fb14d7f12d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
name = 'subset/2'
slug = 'generate all subsets of a set'
description = '''\
<p><code>subset(Set, Subset)</code>: the set <code>Subset</code> is a subset of <code>Set</code>. This predicate should generate all valid solutions, one by one.</p>
<pre>
?- 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 = [].
</pre>'''
hint = {}
|