let exists_fun_callers fpred kf =
  let table = ref VarinfoSet.empty in
  let rec exists_fun_callers kf =
    if fpred kf
    then true
    else let vf = Kernel_function.get_vi kf in
      if VarinfoSet.mem vf !table
      then false (* no way to call the initial [kf]. *)
      else
        (table := VarinfoSet.add vf !table ;
         List.exists (fun (kf,_) -> exists_fun_callers kf) (!Db.Value.callers kf))
  in exists_fun_callers kf