initSubstitutionResult() getAnswerSubstitutionResult()

Trace the substitution algorithm to perform the following substitution and write down your final answer on the right, using ^ to denote λ. For each α-conversion that the algorithm requires when computing, say, subst(e, p, λx.B), you must choose for the new variable the letter that comes first alphabetically (i.e., "a", then "b", etc.) among those occur neither in e nor B.

CorrectAnswer

For each step in the algorithm, make sure to pick the only case that applies based on the type of the outermost expression which you are substituting into.

Make sure to perform an α-conversion only when the algorithm requires it, that is, in case 2c.

For each α-conversion, if any, you must choose the correct variable name (reread the instructions above) to get credit for your answer: there is only one correct answer for each substitution.