PolyJuMP: constraints on an arbitrarily large multinomial

Hi everyone!

In using DynamicPolynomials, SumOfSquares, and CSDP, I have set up my objective function and constraints like so:

m = 2

@polyvar x[1:m]
p = x[1]^2 + x[2]^2
S = @set x[1] >= 0 &&
         x[1] <= 1 &&
         x[2] <= 0 &&
         x[2] <= 1 &&
         sum(x) == 1

(This is from the documentation Polynomial Optimization · SumOfSquares)

This works fine for fixed m = 2, but I want to be able to @set my constraints for a multinomial in an arbitrary number of variables; I don’t want to type x[i] >= 0 && x[i] <= 1 m times. How can I achieve this?

P.S. In my adventures I tried doing something like using reduce(add, [x[i] >= 0 for i = 1:m]) where add(a, b) is defined as a && b, but that didn’t work.