Skip to content

Commit

Permalink
Correctly unshare variables for inverse constraint. Fixes #171.
Browse files Browse the repository at this point in the history
  • Loading branch information
guidotack committed Aug 31, 2023
1 parent ecf84ec commit c32cd81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ Date: 2020-??-??
[DESCRIPTION]
Let's see.

[ENTRY]
Module: flatzinc
What: bug
Issue: 171
Rank: minor
[DESCRIPTION]
Correctly unshare variables for inverse constraint.

[ENTRY]
Module: flatzinc
What: bug
Expand Down
6 changes: 3 additions & 3 deletions gecode/flatzinc/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1220,12 +1220,12 @@ namespace Gecode { namespace FlatZinc {
void
p_inverse_offsets(FlatZincSpace& s, const ConExpr& ce, AST::Node* ann) {
IntVarArgs x = s.arg2intvarargs(ce[0]);
unshare(s, x);
int xoff = ce[1]->getInt();
IntVarArgs y = s.arg2intvarargs(ce[2]);
unshare(s, y);
int yoff = ce[3]->getInt();
channel(s, x, xoff, y, yoff, s.ann2ipl(ann));
IntVarArgs xy = x + y;
unshare(s, xy);
channel(s, xy.slice(0, 1, x.size()), xoff, xy.slice(x.size()), yoff, s.ann2ipl(ann));
}

void
Expand Down

0 comments on commit c32cd81

Please sign in to comment.