Translate the following inference to logic notation: If it rains, then it is cold. It is not raining. If it is cold, then it is raining. John is a sailor. Therefore John is a sailor and it is not cold.
p -> q. ~p. q -> p. r. Therefore r and ~q.