(p implies r) implies q