Re: copy_term/2 in Eclipse
- From: Jens Claßen <jens_c@xxxxxxxxxx>
- Date: Fri, 31 Aug 2007 15:12:57 +0200
so it might be something (wrong) with the toplevel printing routines
and not necessarily with copy_term itself. Joachim will enligthen us, I'm
sure :-)
Thank you very much, that was the right hint! The predicate and thus my
program works fine; the problem was only in the way the toplevel and
debugger printing routines displayed the variables. To obtain the
"right" output, one has to do the following:
[eclipse 1]: set_flag(variable_names,off).
Yes (0.00s cpu)
Then the output is the following:
[eclipse 2]: copy_term(s(X,a,Y,X), C).
X = _67
Y = _76
C = s(_183, a, _185, _183)
Yes (0.00s cpu)
and
[eclipse 3]: A = f(X), copy_term(A,B), X = 1.
A = f(1)
X = 1
B = f(_249)
Yes (0.00s cpu)
and
[eclipse 4]: copy_term(f(X),Z), Z = f(A), A == X.
No (0.00s cpu)
[There was no change in the last example, but I think there actually
should not be any. The query fails because of "A==X"; A and X are
distinct variables.]
But again, turning variable names off is *not* necessary for the
predicate to work properly; it is just needed in order for the toplevel
output to not replace the newly generated variables (like _183) by their
source's name (like X).
Regards
Jens
.
- References:
- copy_term/2 in Eclipse
- From: Jens Claßen
- Re: copy_term/2 in Eclipse
- From: bart demoen
- copy_term/2 in Eclipse
- Prev by Date: Re: how to rename variables?
- Next by Date: Re: copy_term/2 in Eclipse
- Previous by thread: Re: copy_term/2 in Eclipse
- Next by thread: Re: copy_term/2 in Eclipse
- Index(es):
Relevant Pages
|
|