let eq f g =
  assert(if f == g then equal f g else not(equal f g));
  f == g