title: Unexpected behavior of frozen/2
body: <p>I was playing around with the <a href="/questions/tagged/prolog-coroutining" class="post-tag" title="show questions tagged &#39;prolog-coroutining&#39;" rel="tag">prolog-coroutining</a> predicates <code>freeze/2</code> and <code>frozen/2</code>:</p>
  
  <pre><code>?- freeze(X,a=a), frozen(X,Goal).
  ?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal).
  </code></pre>
  
  <p><a href="/questions/tagged/sicstus-prolog" class="post-tag" title="show questions tagged &#39;sicstus-prolog&#39;" rel="tag">sicstus-prolog</a> (version 4.5.1 for x86_64) gave these answers:</p>
  
  <pre>
  | ?- freeze(X,a=a), frozen(X,Goal).
  <b>Goal = prolog:freeze(X,user:(a=a))</b>,
  prolog:freeze(X,user:(a=a)) ? ;
  no
  | ?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal).
  Y = X,
  <b>Goal = (user:(a=a),prolog:freeze(X,user:(b=b)))</b>,
  prolog:freeze(X,user:(a=a)),
  prolog:freeze(X,user:(b=b)) ? ;
  no
  </pre>
  
  <p>Now <code>Goal = <b>prolog:freeze(X,</b>user:(a=a)<b>)</b></code> I did not expect!</p>
  
  <p>What I <em>did</em> expect were answers like the ones given by <a href="/questions/tagged/swi-prolog" class="post-tag" title="show questions tagged &#39;swi-prolog&#39;" rel="tag">swi-prolog</a> version 8.0.3:</p>
  
  <pre>
  ?- freeze(X,a=a), frozen(X,Goal).
  <b>Goal = user:(a=a)</b>,
  freeze(X, a=a).
  ?- freeze(X,a=a), freeze(Y,b=b), X=Y, frozen(X,Goal).
  X = Y,
  <b>Goal = (user:(a=a), user:(b=b))</b>,
  freeze(Y, a=a),
  freeze(Y, b=b).
  </pre>
  
  <p>Arguably, both the SICStus answers <em>and</em> the SWI answers are correct...</p>
  
  <p><strong>But is there a deeper reason for the somewhat peculiar answer(s) given by SICStus?</strong></p>