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