Translate the following inference to logic notation: If John were sad, then it is late. If it is late, then Charles is a lawyer. If Charles were a lawyer, then John is sad. Therefore it is late if and only if Charles is a lawyer.
p -> q. q -> r. r -> p. Therefore q <-> r.