Skip to content

Commit

Permalink
Mark domain as "not computed" to avoid constraints being removed that…
Browse files Browse the repository at this point in the history
… are not entailed. Fixes #150.
  • Loading branch information
guidotack committed May 11, 2017
1 parent a8f6971 commit 513a591
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/flatten.cpp
Expand Up @@ -1204,7 +1204,12 @@ namespace MiniZinc {
if (newdom->size()==0) {
env.fail();
} else {
vdi->ti()->domain(new SetLit(Location().introduce(),newdom));
IntSetRanges vdi_domr2(vdi_dom);
IntSetRanges newdomr(newdom);
if (!Ranges::equal(vdi_domr2, newdomr)) {
vdi->ti()->domain(new SetLit(Location().introduce(),newdom));
vdi->ti()->setComputedDomain(false);
}
}
}
}
Expand All @@ -1225,7 +1230,12 @@ namespace MiniZinc {
if (newdom->size()==0) {
env.fail();
} else {
vdi->ti()->domain(new SetLit(Location().introduce(),newdom));
FloatSetRanges vdi_domr2(vdi_dom);
FloatSetRanges newdomr(newdom);
if (!Ranges::equal(vdi_domr2, newdomr)) {
vdi->ti()->domain(new SetLit(Location().introduce(),newdom));
vdi->ti()->setComputedDomain(false);
}
}
}
}
Expand Down

0 comments on commit 513a591

Please sign in to comment.