different way of checking wether we should apply unary rules to a given nonterminal