Changing rules by constraints and specs