| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode] |
| 4 |
expected: !Result |
| 5 |
solution: !Solution |
| 6 |
***/ |
| 7 |
|
| 8 |
var bool: b; |
| 9 |
var int: x; |
| 10 |
constraint if b then x=1 else x=0 endif; |
| 11 |
constraint assert(dom(x)=0..1, "failed to hoist if-then-else"); |
| 12 |
|
| 13 |
var set of 1..100: y; |
| 14 |
constraint if b then y = 1..3 else y = 4..6 endif; |
| 15 |
constraint assert(ub(y) = 1..6, "failed to hoist if-then-else"); |
| 16 |
|
| 17 |
var float: z; |
| 18 |
constraint if b then z = 1.0 else z = 0.0 endif; |
| 19 |
constraint assert(lb(z) = 0.0, "failed to hoist if-then-else"); |