Yes persistent, almost trivial, but in case of “undecidable”, I don’t want one answer one time and a different answer the next.
As I, perhaps wrongly, interpreted the match stack algorithm: if you encounter a compound term pair that are already being compared, assume they’re equal and continue, thus avoiding an infinite loop. If there’s a subsequent argument that forces it one way or the other, then that will ripple back upon unwinding the recursive compare. I think this is what @j4n_bur53’s shallow lexical order was getting at: if undecidable, look further, not deeper.
I think you need to extend Carllson’s example to test transitivity, for example (using my logical compare):
?- A=s(B,0),B=s(C,1),C=s(A,2), comparable(OAC,A,C), comparable(OCB,C,B), comparable(OAB,A,B).
A = s(s(s(A, 2), 1), 0),
B = s(s(A, 2), 1),
C = s(A, 2),
OAC = OCB, OCB = OAB, OAB = (>).
If transitivity of compare_with_stack
can’t be “proven”, are there any counter examples that fail the transitivity test?
The level of my mathematical skills is about the same as my C programming skills, so this may all be rubbish.