+ let _ =
+ match mode with
+ | Matching ->
+ Printf.printf "| candidates Matching %s\n" (CicPp.ppterm term)
+ | Unification ->
+ Printf.printf "| candidates Unification %s\n" (CicPp.ppterm term)
+ in
+ print_endline
+ (String.concat "\n"
+ (List.map
+ (fun (p, e) ->
+ Printf.sprintf "| (%s, %s)" (Utils.string_of_pos p)
+ (Inference.string_of_equality e))
+ res));
+ print_endline "|";
+;;
+
+
+let indexing_retrieval_time = ref 0.;;
+
+
+(* let my_apply_subst subst term = *)
+(* let module C = Cic in *)
+(* let lookup lift_amount meta = *)
+(* match meta with *)
+(* | C.Meta (i, _) -> ( *)
+(* try *)
+(* let _, (_, t, _) = List.find (fun (m, _) -> m = i) subst in *)
+(* (\* CicSubstitution.lift lift_amount *\)t *)
+(* with Not_found -> meta *)
+(* ) *)
+(* | _ -> assert false *)
+(* in *)
+(* let rec apply_aux lift_amount = function *)
+(* | C.Meta (i, l) as t -> lookup lift_amount t *)
+(* | C.Appl l -> C.Appl (List.map (apply_aux lift_amount) l) *)
+(* | C.Prod (nn, s, t) -> *)
+(* C.Prod (nn, apply_aux lift_amount s, apply_aux (lift_amount+1) t) *)
+(* | C.Lambda (nn, s, t) -> *)
+(* C.Lambda (nn, apply_aux lift_amount s, apply_aux (lift_amount+1) t) *)
+(* | t -> t *)
+(* in *)
+(* apply_aux 0 term *)
+(* ;; *)
+
+
+(* let apply_subst subst term = *)
+(* Printf.printf "| apply_subst:\n| subst: %s\n| term: %s\n" *)
+(* (Utils.print_subst ~prefix:" ; " subst) (CicPp.ppterm term); *)
+(* let res = my_apply_subst subst term in *)
+(* (\* let res = CicMetaSubst.apply_subst subst term in *\) *)
+(* Printf.printf "| res: %s\n" (CicPp.ppterm res); *)
+(* print_endline "|"; *)
+(* res *)
+(* ;; *)
+
+(* let apply_subst = my_apply_subst *)
+let apply_subst = CicMetaSubst.apply_subst
+
+
+let apply_subst =
+ let profile = CicUtil.profile "apply_subst" in
+ (fun s a -> profile (apply_subst s) a)
+;;
+
+
+(*
+(* NO INDEXING *)
+let empty_table () = []
+
+let index table equality =
+ let _, _, (_, l, r, ordering), _, _ = equality in
+ match ordering with
+ | Utils.Gt -> (Utils.Left, equality)::table
+ | Utils.Lt -> (Utils.Right, equality)::table
+ | _ -> (Utils.Left, equality)::(Utils.Right, equality)::table
+;;
+
+let remove_index table equality =
+ List.filter (fun (p, e) -> e != equality) table
+;;
+
+let in_index table equality =
+ List.exists (fun (p, e) -> e == equality) table
+;;
+
+let get_candidates mode table term = table
+*)