Translate the following inference to logic notation: If Thomas listens to a song, then Susan is a lawyer. William is bored or Susan is not a lawyer. Thomas is listening to a song or William is not bored. Therefore Susan is a lawyer if and only if William is bored.
p -> q. r or ~q. p or ~r. Therefore q <-> r.