Looping construct inside a constraint

In reply to o-hassan:
Constraints are not procedural statements - they are a set of simultaneous equations. The foreach construct is used as both a looping construct in procedural code and as an iterative constraint that gets unrolled until simultaneous constraints. SystemVerilog does not allow the for construct in a constrain, but you can think of foreach as a special case of the for construct.