def find_possible_splits(rule, derivable_rules, allow_repeated_target_nts=True):
  """Implements `NEW` procedure described in paper appendix."""
  candidates = _get_split_candidates(rule, allow_repeated_target_nts)

  # Set of QCFGRules.
  rule_candidates = set()
  for rule_b, rule_c in candidates:
    if rule_b in derivable_rules and rule_c not in derivable_rules:
      # <NT, NT> =>_a == <NT, NT> =>_b =>_c where b is in derivable_rules.
      rule_candidates.add(rule_c)
    elif rule_c in derivable_rules and rule_b not in derivable_rules:
      # <NT, NT> =>_a == <NT, NT> =>_b =>_c where c is in derivable_rules.
      rule_candidates.add(rule_b)

  return rule_candidates
Implements `NEW` procedure described in paper appendix.
language/compgen/nqg/model/induction/split_utils.py