Translate the following inference to logic notation: If it rains, then Thomas is playing a game. If Thomas plays a game, then Joseph is not rich. Joseph is rich. It is raining if and only if John is writing a letter. Therefore John is not writing a letter.
p -> q. q -> ~r. r. p <-> s. Therefore ~s.