| 104 | |
| 105 | template<class View> |
| 106 | ExecStatus |
| 107 | Ite<View>::propagate(Space& home, const ModEventDelta&) { |
| 108 | if (b.one()) |
| 109 | GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x0))); |
| 110 | if (b.zero()) |
| 111 | GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x1))); |
| 112 | |
| 113 | GECODE_ME_CHECK(x2.lq(home,std::max(x0.max(),x1.max()))); |
| 114 | GECODE_ME_CHECK(x2.gq(home,std::min(x0.min(),x1.min()))); |
| 115 | |
| 116 | RelTest eq20 = rtest_eq(x2,x0); |
| 117 | RelTest eq21 = rtest_eq(x2,x1); |
| 118 | |
| 119 | if ((eq20 == RT_FALSE) && (eq21 == RT_FALSE)) |
| 120 | return ES_FAILED; |
| 121 | |
| 122 | if (eq20 == RT_FALSE) { |
| 123 | GECODE_ME_CHECK(b.zero_none(home)); |
| 124 | if (eq21 == RT_TRUE) |
| 125 | return home.ES_SUBSUMED(*this); |
| 126 | else |
| 127 | GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x1))); |
| 128 | } |
| 129 | |
| 130 | if (eq21 == RT_FALSE) { |
| 131 | GECODE_ME_CHECK(b.one_none(home)); |
| 132 | if (eq20 == RT_TRUE) |
| 133 | return home.ES_SUBSUMED(*this); |
| 134 | else |
| 135 | GECODE_REWRITE(*this,(Rel::Eq<View,View>::post(home(*this),x2,x0))); |
| 136 | } |
| 137 | |
| 138 | if ((eq20 == RT_TRUE) && (eq21 == RT_TRUE)) |
| 139 | return home.ES_SUBSUMED(*this); |
| 140 | |
| 141 | return ES_FIX; |
| 142 | } |
| 143 | |
| 144 | }}} |
| 145 | |