It is possible to avoid using it by writing something more wordy. If I rewrite Stephan s predicate:
implication(X) :-
(
X = a,
write( Argument a received. ), nl
;
X = b,
write( Argument b received. ), nl
;
X = a,
X = b,
write( Received unknown argument. ), nl
).
(Yeah I don t think there is any problem with using it, but my boss was paranoid about it for some reason, so we always used the above approach.)
With either version, you need to be careful that you are covering all cases you intend to cover, especially if you have many branches.
ETA: I am not sure if this is completely equivalent to Stephan s, because of backtracking if you have implication(X)
. But I don t have a Prolog interpreter right now to check.