solve if condition part has a terminal