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

34 lines
807 B
MiniZinc

% RUNS ON mzn20_fd
% RUNS ON mzn-fzn_fd
% RUNS ON mzn20_mip
% Copied from the queens.mzn benchmark.
%
% In some very rare cases some literals in MiniSAT are labeled during
% backjumping but never actually propagated
% (if invoke is never entered again),
% which leads to the output of flatzinc showing unfixed int variables.
%
%
int: n = 20; % The number of queens.
array [1..n] of var 1..n: q;
predicate
noattack(int: i, int: j, var int: qi, var int: qj) =
qi != qj /\
qi + i != qj + j /\
qi - i != qj - j;
constraint
forall (i in 1..n, j in i+1..n) (
noattack(i, j, q[i], q[j])
);
solve satisfy;
output ["% ", show(n), "-queens:\n"] ++
["% "] ++ [show(q[i]) ++ " " | i in 1..n] ++
["\n%\n"] ++
["q = ", show(q), ";\n"];