FIXED: incorrect handling of (^)/2 in setof/3 and bagof/3. The new version should now fully comply to ISO, it further fixes the following behaviour. For best performance, iso_free_variables/4 could be rewritten in C.
FIXED: incorrect handling of (^)/2 in setof/3 and bagof/3. The new version should now fully comply to ISO, it further fixes the following behaviour. For best performance, iso_free_variables/4 could be rewritten in C.

Incorrect:

?- setof(t, member(X^2,[1^2,3^2]),Ts).
Ts = "t".

Correct:

?- setof(t, member(X^2,[1^2,3^2]),Ts).
X = 1,
Ts = "t" ;
X = 3,
Ts = "t".

Also, setof/3 and bagof/3 do no depend on (^)/2.

?- [user].
|: (A^B) :- throw(you_called(A^B)).
|: % user://1 compiled 0.00 sec, 472 bytes
true.

?- setof(t, X^member(X,[1,2]),Ts).
Ts = "t".

edechter/swipl-devel,mndrix/swipl-devel,koryonik/swipl-devel,koryonik/swipl-devel,jn7163/swipl-devel,koryonik/swipl-devel,mndrix/swipl-devel,koryonik/swipl-devel,mndrix/swipl-devel,mndrix/swipl-devel,jn7163/swipl-devel,koryonik/swipl-devel,jn7163/swipl-devel,edechter/swipl-devel,edechter/swipl-devel,edechter/swipl-devel,jn7163/swipl-devel,mndrix/swipl-devel,edechter/swipl-devel,jn7163/swipl-devel