History dependent semi_lex_compare/3

No, it’s meant to implement a logical compare (defer when a var encountered) to address the the OP here How to compare/3 without surprises on non-ground terms? and ran into the cyclic term comparison issue as an extension.

I tried to work with term_factorized but abandoned it when compare_with_stack seemed to be the better option and I haven’t seen a reason to revisit it.