Re: how to rename variables?
- From: Jan Wielemaker <jan@xxxxxxxxxxxxxxxxxxx>
- Date: 25 Aug 2007 18:49:38 GMT
On 2007-08-25, Markus Triska <triska@xxxxxxxx> wrote:
Chip Eastham <hardmath@xxxxxxxxx> writes:
you will need to apply copy_term/2 to each entry in the list
You can also use:
%?- Ls = [X+Y, f(X,g(X))], findall(C, member(C, Ls), Cs).
%@ Cs = [_G317+_G318, f(_G306, g(_G306))]
And copy_term(T, C) can also be obtained by: findall(T, T==T, [C]).
True, but copy_term/2 is more efficient and the detailed semantics
of bagof, setof and findall are not that clear. In general, I try
to avoid them.
Cheers --- Jan
.
- Follow-Ups:
- Re: how to rename variables?
- From: Markus Triska
- Re: how to rename variables?
- References:
- how to rename variables?
- From: Giovanni Gherdovich
- Re: how to rename variables?
- From: Bart Demoen
- Re: how to rename variables?
- From: Giovanni Gherdovich
- Re: how to rename variables?
- From: Chip Eastham
- Re: how to rename variables?
- From: Markus Triska
- how to rename variables?
- Prev by Date: Re: how to rename variables?
- Next by Date: Re: Prolog doesn't give multiple solutions to my goal.
- Previous by thread: Re: how to rename variables?
- Next by thread: Re: how to rename variables?
- Index(es):
Relevant Pages
|
|