Translate the following inference to logic notation: If James drives a car, then David is cooking. Sarah is not rich. If David cooks, then James is driving a car. Sarah is rich if and only if David is cooking. Therefore James is not driving a car.
p -> q. ~r. q -> p. r <-> q. Therefore ~p.