Having gone through the handbook listings, I'm now practicing to formulate my own models from various common SAT/CP problems I can find online.
With this below as-yet-incomplete model, the very first constraint errors with a message I cannot truly grok. The listing:
include "globals.mzn";
enum Shop = { None,JFood,Hair,Clothes,Toys,FishNChips,Health };
array[1..3,1..3] of var Shop: grid = [| None, None, None
| None, None, None
| None, None, None |];
constraint ::"rule 2)"
(grid[2,1] == Health);
constraint ::"rule 1)"
(grid[3,3] == FishNChips);
constraint ::"each shop just once"
forall(shop in Shop) ((shop == None) \/ count(grid, shop, 1));
And the output:
Command: minizinc --json-stream --param-file-no-push /tmp/mzn_NbMGJp.mpc /home/_/c/mz/mzprobs/architectural-mall-shop-placement.mzn
Configuration:
{
"intermediate-solutions": true,
"output-objective": true,
"solver": "org.geco...@6.3.0"
}
architectural-mall-shop-placement:30.4-21
in binary '=' operator expression
Warning: model inconsistency detected
=====UNSATISFIABLE=====
Finished in 53msec
What's the actual issue here? Line 30 in my full listing (problem elaboration in % comments precede the above) corresponds to the first `constraint`, here line 6.
This occurs across all solvers.