Skip to content

mzn2fzn duplicates non-empty array and loses type of empty array #3

Closed
@kfranc

Description

@kfranc

Hi,
When I compile the following minizinc model, the flatzinc has an extra copy of the non-empty array and type array [1..0] of bot for the empty one.

MiniZinc:

predicate fakepred(array[int] of int: a1, array[int] of int: a2, var int: result);
var 1..5: x;
array[int] of int: a1 = [2, 3];
array[int] of int: a2 = [];
constraint fakepred(a1, a2, x);
solve minimize x;

Flatzinc produced by mzn2fzn 2.0.1:

predicate fakepred(array [int] of int: a1,array [int] of int: a2,var int: result);
array [1..0] of bot: a2 = [];
array [1..2] of int: a1 = [2,3];
array [1..2] of int: X_INTRODUCED_0 = [2,3];
var 1..5: x:: output_var;
constraint fakepred(a1,a2,x);
solve  minimize x;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions