Write constraint for an integer array with 10 elements such that exactly 3 of them are same and rest are unique

In reply to dave_59:

// every value except val3 must appear only once
        val[i] != val3 -> val.sum() with (int'(item==val[i]))== 1;
      }
      // val3 must appear three times in the array
      val.sum() with (int'(item==val3)) == 3;

I have trouble understanding these lines. What exactly ‘item’ refers to here?
What are these lines achieving exactly?