I need to model this (simple) constraint in Eclipse CLP:

Given three domain variables, lets say `D1`

, `D2`

, and `D3`

and I want to ensure that these three variables will **not** end up with the same value. Two of them can have equal value.

**Version 1**

My first idea was something like:

`D1 #\= D2 or D1 #\= D3`

But I do not like disjunctions in the model.

**Version 2**

Then I changed the model to the form of implications:

`D1 #= D2 => D1 #\= D3`

Is there some more efficient way how to model this constraint?

I was thinking about `alldifferent([D1,D2,D3],2)`

or `neg nvalue([D1,D2,D3],1)`

but I am not sure it is not overcomplicated for such a simple usage.

Using

`nvalue(N, X)`

and then constrain`N`

to be larger than 1 (`N #> 1`

) will require that there should be 2 or 3 distinct values.Example:

The model give the following solutions: