NCicSubstitution.subst (NCic.Meta (-1,(0,NCic.Irl 0))) t
| _ -> assert false)
pair' context in
+ prerr_endline ("INDEXING: " ^
+ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] src ^ " |==> " ^
+ NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] data);
DB.index hdb src data
;;
let empty_db = DB.empty ;;
+let user_db = ref empty_db ;;
+
+let add_user_provided_hint t =
+ let u = UriManager.uri_of_string "cic:/foo/bar.con" in
+ let c, a, b =
+ let rec aux ctx = function
+ | NCic.Appl l ->
+ (match List.rev l with
+ | b::a::_ -> ctx, a, b
+ | _ -> assert false)
+ | NCic.Prod (n,s,t) ->
+ aux ((n, NCic.Decl s) :: ctx) t
+ | _ -> assert false
+ in
+ aux [] (fst (OCic2NCic.convert_term u t))
+ in
+ user_db := index_hint !user_db c a b
+;;
+
let db () =
let combine f cmp l1 l2 =
List.flatten
in
List.fold_left
(fun db -> function
- |None -> db
+ | None -> db
| Some (ctx,b1,b2) -> index_hint db ctx b1 b2)
- empty_db hints
+ !user_db hints
;;