Arc-consistency

The following propagator, which extends the one shown above, maintains arc-consistency for the constraint.
    'aX=bY+c'(A,X,B,Y,C) =>
          'aX=bY+c_reduce_domain'(A,X,B,Y,C),
          'aX=bY+c_forward'(A,X,B,Y,C),
          'aX=bY+c_interval'(A,X,B,Y,C),
          'aX=bY+c_arc'(A,X,B,Y,C).

     'aX=bY+c_arc'(A,X,B,Y,C) =>
          'aX in bY+c_arc'(A,X,B,Y,C),  % reduce X when Y changes
          MC is -C,
          'aX in bY+c_arc'(B,Y,A,X,MC). % reduce Y when X changes

     'aX in bY+c_arc'(A,X,B,Y,C),var(X),var(Y),{dom(Y,Ey)} => 
          T is B*Ey+C,
          Ex is T//A,
          (A*Ex=:=T -> fd_set_false(X,Ex);true).
     'aX in bY+c_arc'(A,X,B,Y,C) => true.
Whenever an element, Ey, is excluded from the domain of Y, the propagator 'aX in bY+c_arc'(A,X,B,Y,C) is activated. If both X and Y are variables, the propagator will exclude Ex, which is the counterpart of Ey, from the domain of X. Again, if either X or Y becomes an integer, the propagator does nothing. The forward-checking rule will take care of that situation.



Neng-Fa Zhou 2013-01-25