type test-unif o -> o.
test-unif T :- print "Original goal is" T, fail.
test-unif T :- T, !, print "--> Unif success" T "\n".
% test-unif T :- print "--> FAIL in this unification:" T "\n".
main :-
test-unif ((x\y\X x y) = (x\y\X y x)), !,
test-unif (Q = (x\y\Q x y)), !,
test-unif (Z = (x\y\Z y x)), !.
This is incomplete
with RestrictionFailure ->
(* avoid fail occur-check on: x\A x = A *)
match eta_contract_flex depth adepth ~argsdepth:bdepth e a with
| None -> false
| Some a -> unif argsdepth matching depth adepth a bdepth b e end
and the code in bind is also incomplete w.r.t. the same problem:
X = x\y\ X y x
is not just an eta, one can restrict X to a\b\Y and then you get a\b\Y = x\y\(a\b\ Y) y x that has a solution.
The current code first detect the OC and then tries to amend, both in the optimized UVar case and in the general AppUVar one.
This is incomplete
and the code in
bind
is also incomplete w.r.t. the same problem:is not just an eta, one can restrict X to
a\b\Y
and then you geta\b\Y = x\y\(a\b\ Y) y x
that has a solution. The current code first detect the OC and then tries to amend, both in the optimized UVar case and in the general AppUVar one.