Translate the following inference to logic notation: If it is overcast, then David is listening to a song. It is not overcast. If Thomas were a writer, then it is overcast. If David listens to a song, then Thomas is a writer. Therefore Thomas is not a writer.
p -> q. ~p. r -> p. q -> r. Therefore ~r.