title: Prolog - multiplying by addition
body: <p>I need simple fuction in SWI-prolog which multiplying by addition. Something like m(X,Y,Z) where for example X=5, Z=3 &lt;==> 5*3. Y is result: Y=5, Y=10, Y=15 [stop]. I was thinking about something like that: </p>
  
  <pre><code>m(X,Y,Z):- Z&gt;0, /*when Z reaches 0 you stop */ I=X+X, W=Z-1, m(I,Y,W).
  </code></pre>
  
  <p>But it always return "false" and dunno why.</p>