title: Creating a set from a list in Prolog
body: <p>So basically my task is to create a Set out of a given List with a predicate containing 2 parameter.</p>
  
  <p>The first one is the list and the second is the Set´s value.</p>
  
  <p>However somehow it gives me a List which contains the Set as the Head and a Tail with a variable:</p>
  
  <pre><code>2 ?- list2set([2,3,4,4] , X).
  X = [2, 3, 4|_G2840] .
  </code></pre>
  
  <p>thats the code:</p>
  
  <pre><code>list2set( [] , _).
  list2set([ListH|ListT] , Set ) :- member(ListH, Set) , list2set(ListT , Set).
  </code></pre>
  
  <p>It seems to be a really basic mistake I made. </p>