History dependent semi_lex_compare/3

No objection to opening a second ticket for term_factorized; I also wasn’t sure whether the problem was due to rbtree’s use of the broken compare/3 or whether it was some other issue with cyclic terms.

And even if term_factorize was fixed, is there any reason (other than performance tradeoffs) for preferring it rather than your “custom” factorize/3 for comparing cyclic terms?

factorize/3 is already yesterday’s snow, check out naish/2.
But anything should work that doesn’t give a stack overflow.

No use confusing things with variations; let’s focus on naish/2 as the prototypical predicate going forward.