Top-Level swallows Cyclic Term

Should I create a Ticket on GitHub?

It doesn’t show me _S3:

/* SWI-Prolog 9.3.25 */
?- X = _S1-0, _S1 = _S1-1-0, 
   Y = _S2-1-0, _S2 = _S2-0-1, 
   Z = _S3-1, _S3 = _S3-0-1.
X = _S1-0, % where
    _S1 = _S1-1-0,
Y = _S2-1-0, % where
    _S2 = _S2-0-1,
Z = _S3-1.

Maybe a subtle clash because I already use _SX ?
I do not suspect that it got the cycle wrong, I even
don’t know what cycle it found, since _S3 = ... is missing.

P.S.: Similar but more obvious bug in Trealla Prolog:

https://github.com/trealla-prolog/trealla/issues/843

I’m more happy with a PR that fixes :slight_smile: Otherwise it seems low priority.

Same bug here:

/* SWI-Prolog 9.3.25 */
?- _S = _S-0-1, X = _S-1.
X = _S-1.

I think the solution would be that it takes a fresh
variable _S1, and shows:

?- _S = _S-0-1, X = _S-1.
X = _S1-1, % where
    _S1 = _S1-0-1,

(Nothing of importance)