Closed ghost closed 2 years ago
Thanks for reporting. This is a known problem with cyclic terms for dif/2. If I recall correctly a work around is to use this alternative. Unfortunately there are scenarios where this behaves quadratic while dif/2 behaves linear.
?- when(?=(A,B), A \=B).
Cyclic term but:
?- A=[B|_], C=[_|_], C=[B|B], acyclic_term([A,B,C]).
A = [B|_],
C = [B|B].
?- A=[B|_], C=[_|_], C=[B|B], C=A, acyclic_term([A,B,C]).
A = C, C = [B|B].
I don't understand.
You are right. I misread. Looks like a new bug. The work-around still works.
Thanks for your patience. Should be fixed with SWI-Prolog/swipl-devel@e8c2e0dd02446e61543e6c41bb76429c8186c5f0
I tried this query on SWISH:
I also tested it on stable version 8.4.2 and I have the same result.