Newbie problem: (no error message) " in binary '=' operator expression" with trivialest-ever `constraint`

31 views
Skip to first unread message

meta_leap

unread,
Nov 22, 2023, 10:20:08 AM11/22/23
to MiniZinc
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.

meta_leap

unread,
Nov 22, 2023, 10:24:10 AM11/22/23
to MiniZinc
("Here line 6" is actually here line 7, sorry.)

meta_leap

unread,
Nov 22, 2023, 10:39:28 AM11/22/23
to MiniZinc
OK the setting-initial-value for the `array of var Shop` seemed to cause that. Fair enough, lesson learned.
Reply all
Reply to author
Forward
0 new messages