title: alldifferent/1 predicate in Prolog
body: <pre><code>allsame([]).
  allsame([X]).
  allsame([X,X|Z]) :-
     allsame([X|Z]).
  </code></pre>
  
  <p>How do I change to get the result below?</p>
  
  <pre><code>alldifferent(L): The elements in L are all different.
  
  ?- alldifferent([a, b, b, c, d]).
  false
  ?- alldifferent([a, b, c, d, e]).
  true
  </code></pre>