[quote=“jan, post:24, topic:6888”]
If that is the case, there is indeed a problem because variant/2 has an accepted semantics if the arguments share subterms (including variables).
[/quotel]
I am not sure the following query is what you think problem, but I ran some queries:
% ?- A = f(B), C=f(D), subsumes_chk(g(f(A), f(C)), g(f(C), f(A))).
%@ A = f(B),
%@ C = f(D).
% ?- A = f(B), C=f(D), subsumes_chk(g(f(C), f(A)), g(f(A), f(C))).
%@ A = f(B),
%@ C = f(D).
% ?- A = f(B), C=f(D), variant(g(f(A), f(C)), g(f(C), f(A))).
%@ A = f(B),
%@ C = f(D).
% ?- A = f(B), C=f(D), subsumes_term(g(f(A), f(C)), g(f(C), f(A))).
%@ false.
subsumes_chk(X, Y):-
term_variables(Y, Vs),
copy_term(Vs, Y, Ws, Z),
\+ \+ (numbervars(Ws, 0, _), X = Z).
IMO, the subsumes_term/2
should succeed for the query.
However I am not familiar with the subsumes_term
enough to
see why and how this might be serious.
EDIT
Still it is not clear what Jan W. is worrying about . As far as I see,
there is no practical case in which Generic and Specific share a subterm with variables
I am missing something.