Example of a boolean function
Yes. Using the convention that inputs and outputs are $\pm 1$, then the function is
$$
\frac{a(x+y)+b(x-y)}{2}.
$$
You could have found this function using exhaustive search – there are only $2^{16}$ functions on $4$ variables.