34.7.2 Pitfalls of Interval Reasoning

In most circumstances, arithmetic constraints maintain interval-consistency and detect interval-entailment and -disentailment. There are cases where an interval-consistency maintaining constraint may detect a contradiction when the constraint is not yet interval-disentailed, as the following example illustrates. Note that X #\= Y maintains domain-consistency if both arguments are constants or variables:

     | ?- X+Y #= Z, X=1, Z=6, Y in 1..10, Y #\= 5.
     | ?- X+Y #= Z #<=> B, X=1, Z=6, Y in 1..10, Y #\= 5.
     X = 1,
     Z = 6,
     Y in(1..4)\/(6..10),
     B in 0..1

Since 1+5#=6 holds, X+Y #= Z is not interval-disentailed, although any attempt to make it interval-consistent wrt. the store results in a contradictory store.