I was reading "Principles of Database & Knowledge-Base Systems, Vol. 1" by Jeffrey D. Ullman. There is a chapter about Datalog negation and as I was seeing the problems of negation I kept thinking that using the predicate $ \neq $ would solve those problems but then I see the following:
p(X) :- r(X) & ¬q(X).
q(X) :- r(X) & ¬p(X).
The problem is this has 2 minimal models and if I'm not mistaken so does this:
p(X) :- r(X) & q(Y) & X $ \neq $ Y.
q(X) :- r(X) & p(Y) & X $ \neq $ Y.
Is there an equivalence between these 2 operators? If so, did I miss it or is it not mentioned that it's unsafe to use $ \neq $ with recursion?