Translate the following inference to logic notation: It is raining if and only if John is sleeping. If John sleeps, then John is a carpenter. It is raining and Joseph is rich. Therefore John is a carpenter.
p <-> q. q -> r. p and s. Therefore r.