A functional transformation from x to y (i.e., one where each value for x is assigned a single value for y) is best done through the element constraint when possible. The constraint takes an array that maps the domain of x to the domain of y, starting at the zero index.
For your example, you can use the following (assuming that invalid
is an int not in the domain of y
):
IntArgs mapping(3, invalid, 3, 5);
element(*this, mapping, x, y);