Valid parentheses sequence

In reply to dave_59:

Hi Dave,
which constraint can be used to avoid such as )(, )))(((, ()))(( ?