Can we use Ternary operator in Constraints?

In reply to MICRO_91:

When A is constrained to be 1

b == (a<2) ? 2 : 3;
       ⇩
b == 1 ? 2 : 3;
       ⇩
(b == 1) ? 2 : 3;

If the solver chooses b to be 1, then the result of this expression is 2, which satisfies the constraint because it is true (non-zero)

If the solver chooses b to a value other than 1, then the result of this expression is 3, which satisfies the constraint because it is true (non-zero)

The solver is free to choose any value for b.

If you change the constraint to

b == (a<2) ? 0 : 3;
       ⇩
b == 1 ? 0 : 3;
       ⇩
(b == 1) ? 0 : 3;

If the solver chooses b to be 1, then the result of this expression is 0, which does not satisfy the constraint because it is false (zero)

If the solver chooses b to a value other than 1, then the result of this expression is 3, which satisfies the constraint because it is true (non-zero).

So b is contrainted to be a value other than 1.