| 67 | |
| 68 | template<class VX, class VY, class VZ, bool shr, bool dom> |
| 69 | ExecStatus |
| 70 | EqView<VX,VY,VZ,shr,dom>::propagate(Space& home, const ModEventDelta&) { |
| 71 | count(home); |
| 72 | |
| 73 | GECODE_ME_CHECK(z.gq(home,atleast())); |
| 74 | GECODE_ME_CHECK(z.lq(home,atmost())); |
| 75 | |
| 76 | if (z.assigned()) { |
| 77 | if (z.val() == atleast()) { |
| 78 | GECODE_ES_CHECK(post_false(home,x,y)); |
| 79 | return home.ES_SUBSUMED(*this); |
| 80 | } |
| 81 | if (z.val() == atmost()) { |
| 82 | GECODE_ES_CHECK(post_true(home,x,y)); |
| 83 | return home.ES_SUBSUMED(*this); |
| 84 | } |
| 85 | if (!dom || isval(y)) { |
| 86 | VY yc(y); |
| 87 | GECODE_REWRITE(*this,(EqInt<VX,VY> |
| 88 | ::post(home(*this),x,yc,z.val()+c))); |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | |
| 93 | if (dom && !isval(y) && (z.min() > 0)) { |
| 94 | /* |
| 95 | * Only if the propagator is at fixpoint here, continue |
| 96 | * when things are shared: the reason is that prune |
| 97 | * requires that the views in x overlap with y! |
| 98 | */ |
| 99 | if (shr && (VX::me(Propagator::modeventdelta()) != ME_INT_NONE)) |
| 100 | return ES_NOFIX; |
| 101 | |
| 102 | GECODE_ES_CHECK(prune(home,x,y)); |
| 103 | |
| 104 | return ES_NOFIX; |
| 105 | } |
| 106 | |
| 107 | return shr ? ES_NOFIX : ES_FIX; |
| 108 | } |
| 109 | |
| 110 | }}} |
| 111 | |