Skip to content

Error with array literal of variables #407

Closed
@Shaolun5

Description

@Shaolun5

Hi, here is the example to reproduce the error:

array[1..5] of var 1..10: a = [1,2,3,4,5];

var 1..100: s;
constraint s = sum(j in 1..3)([a[i]| i in 1..5 where a[i] != 3][j]);

output [show(s)]; % shows 3, but the correct answer should be 7

Also when I replace 1..3 by 1..4, MiniZinc reports:

Error: Unknown character in line no. 3

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