simplify ((((not p and r) or (p or r)) and q) or (p and not q)) and not r