| 388 | |
| 389 | template<class View, bool Perm> |
| 390 | ExecStatus |
| 391 | Sorted<View,Perm>::propagate(Space& home, const ModEventDelta&) { |
| 392 | int n = x.size(); |
| 393 | bool secondpass = false; |
| 394 | bool nofix = false; |
| 395 | int dropfst = 0; |
| 396 | |
| 397 | bool subsumed = false; |
| 398 | bool array_subs = false; |
| 399 | bool match_fixed = false; |
| 400 | |
| 401 | // normalization of x and y |
| 402 | if (!normalize(home, y, x, nofix)) |
| 403 | return ES_FAILED; |
| 404 | |
| 405 | // create sigma sorting |
| 406 | sort_sigma<View,Perm>(x,z); |
| 407 | |
| 408 | bool noperm_bc = false; |
| 409 | if (!array_assigned<View,Perm> |
| 410 | (home, x, y, z, array_subs, match_fixed, nofix, noperm_bc)) |
| 411 | return ES_FAILED; |
| 412 | |
| 413 | if (array_subs) |
| 414 | return home.ES_SUBSUMED(*this); |
| 415 | |
| 416 | sort_sigma<View,Perm>(x,z); |
| 417 | |
| 418 | // in this case check_subsumptions is guaranteed to find |
| 419 | // the xs ordered by sigma |
| 420 | |
| 421 | if (!check_subsumption<View,Perm>(x,y,z,subsumed,dropfst)) |
| 422 | return ES_FAILED; |
| 423 | |
| 424 | if (subsumed) |
| 425 | return home.ES_SUBSUMED(*this); |
| 426 | |
| 427 | if (Perm) { |
| 428 | // dropping possibly yields inconsistent indices on permutation variables |
| 429 | if (dropfst) { |
| 430 | reachable = w[dropfst - 1].max(); |
| 431 | bool unreachable = true; |
| 432 | for (int i = x.size(); unreachable && i-- ; ) { |
| 433 | unreachable &= (reachable < x[i].min()); |
| 434 | } |
| 435 | |
| 436 | if (unreachable) { |
| 437 | x.drop_fst(dropfst, home, *this, PC_INT_BND); |
| 438 | y.drop_fst(dropfst, home, *this, PC_INT_BND); |
| 439 | z.drop_fst(dropfst, home, *this, PC_INT_BND); |
| 440 | } else { |
| 441 | dropfst = 0; |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | n = x.size(); |
| 446 | |
| 447 | if (n < 2) { |
nothing calls this directly
no test coverage detected