Array .sum(): Sum Only Elements on Even Indexes

In reply to chr_sue:

In reply to Mihai-Corneliu Cristescu:
Please try

constraint my_constraint {
my_array.sum() with (64'(item * 2)) == _14GB;
}

I think the above solution is not correct as is doing multiplication on the item values before adding them up, not checking or filtering the even indexed values of the array, maybe you could try something like this


my_array.sum() with (64'(((item.index % 2) == 0) ? item : 0)) == _14GB;

HTH,
-R