title: Subsets in Prolog
body: <p>I'm looking for a predicate that works as this:</p>
  
  <pre><code>?- subset([1,2,3], X).
  X = [] ;
  X = [1] ;
  X = [2] ;
  X = [3] ;
  X = [1, 2] ;
  X = [1, 2, 3] ;
  X = [2, 3] ;
  ...
  </code></pre>
  
  <p>I've seen some <code>subset</code> implementations, but they all work when you want to check if one list is a subset of the another, not when you want to generate the subsets. Any ideas?</p>