title: Define a rule to determine if a list contains a given member
body: <p>I have recently started learning prolog, and facing a problem with this question:    </p>
  
  <blockquote>
    <p>Define a rule to determine if a list contains a given member.</p>
  </blockquote>
  
  <p>I searched all over stack overflow to get some links to understand this problem better and write solutions for it but couldn't find anything. Could anyone of you advice to solve this particular problem? </p>
  
  <p>My Approach:</p>
  
  <pre><code>Iterative over the list and see if your member matches with head:
  
  on(Item,[Item|Rest]).  /* is my target item on the list */
  
  on(Item,[DisregardHead|Tail]):-
  
  
            on(Item,Tail).
  </code></pre>
  
  <p>Do you think my approach is correct?</p>