@@ -267,7 +267,7 @@ namespace Gecode { namespace Set { namespace RelOp {
267267
268268 template <class View0 , class View1 >
269269 ExecStatus
270- UnionN<View0,View1>::propagate(Space& home, const ModEventDelta& med) {
270+ UnionN<View0,View1>::propagate(Space& home, const ModEventDelta& med) {
271271 ModEvent me0 = View0::me (med);
272272 ModEvent me1 = View1::me (med);
273273 bool ubevent = Rel::testSetEventUB (me0, me1);
@@ -279,28 +279,33 @@ namespace Gecode { namespace Set { namespace RelOp {
279279 bool oldModified = false ;
280280
281281 do {
282- oldModified = modified;
283- modified = false ;
284- if (modified || oldModified || ubevent)
285- GECODE_ES_CHECK (unionNXiUB (home, modified, x, y,unionOfDets));
286- if (modified || oldModified || ubevent)
287- GECODE_ES_CHECK (partitionNYUB (home, modified, x, y,unionOfDets));
288- if (modified || oldModified || anybevent)
289- GECODE_ES_CHECK (partitionNXiLB (home, modified, x, y,unionOfDets));
290- if (modified || oldModified || lbevent)
291- GECODE_ES_CHECK (partitionNYLB (home, modified, x, y,unionOfDets));
292- if (modified || oldModified || cardevent || ubevent)
293- GECODE_ES_CHECK (unionNCard (home, modified, x, y, unionOfDets));
294- } while (modified);
282+ do {
283+ oldModified = modified;
284+ modified = false ;
285+ if (modified || oldModified || ubevent)
286+ GECODE_ES_CHECK (unionNXiUB (home, modified, x, y,unionOfDets));
287+ if (modified || oldModified || ubevent)
288+ GECODE_ES_CHECK (partitionNYUB (home, modified, x, y,unionOfDets));
289+ if (modified || oldModified || anybevent)
290+ GECODE_ES_CHECK (partitionNXiLB (home, modified, x, y,unionOfDets));
291+ if (modified || oldModified || lbevent)
292+ GECODE_ES_CHECK (partitionNYLB (home, modified, x, y,unionOfDets));
293+ if (modified || oldModified || cardevent || ubevent) {
294+ GECODE_ES_CHECK (unionNCard (home, modified, x, y, unionOfDets));
295+ }
296+ } while (modified);
295297
296- for (int i=0 ;i<x.size ();i++){
297- // Do not reverse! Eats away the end of the array!
298- while (i<x.size () && x[i].assigned ()) {
299- GlbRanges<View0> det (x[i]);
300- unionOfDets.includeI (home,det);
301- x.move_lst (i);
298+ for (int i=0 ;i<x.size ();i++){
299+ // Do not reverse! Eats away the end of the array!
300+ while (i<x.size () && x[i].assigned ()) {
301+ GlbRanges<View0> det (x[i]);
302+ unionOfDets.includeI (home,det);
303+ x.move_lst (i);
304+ modified = true ;
305+ }
302306 }
303- }
307+
308+ } while (modified);
304309 // When we run out of variables, make a final check and disolve:
305310 if (x.size ()==0 ) {
306311 BndSetRanges all1 (unionOfDets);
0 commit comments