Translate the following inference to logic notation: If Richard sleeps, then William is drinking water. If William drinks water, then Richard is sleeping. Richard is not sleeping. Therefore William is not drinking water.
p -> q. q -> p. ~p. Therefore ~q.