To simplify if(x, y, z):

  1. Simplify x, yielding result u.

  2. Check that u is a boolean value (true or false). If not, it is an error.

  3. If u is true, then simplify y, yielding result v. The answer is v.

  4. If u is false, then simplify z, yielding result w. The answer is w.