def get_candidate_size_delta(self, candidate_rule, rules_to_remove):
    """Computes the delta in grammar size."""
    delta = 0.0
    delta -= self._get_rule_size(candidate_rule)
    for rule in rules_to_remove:
      delta += self._get_rule_size(rule)
    return delta
Computes the delta in grammar size.
language/compgen/csl/induction/objective_utils.py