[comp.lang.prolog] not

duchier@cs.yale.edu (Denys Duchier) (12/13/90)

In article <5398@rex.cs.tulane.edu> feldman@rex.cs.tulane.edu (Damon Feldman) writes:
 >   I was writing a small prolog program, and I had use for the following
 >   predicate:
 >
 >   notequal(X,Y) :- nonvar(X),nonvar(Y),X=Y,!,fail.
 >   notequal(X,_) :- var(X),!,fail.
 >   notequal(_,Y) :- var(Y),!,fail.
 >   notequal(_,_).

Why not just:

notequal(X,Y) :- nonvar(X),nonvar(Y),X\=Y.

--Denys