title: How do I reinstate constraints collected with copy_term/3 in SICStus Prolog?
body: <p>The documentation says that</p>
  
  <blockquote>
    <p><code>copy_term(+Term, -Copy, -Body)</code> makes a copy of <code>Term</code> in which all
    variables have been replaced by new variables that occur nowhere
    outside the newly created term. If <code>Term</code> contains attributed
    variables, <code>Body</code> is unified with a term such that executing <code>Body</code>
    will reinstate equivalent attributes on the variables in <code>Copy</code>.</p>
  </blockquote>
  
  <p>I'm previously affirming numerical CLP(R) constraints over some variables, and at some point I collect these constraints using copy_term/3. Later, when I try to reinstate the constraints using 'call(Body)', I get an "Instantiation error" in arguments of the form <code>[nfr:resubmit_eq(...)]</code></p>
  
  <p>Here's a simplified example that demonstrates the problem:</p>
  
  <pre><code>:-use_module(library(clpr)).
  {Old&gt;=0, A&gt;=0,A=&lt;10, NR= Old+Z, Z=Old*(A/D)}, copy_term(Old,New,CTR), call(CTR).
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>Instantiation error in argument 1 of '.'/2
  ! goal:  [nfr:resubmit_eq([v(-1.0,[_90^ -1,_95^1,_100^1]),v(1.0,[_113^1])])]
  </code></pre>
  
  <p>My question is: how do I reinstate the constraints in <code>Body</code> over <code>New</code>? I haven't been able to find concrete examples.</p>