yes :- ab(X), !, X=b.
yes.

ab(a).
ab(b).

% ?- yes.

% maximum predicate:
%max(X,Y,Z) :- X >= Y, Z = X.
%max(X,Y,Z) :- X < Y, Z = Y.

%max(X,Y,Z) :- X >= Y, !, Z = X.
%max(X,Y,Z) :- Z = Y.

max(X,Y,Z) :- X >= Y -> Z = X ; Z = Y.

