def _rhs_count(rhs_a, rhs_b):
  """Returns count of occurances of rhs_b in rhs_a."""
  if len(rhs_b) > len(rhs_a):
    return 0
  count = 0
  for idx in range(len(rhs_a) - len(rhs_b) + 1):
    if rhs_a[idx:idx + len(rhs_b)] == rhs_b:
      count += 1
  return count
Returns count of occurances of rhs_b in rhs_a.
language/compgen/csl/induction/unification_utils.py