siemens / JMiniZinc

JMiniZinc
Other
14 stars 5 forks source link

Extend diagnosis: allow named ranges and two-dimensional arrays #15

Open falknera opened 6 years ago

falknera commented 6 years ago

In the definition of variables, allow named int ranges and sets for value domains and in array ranges. Also allow to define and use two-dimensional arrays (in addition to one-dimensional). Most probably, only the diagnosis component needs to be extended for this. At the end it shall be possible, to diagnose MZN programs such as the following (extended sample.mzn):

% This is an explanatory example for minimal diagnoses.

% You may define constants and use them for domains of variables.
int: max = 4;
set of int: MaxRange = 1..max; %NEW

% Define only one variable in each row!
% Use only types int, min..max, enum and bool!
var 1..max: x1;
array[MaxRange, MaxRange] of var MaxRange: n; %NEW 

...
rtaupe commented 6 years ago

It is true that the core component already supports integer ranges (RangeExpression) and multi-dimensional arrays (Array, IntegerArray, ...).