AST: Refactoring new checkIncorrectLogic checking