title: Prolog: check against duplicates in a list
body: <ol>
  <li><p>Write a predicate <code>allDistinct/1</code> whose parameter is a list (of symbols) and which succeeds if all symbols in the list are different.</p>
  
  <pre><code>notin(A,[]).
  notin(A,[B|C]) :-
     A\=B,
     notin(A,C).
  
  allDistinct([]).
  allDistinct([_]).
  allDistinct([A|B]) :-
     notin(A,B), 
     allDistinct(B).
  </code></pre></li>
  </ol>