Solve problems 6,9,12 using SML.