Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ Preserve exact fixed-base power and logarithm solutions with explicitly rounded
MPFR bounds. Handle base-one powers and remove an invalid shortcut for shared
variables.

[ENTRY]
Module: flatzinc
What: bug
Rank: minor
[DESCRIPTION]
Handle zero-duration tasks in the single-task cumulative posting path without
requiring their resource usage to fit the capacity.

[ENTRY]

Module: int
Expand Down
2 changes: 1 addition & 1 deletion gecode/flatzinc/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ namespace Gecode { namespace FlatZinc {
return;

if (n == 1) {
rel(s, height[0] <= bound);
rel(s, (duration[0] > 0) >> (height[0] <= bound));
return;
}

Expand Down
13 changes: 13 additions & 0 deletions test/flatzinc/native-registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ namespace Test { namespace FlatZinc {
Create(void) {
const std::string sat = "----------\n";
const std::string unsat = "=====UNSATISFIABLE=====\n";
(void) new FlatZincTest(TestTags::check(),
"NativeRegistry::CumulativeSingletonZeroDuration",
"var 0..1:s; var 2..3:r; "
"constraint gecode_cumulatives([s],[0],[r],1); solve satisfy;", sat);
(void) new FlatZincTest(TestTags::check(),
"NativeRegistry::CumulativeSingletonPositiveDuration",
"var 0..1:s; var 2..3:r; "
"constraint gecode_cumulatives([s],[1],[r],1); solve satisfy;", unsat);
(void) new FlatZincTest(TestTags::check(),
"NativeRegistry::CumulativeSingletonVariableDuration",
"var 0..1:s; var 0..1:d :: output_var; var 2..3:r; "
"constraint gecode_cumulatives([s],[d],[r],1); solve satisfy;",
"d = 0;\n----------\n");
(void) new FlatZincTest("NativeRegistry::DistanceShared",
"var 0..2:x; constraint gecode_inter_distance([x,x],1); solve satisfy;", unsat);
(void) new FlatZincTest("NativeRegistry::DistanceNegativeEmpty",
Expand Down
Loading