title: I want to make a prolog program to do sum of non-duplicate numbers
body: <p>This is my sum program I want edit it to remove the  duplicate ...</p>
  
  <pre><code>sum([], N):-N=0,!.
      sum([H|T], N):- sum(T, X),
       N is X + H.
  </code></pre>
  
  <p>Input [4, 5, 3, 2, 2, 1]. Output 13 (i.e. 4+5+3+1)          </p>