title: How to express a disjunction of inequalities compactly without redundant answers/solutions
body: <p>Consider what I have tried:</p>
  <pre class="lang-none prettyprint-override"><code>dif_to_orto(A, B, C) :-
     (  dif(A, B)
     ;  dif(A, C)
     ).
  </code></pre>
  <p>While this definition is fine from a declarative viewpoint it contains many redundancies. Think of:</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(A, B, C), A = 1, B = 2, C = 2.
     A = 1, B = 2, C = 2
  ;  A = 1, B = 2, C = 2.   % unexpected redundant solution
  </code></pre>
  <p>And not even in this case:</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(A, B, C), A = 1, B = 2, C = 3.
     A = 1, B = 2, C = 3
  ;  A = 1, B = 2, C = 3.   % unexpected redundant solution
  </code></pre>
  <p>At least, here is a case without redundancy...</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(A, B, C), A = 1, B = 2, C = 1.
     A = 1, B = 2, C = 1
  ;  false.                 % unexpected inefficient leftover choicepoint
  </code></pre>
  <p>...but with a resource-wasting leftover choicepoint.</p>
  <p>Rare are the occasions where this definition is efficient:</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(A, B, C), A = 1, B = 1, C = 2.
     A = 1, B = 1, C = 2.
  </code></pre>
  <p>Also that the most general query produces two answers sounds very inefficient to me:</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(A, B, C).
     dif:dif(A,B)
  ;  dif:dif(A,C).
  </code></pre>
  <p>... which produces also the following redundancy:</p>
  <pre class="lang-none prettyprint-override"><code>?- dif_to_orto(1, B, B).
     dif:dif(1,B)
  ;  dif:dif(1,B).    % unexpected redundant answer
  </code></pre>
  <p>One <code>dif/2</code> would be enough!</p>
  <p>Is there a way to avoid all these redundancies and inefficiencies?</p>