Translate the following inference to logic notation: David is playing squash if and only if William is writing a letter. William is writing a letter or David is not playing squash. If William writes a letter, then David is playing squash. Therefore William is writing a letter if and only if David is playing squash.
p <-> q. q or ~p. q -> p. Therefore q <-> p.