Translate the following inference to logic notation: If David writes a letter, then it is snowing. If John goes running, then David is writing a letter. John is not running. If it snows, then John is running. Therefore David is not writing a letter.
p -> q. r -> p. ~r. q -> r. Therefore ~p.