Translate the following inference to logic notation: Patricia is not writing a letter. David is sleeping if and only if Mary is a police officer. Mary is a police officer if and only if Patricia is writing a letter. Therefore David is not sleeping.
~p. q <-> r. r <-> p. Therefore ~q.