Translate the following inference to logic notation: It is sunny. If it is sunny, then John is a lawyer. John is not a lawyer. If John were a lawyer, then it is sunny. Therefore William is bored.
p. p -> q. ~q. q -> p. Therefore r.