In reply to bassem yasser:
Constraints only work with integral expressions, not arrays. So you need to add another random selection variable and use an implication.
rand bit select; // or use another enum
constraint cmd_select {cmd.size() inside {[5:10]};
select dist { 1:=10, 0};
foreach {cmd[list]} if (select)
cmd[list] inside {cmds_one};
else
cmd[list] inside {cmds_two};
}
Did not try to compile this, so there may be syntax errors.