Implement check for logical or and logical and operands