:- ensure_loaded(typeops).

:- import_pred(prolog_meta,'='/2).     % pred T = T gives type-error !!!
:- import_type(prolog_types).

:- pred uni_top(list(top), list(top)).
				% with pred list(top) = list(top) no type-error
uni_top(X,X).

:- pred test(list(top)).

test(_).

?- A = [1,2,3,4], test(A).        % ok
?- test([1,2,[8,9],3]).           % ok
test([5,B]) :- B = [3,4].         % ok

?- A = [1,2,[8,9],3], test(A).    % ill-typed  unification do no know list(top)
test(A) :- A=[5,B], B = [3,4].    % ill-typed  unification do no know list(top)

?- uni_top(A,[1,2,[8,9],3]), test(A).    % ok
test(A) :- uni_top(A,[5,B]), B = [3,4].  % ok

