tests/spec/unit/general/test-search1.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode, chuffed, cbc] |
| 4 | expected: !Result |
| 5 | status: OPTIMAL_SOLUTION |
| 6 | solution: !Solution |
| 7 | x: 3 |
| 8 | y: 8 |
| 9 | ***/ |
| 10 | |
| 11 | %% Check that the first-fail search complies with spec |
| 12 | %% |
| 13 | |
| 14 | var 1..8: x; |
| 15 | var 1..10: y; |
| 16 | constraint x > 1 -> y > 7; |
| 17 | constraint x = 1 -> y < 3; |
| 18 | constraint x + y <= 11; |
| 19 | |
| 20 | solve :: int_search([y,x],first_fail,indomain_min,complete) |
| 21 | maximize x + y; |
| 22 | |
| 23 | output ["x = ",show(x),";\ny = ",show(y),";\n%% should be x = 3, y = 8\n"]; |