title: Incrementing numbers in Prolog
body: <p>I'm trying to implement an increment in prolog, and have written the following code: </p>
  
  <pre><code>coordinate(X,Y,Z):- 
             X is 1, 
             Y is 1,
             Z is 1, 
             coordinate(X1,Y1,Z1), 
             X1 is X+1, 
             Y1 is Y+1, 
             Z1 is Z.
  </code></pre>
  
  <p>I also tried:</p>
  
  <pre><code>coordinate(X,Y,Z):-
            X is 1,
            Y is 1,
            Z is 1,
            coordinate(X+1,Y+1,X+1).
  </code></pre>
  
  <p>Neither of these work. Can anyone explain why?</p>