title: How compute Index of element in a list?
body: <p>I am starting to play with prolog, and with a Java background it's really difficult for me so here is a silly question:</p>
  
  <p>How will you write an indexOf predicate able to give the index of a given element in a given list ?</p>
  
  <p>My first question is about the predicate arity: I guess it should be 3 such as:</p>
  
  <pre><code>indexOf(List,Element, Index) :- ......
  </code></pre>
  
  <p>Am I right ? May be this already exists in built-in libraries but I want to learn how to write it. Thanks for your help.</p>