title: Prolog - Arguments are not sufficiently instantiated
body: <p>I am writing a little program which counts how many elements in a list are not numbers.
  Here is my code:</p>
  
  <pre><code>not_number([],0).
  not_number([X|T],R):- 
      not(number(X)),
      R1 is R+1,  
      not_number(T,R1). 
  
  not_number([_|Tail],Result):-
      not_number(Tail,Result).  
  </code></pre>
  
  <p>If I execute code like this :</p>
  
  <pre><code>?- not_number([1,2,3,5], R).
  </code></pre>
  
  <p>I am getting that R = 0 (as it should be)</p>
  
  <pre><code>R = 0.
  </code></pre>
  
  <p>But if I put a character in the list:</p>
  
  <pre><code>?- not_number([1,2,3,5,a], R).
  </code></pre>
  
  <p>then I am getting this error:</p>
  
  <pre><code>ERROR: not_number/2: Arguments are not sufficiently instantiated
     Exception: (10) not_number([a], _G247) ? 
  </code></pre>
  
  <p>Can someone explain whats wrong with code? I am new to prolog.</p>