logic circuit p AND q AND r