| 106 | |
| 107 | template<class View, class View0, class View1> |
| 108 | ExecStatus |
| 109 | ElementUnion<View,View0,View1>::propagate(Space& home, const ModEventDelta&) { |
| 110 | Region r; |
| 111 | int n = iv.size(); |
| 112 | |
| 113 | bool loopVar; |
| 114 | do { |
| 115 | loopVar = false; |
| 116 | |
| 117 | // Cache the upper bound iterator, as we have to |
| 118 | // modify the upper bound while iterating |
| 119 | LubRanges<View0> x0ub(x0); |
| 120 | Iter::Ranges::Cache x0ubc(r,x0ub); |
| 121 | Iter::Ranges::ToValues<Iter::Ranges::Cache> vx0ub(x0ubc); |
| 122 | |
| 123 | GlbRanges<View0> x0lb(x0); |
| 124 | Iter::Ranges::Cache x0lbc(r,x0lb); |
| 125 | Iter::Ranges::ToValues<Iter::Ranges::Cache> vx0(x0lbc); |
| 126 | |
| 127 | // In the first iteration, compute in before[i] the union |
| 128 | // of all the upper bounds of the x_i. At the same time, |
| 129 | // exclude inconsistent x_i from x0 and remove them from |
| 130 | // the list, cancel their dependencies. |
| 131 | |
| 132 | GLBndSet sofarBefore(home); |
| 133 | LUBndSet selectedInter(home, IntSet (Limits::min, |
| 134 | Limits::max)); |
| 135 | GLBndSet* before = |
| 136 | static_cast<GLBndSet*>(r.ralloc(sizeof(GLBndSet)*n)); |
| 137 | |
| 138 | int j = 0; |
| 139 | int i = 0; |
| 140 | |
| 141 | unsigned int maxCard = 0; |
| 142 | unsigned int minCard = Limits::card; |
| 143 | |
| 144 | while ( vx0ub() ) { |
| 145 | |
| 146 | // Remove vars at indices not in the upper bound |
| 147 | if (iv[i].idx < vx0ub.val()) { |
| 148 | iv[i].view.cancel(home,*this, PC_SET_ANY); |
| 149 | ++i; |
| 150 | continue; |
| 151 | } |
| 152 | assert(iv[i].idx == vx0ub.val()); |
| 153 | iv[j] = iv[i]; |
| 154 | |
| 155 | View candidate = iv[j].view; |
| 156 | int candidateInd = iv[j].idx; |
| 157 | |
| 158 | // inter = glb(candidate) & complement(lub(x1)) |
| 159 | GlbRanges<View> candlb(candidate); |
| 160 | LubRanges<View1> x1ub(x1); |
| 161 | Iter::Ranges::Diff<GlbRanges<View>, LubRanges<View1> > |
| 162 | diff(candlb, x1ub); |
| 163 | |
| 164 | bool selectSingleInconsistent = false; |
| 165 | if (x0.cardMax() <= 1) { |
nothing calls this directly
no test coverage detected