| 201 | |
| 202 | template<class View> |
| 203 | ExecStatus |
| 204 | ChannelBool<View>::advise(Space& home, Advisor& _a, const Delta& _d) { |
| 205 | IndexAdvisor& a = static_cast<IndexAdvisor&>(_a); |
| 206 | const SetDelta& d = static_cast<const SetDelta&>(_d); |
| 207 | |
| 208 | ModEvent me = View::modevent(d); |
| 209 | int index = a.index(); |
| 210 | if ( (running && index == -1 && me != ME_SET_VAL) |
| 211 | || (index == -1 && me == ME_SET_CARD) ) { |
| 212 | return ES_OK; |
| 213 | } |
| 214 | |
| 215 | if (index >= 0) { |
| 216 | if (x[index].zero()) { |
| 217 | SetDelta dummy; |
| 218 | zeros.include(home, index, index, dummy); |
| 219 | } else { |
| 220 | assert(x[index].one()); |
| 221 | SetDelta dummy; |
| 222 | ones.include(home, index, index, dummy); |
| 223 | } |
| 224 | return home.ES_NOFIX_DISPOSE( co, a); |
| 225 | } |
| 226 | |
| 227 | if ((a.index() == -1) && Rel::testSetEventLB(me)) { |
| 228 | if (d.glbAny()) { |
| 229 | new (&delta) |
| 230 | SetDelta(2,0, delta.lubMin(), delta.lubMax()); |
| 231 | } else { |
| 232 | if (delta.glbMin() == 1 && delta.glbMax() == 0) { |
| 233 | new (&delta) |
| 234 | SetDelta(d.glbMin(), d.glbMax(), |
| 235 | delta.lubMin(), delta.lubMax()); |
| 236 | } else { |
| 237 | if (delta.glbMin() != 2 || delta.glbMax() != 0) { |
| 238 | if ((delta.glbMin() <= d.glbMin() && delta.glbMax() >= d.glbMin()) |
| 239 | || |
| 240 | (delta.glbMin() <= d.glbMax() && delta.glbMax() >= d.glbMax()) |
| 241 | ) { |
| 242 | new (&delta) |
| 243 | SetDelta(std::min(delta.glbMin(), d.glbMin()), |
| 244 | std::max(delta.glbMax(), d.glbMax()), |
| 245 | delta.lubMin(), delta.lubMax()); |
| 246 | } else { |
| 247 | new (&delta) |
| 248 | SetDelta(2, 0, delta.lubMin(), delta.lubMax()); |
| 249 | } |
| 250 | } |
| 251 | } |
| 252 | } |
| 253 | } |
| 254 | if ((a.index() == -1) && Rel::testSetEventUB(me)) { |
| 255 | if (d.lubAny()) { |
| 256 | new (&delta) |
| 257 | SetDelta(delta.glbMin(), delta.glbMax(), 2,0); |
| 258 | } else { |
| 259 | if (delta.lubMin() == 1 && delta.lubMax() == 0) { |
| 260 | new (&delta) |
nothing calls this directly
no test coverage detected