Translate the following inference to logic notation: William is listening to a song. If William listens to a song, then David is an astronaut. Joseph is playing tennis if and only if John is sad. John is not sad. Therefore David is an astronaut and Joseph is not playing tennis.
p. p -> q. r <-> s. ~s. Therefore q and ~r.