SV contraint to repeat elements n time

In reply to ABD_91:

The length of the result of (i ? j : k) is Max(Length(j),Length(k). So result of (a.sum() with ((item == 2) ? item : 0 ) gets evaluated in 32-bits since the numeric literal 0 is 32-bits.

The following two constraints will never succeed because there is no multiple of 2 or 3 that could ever equal 5.

a.sum() with ((item == 2) ? 2 : 0 ) == 5 ; 
a.sum() with ((item == 3) ? 3 : 0 ) == 5 ; 

You many want to read https://go.mentor.com/5cdxN