Translate the following inference to logic notation: If Charles were not a doctor, then Mary is a nurse. William is not an astronaut. Charles is a doctor if and only if William is an astronaut. Therefore Mary is a nurse.
~p -> q. ~r. p <-> r. Therefore q.