Solve problems 2-3 using SML.