1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
Jip J. Dekker b5f0d64642 Squashed 'prototype/' content from commit 91f7db00
git-subtree-dir: prototype
git-subtree-split: 91f7db00d45e7f991b5587ee07f09977ae311ee7
2021-07-29 14:28:24 +10:00

32 lines
1.2 KiB
MiniZinc

% RUNS ON mzn20_fd
% RUNS ON mzn-fzn_fd
include "count.mzn";
%-----------------------------------------------------------------------------%
% count
%-----------------------------------------------------------------------------%
var -100..100: count_vi1;
var -100..100: count_vi2;
var 8..20: count_vi3;
array[1..8] of var -100..100: count_avi1 = [7, 8, 8, 9, 9, 9, _, _];
array[1..8] of var -100..100: count_avi2 = [7, 8, 9, 3, 0, 0, 9, 9];
array[1..8] of var -100..100: count_avi3 = [7, 8, 8, 9, 9, 9, 0, 8];
array[1..8] of var -100..100: count_avi4;
constraint count(count_avi1, 8, 4); % 1st arg unfixed -> [...]
constraint count(count_avi2, count_vi1, 3); % 2nd arg unfixed -> 9
constraint count(count_avi3, 8, count_vi2); % 3rd arg unfixed -> 3
constraint count(count_avi4, 0, count_vi3); % 1st arg unfixed -> [0,0,...]
solve satisfy;
output [
"count_avi1 = array1d(1..8, ", show(count_avi1), ");\n",
"count_avi2 = array1d(1..8, ", show(count_avi2), ");\n",
"count_avi3 = array1d(1..8, ", show(count_avi3), ");\n",
"count_avi4 = array1d(1..8, ", show(count_avi4), ");\n",
"count_vi1 = ", show(count_vi1), ";\n",
"count_vi2 = ", show(count_vi2), ";\n",
"count_vi3 = ", show(count_vi3), ";\n"
];