I have now and it seems to be as bad if not worse (using semilex.pl.log file and and original random_cyclic
):
?- between(1,1000000,_),random_cyclic(T1),random_cyclic(T2),random_cyclic(T3),
compare_with_stack(Ct,T1,T2),compare_with_stack(Ct,T2,T3),compare_with_stack(C,T1,T3),C\=Ct.
T1 = _S2, % where
_S1 = s(s(_S1, _S1), 0),
_S2 = s(s(_S1, _S1), _S2),
T2 = s(s(_S1, _S1), 0),
T3 = s(s(T3, 0), 1),
Ct = (>),
C = (<) ;
T1 = s(_S1, _S2), % where
_S1 = s(s(_S1, 0), _S1),
_S2 = s(s(s(_S1, _S2), _S2), _S3),
_S3 = s(0, _S3),
T2 = s(_S1, 0),
T3 = s(T3, 1),
Ct = (>),
C = (<) ;
T1 = s(_S1, 1), % where
_S1 = s(s(_S1, 1), _S1),
T2 = s(T2, s(0, 1)),
T3 = s(s(T2, s(0, 1)), 0),
Ct = (>),
C = (<) ;
T1 = s(s(T1, 1), T1),
T2 = _S1, % where
_S1 = s(_S1, _S2),
_S2 = s(1, _S2),
T3 = s(s(_S1, _S2), T3),
Ct = (<),
C = (>) ;
T1 = s(_S1, 0), % where
_S1 = s(s(_S1, 0), _S1),
T2 = s(s(s(_S1, 0), _S1), 1),
T3 = s(T3, 1),
Ct = (<),
C = (>) ;
T1 = s(_S1, 1), % where
_S1 = s(_S1, s(_S1, s(1, _S1))),
T2 = s(_S1, s(_S1, s(1, _S1))),
T3 = s(_S2, 1), % where
_S2 = s(s(_S2, 1), _S3),
_S3 = s(_S2, _S3),
Ct = (<),
C = (>) ;
T1 = s(T1, 1),
T2 = _S1, % where
_S1 = s(s(_S1, _S2), 0),
_S2 = s(s(1, _S2), 0),
T3 = s(s(_S1, _S2), 1),
Ct = (<),
C = (>) ;
T1 = _S2, % where
_S1 = s(s(_S1, 0), _S1),
_S2 = s(_S1, s(_S2, 0)),
T2 = s(_S1, 0),
T3 = s(T3, 1),
Ct = (>),
C = (<) ;
T1 = s(s(T1, 0), 1),
T2 = s(s(T2, T2), 0),
T3 = s(s(T2, T2), s(T3, T3)),
Ct = (<),
C = (>) ;
T1 = s(s(_S1, 1), 1), % where
_S1 = s(s(_S1, 1), _S1),
T2 = s(s(_S1, 1), _S1),
T3 = s(s(T3, T3), 1),
Ct = (<),
C = (>) ;
false.
Definitely a problem, but I’m having difficulty “reverse-engineering” this test output (with %where
’s) back to Prolog to re-construct the fail cases.