MCPcopy Create free account
hub / github.com/Gecode/gecode / updateFalse

Method updateFalse

contribs/qecode/WorkManager.cc:309–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309void WorkManager::updateFalse(Strategy s) { // called when s is false
310 // cout<<" UF on ";
311 // vector<int> hihi = s.getPosition();
312 // if (hihi.empty()) cout<<"empty";
313 // for (int i=0;i< hihi.size();i++) cout<<hihi[i]<<" ";
314 // cout<<endl;
315
316 trashWorks(s.getPosition());
317 if (s.isDummy()) {
318 return;
319 }
320 Strategy father=s.getFather();
321
322 if (s.quantifier()) { // if s is universal, its father is false
323 // cout<<" UF A";
324 if (father.isDummy()) { // if father is dummy, it is the root of the strategy. We must cut all its children and ad a false node.
325 // cout<<" father root "<<endl;
326 while (father.degree() != 0) {
327 father.detach(father.degree()-1);
328 }
329 father.attach(Strategy::SFalse());
330 }
331 // cout<<endl;
332 updateFalse(s.getFather());
333 }
334 else { // if s is existential, it it detached from its father
335 // cout<<" UF E ";
336 father.detach(s);
337 if (father.degree() == 0) {
338 // cout<<" father false"<<endl;
339 updateFalse(father);
340 }
341 else {
342 // cout<<" father still not false"<<endl;
343 }
344 }
345}
346
347
348void WorkManager::trashWorks(vector<int> prefix) {

Callers

nothing calls this directly

Calls 6

getPositionMethod · 0.80
getFatherMethod · 0.80
detachMethod · 0.80
attachMethod · 0.80
quantifierMethod · 0.45
degreeMethod · 0.45

Tested by

no test coverage detected