I wrote codes (mcoa_vec/2) to compute the minimum coalgebra for given a rational term using ==/2. Output is of a vector form:
Using mcoa_vec/2, I defined a comparing predicate mcomp/3
mcomp(C, X, Y):-
mcoa_vec(X, U),
mcoa_vec(Y, V),
compare(C, U, V).
Surprisingly, no counter example against transitivity is found so far, though not tested extensively. But I am interested in
this experiment, which seems suggest that minimum coalgebra of a (rational) term represents some lexical ordering of rational terms. This is unexpected happening. I take time for a while to see what happened.
% ?- mcoa_vec(f(g(a), b), V).
%@ V = m(f(2, 4), g(3), a, b).
% ?- X=f(Y,0), Y=f(X,1), mcoa_vec(X, U), mcoa_vec(Y, V).
%@ X = f(f(X, 1), 0),
%@ Y = f(X, 1),
%@ U = m(f(2, 4), f(1, 3), 1, 0),
%@ V = m(f(2, 4), f(1, 3), 0, 1).