| 1 |
/*** |
| 2 |
!Test |
| 3 |
solvers: [gecode, chuffed] |
| 4 |
options: |
| 5 |
restart: "constant" |
| 6 |
restart-base: 100 |
| 7 |
expected: !Result |
| 8 |
status: OPTIMAL_SOLUTION |
| 9 |
solution: !Solution |
| 10 |
x: 3 |
| 11 |
is_even: false |
| 12 |
y: true |
| 13 |
***/ |
| 14 |
include "experimental/on_restart.mzn"; |
| 15 |
var -1..3: x; |
| 16 |
var bool: is_even; |
| 17 |
var bool: y; |
| 18 |
|
| 19 |
constraint is_even = (abs(x) mod 2 = 0); |
| 20 |
|
| 21 |
predicate foo() = |
| 22 |
(status() != START) -> (y = sol(is_even)); |
| 23 |
|
| 24 |
solve ::on_restart("foo") ::int_search([x], input_order, indomain_min) maximize abs(x); |