To simplify if(x, y, z):
Simplify x, yielding result u.
Check that u is a boolean value (true or false). If not, it is an error.
If u is true, then simplify y, yielding result v. The answer is v.
If u is false, then simplify z, yielding result w. The answer is w.