title: How to get the not effect in Prolog
body: <p>I am trying to create a rule that recursively calls itself, and finds all possible paths to traverse a directed graph. I am using a <code>findall()</code> to do so. The functions is <code>traverse(Start,End)</code>.</p>
  <p>I have:</p>
  <pre class="lang-none prettyprint-override"><code>traverse(Start,End,[li]) :-
     node(Start,End),
     append(End,Li).
  
  traverse(Start,End,[Li]) :-
     node(Start,Z),
     traverse(Z,End),
     append(Start,Li).
  
  /*here I would like to check that Z is not a member of Li before
    I call traverse(Z,End), I know I can check that it is a member
    using member(Z,Li) but how to I check it is not a member in 
    prolog*/
  
  findalltraverses(Start,End,[list]) :-
     findall(_,traverse(Start,End).
  </code></pre>