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.
on-restart-benchmarks/tests/spec/unit/regression/linear_bool_elem_bug.mzn
Jip J. Dekker fad1b07018 Squashed 'software/minizinc/' content from commit 4f10c8205
git-subtree-dir: software/minizinc
git-subtree-split: 4f10c82056ffcb1041d7ffef29d77a7eef92cf76
2021-06-16 14:06:46 +10:00

46 lines
862 B
MiniZinc

/***
!Test
expected:
- !Result
solution: !Solution
firstin: 1
lastin: 1
- !Result
solution: !Solution
firstin: 1
lastin: 2
- !Result
solution: !Solution
firstin: 2
lastin: 2
- !Result
solution: !Solution
firstin: 1
lastin: 3
- !Result
solution: !Solution
firstin: 2
lastin: 3
- !Result
solution: !Solution
firstin: 3
lastin: 3
***/
% Regression test for a problem with the "linear" MiniZinc redefinitions.
% The signature of array_var_bool_element/3 in the redefintions was
% incorrect leading to an internal error in mzn2fzn.
int: n=3;
array[1..n] of var 1..n: succ;
array[1..n] of var bool: ins = [ succ[i] != i | i in 1..n];
var 1..n+1: firstin;
constraint firstin == min([ n+1 + bool2int(ins[i])*(i-n-1) | i in 1..n]);
var 1..n: lastin;
constraint ins[lastin];
solve satisfy;
output ["Ok\n"];