| 108 | |
| 109 | template<class VY> |
| 110 | ExecStatus |
| 111 | LqBool<VY>::propagate(Space& home, const ModEventDelta&) { |
| 112 | if (status == (VS_ZERO | VS_ONE)) { |
| 113 | GECODE_ME_CHECK(y.gq(home,2)); |
| 114 | return home.ES_SUBSUMED(*this); |
| 115 | } |
| 116 | |
| 117 | if (c.empty()) { |
| 118 | assert((status != 0) && (y.min() >= 1)); |
| 119 | return home.ES_SUBSUMED(*this); |
| 120 | } |
| 121 | |
| 122 | if (y.max() == 1) { |
| 123 | if (status == VS_ZERO) { |
| 124 | // Mark that everything is done |
| 125 | status = VS_ZERO | VS_ONE; |
| 126 | for (Advisors<ViewAdvisor<BoolView> > as(c); as(); ++as) |
| 127 | GECODE_ME_CHECK(as.advisor().view().zero(home)); |
| 128 | return home.ES_SUBSUMED(*this); |
| 129 | } |
| 130 | if (status == VS_ONE) { |
| 131 | // Mark that everything is done |
| 132 | status = VS_ZERO | VS_ONE; |
| 133 | for (Advisors<ViewAdvisor<BoolView> > as(c); as(); ++as) |
| 134 | GECODE_ME_CHECK(as.advisor().view().one(home)); |
| 135 | return home.ES_SUBSUMED(*this); |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | if (y.min() == 2) |
| 140 | return home.ES_SUBSUMED(*this); |
| 141 | |
| 142 | return ES_FIX; |
| 143 | } |
| 144 | |
| 145 | }}} |
| 146 | |