title: Prolog replace "+" with "-"
body: <p>I wish to write a predicate <code>invert(X, Y)</code>, that holds when <code>Y</code> is <code>X</code> but with every occurence of <code>+</code> replaced with <code>-</code>. </p>
  
  <p>e.g.</p>
  
  <pre><code>?- invert(2 + 3, 2 - 3). 
  yes. 
  </code></pre>
  
  <p>e.g.</p>
  
  <pre><code>?- invert(3 + (2 + 4), X). 
  X = 3 - (2 - 4).
  </code></pre>