So far you @jp-diegidio didn’t publish such a Prolog interpreter,
even not a prototype, because you are only citing from your
fantasy interpretation of the Alain Colmerauer paper. Also that
it could be used for comparison is pure imagination. Also
@kuniaki.mukai didn’t publish his minimal coa predicate, since
he explicitly declared it private. It is also impossible to reproduce
any code that uses the minimal coa, since it is private. In general
minimal terms alone do not guarantee that comparison can be
performed. You can make an easy test, only use minimal terms
with SWI-Prolog compare/3, you find a Suzumura Inconsistency:
?- sample((compare(<,X,Y),compare(<,Y,Z),compare(<,Z,X))).
X = s(X,1), %%% Already minimal!
Y = s(Y,Y), %%% Already minimal!
Z = s(s(Z,1),_). %%% Already minimal!
So the problem is minimal terms and compare/3 together. I do not
remember that Alain Colmeraure mentions compare/3 in his paper.
Could you tell use where you would take the compare/3 from?
I have to double check maybe Prolog II had something. But the only
working Prototype which is fully open source on SWI-Prolog discourse
and which can also currently deal with Hydra is my deutsch/2+order/3.
A code to minimize was published on qiita a few days ago:
canonical(X, Y) :-
sys_canonical(X, Y, [], _).
sys_canonical(X, Z, L, L) :- compound(X),
member(Y-Z, L), X == Y, !.
sys_canonical(X, Y, L, R) :- compound(X), !,
X =.. [F|P],
foldl(sys_canonical, P, Q, [X-Y|L], R),
Y =.. [F|Q].
sys_canonical(X, X, L, L).
You can then use a modified fuzzy tester that ony generates minimal terms:
sample(G) :-
term_variables(G, L),
repeat, maplist(pick, L),
G, !.
pick(S) :-
pick([T], T),
canonical(T, S). %%% Make the sample minimal
pick(L, T) :-
random(V), N is truncate(V*3),
(N = 0 -> T = 1;
N = 1 -> T = s(P,Q), pick([P|L], P), pick([Q|L], Q);
length(L, M),
random(W), I is truncate(W*M),
nth0(I, L, S), S = T).