def get_candidate_penalty_delta(self, candidate_rule, rules_to_remove):
    """Computes delta based on rule penalties."""
    delta = 0.0
    delta -= self._get_rule_penalty(candidate_rule)
    for rule in rules_to_remove:
      delta += self._get_rule_penalty(rule)
    return delta
Computes delta based on rule penalties.
language/compgen/csl/induction/objective_utils.py