title: Prolog: solving multi-variable arithmetics
body: <p>I am having trouble writing a Prolog predicate that returns the variable values for some arithmetic.</p>
  
  <p>For example, the function should return what x and y can be from the equation: 12 = 3x + 2y.</p>
  
  <p>Currently my code can only work the other way around:</p>
  
  <pre><code>foo(S,X,Y) :- 
     S is 3*X+2*Y.
  </code></pre>
  
  <p>Any ideas?</p>