"Range must be bounded by constant expression" - Error from a constraint block

In reply to Tudor Timi:

Thanks for the reply Tudor.

Probably I should have been more clear when explaining the question.

I have tried to explain this a little more detailed.
current[i] is a dynamic array of size greater than that of next[i]

I need to have a constraint where next[i] is one of the values of current[i] with one more constraint on the indices of current

One typical output should look like this:
Lets assume the size of current is 10, size of next is 1 and size of total_count is 5.
next[0] should take one of the values of current [0 : 5]

Kindly let me know if I can specify a dynamic range in the constraint.