Translate the following inference to logic notation: Robert is playing tennis if and only if Charles is cooking. If Robert plays tennis, then Charles is cooking. Robert is not playing tennis. Thomas is a carpenter. Therefore Charles is not cooking and Thomas is a carpenter.
p <-> q. p -> q. ~p. r. Therefore ~q and r.