title: different/2 - does a pure, determinate definition exist?
body: <pre><code>different(Xs, Ys) :-
     member(X, Xs),
     non_member(X, Ys).
  different(Xs, Ys) :-
     member(Y, Ys),
     non_member(Y, Xs).
  </code></pre>
  
  <p>While this definition using <a href="http://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue#member" rel="nofollow noreferrer"><code>member/2</code></a> and <a href="https://stackoverflow.com/a/10322639/772868"><code>non_member/2</code></a> is almost<sup>1</sup> perfect from a declarative viewpoint, it produces redundant solutions for certain queries and leaves choice points all around.</p>
  
  <p>What is a definition that improves upon this (in a pure manner probably using <a href="https://stackoverflow.com/a/27358600/772868"><code>if_/3</code></a> and <a href="https://stackoverflow.com/a/29708684/772868"><code>(=)/3</code></a>) such that exactly the same set of solutions is described by <code>different/2</code> but is determinate at least for ground queries (thus does not leave any useless choice points open)  and omits (if possible) any redundant answer?</p>
  
  <hr>
  
  <p><sup>1</sup><sub>
  Actually, <code>different([a|nonlist],[]), different([],[b|nonlist])</code> succeeds. It could equally fail. So a solution that fails for both is fine (maybe even finer).
  </sub></p>