type db = DB.t
+class status =
+ object
+ val db = DB.empty
+ method uhint_db = db
+ method set_uhint_db v = {< db = v >}
+ method set_unifhint_status
+ : 'status. < uhint_db : db; .. > as 'status -> 'self
+ = fun o -> {< db = o#uhint_db >}
+ end
+
let dummy = NCic.Const (NReference.reference_of_string "cic:/dummy_conv.dec");;
let pair t1 t2 = (NCic.Appl [dummy;t1;t2]) ;;
NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] src ^ " |==> " ^
NCicPp.ppterm ~metasenv:[] ~subst:[] ~context:[] data);
*)
- DB.index hdb src (precedence, data)
+ hdb#set_uhint_db (DB.index hdb#uhint_db src (precedence, data))
;;
-let empty_db = DB.empty ;;
-
let add_user_provided_hint db t precedence =
- 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
- | NCic.LetIn (n,ty,t,b) ->
- aux ((n, NCic.Def (t,ty)) :: ctx) b
+ | NCic.Prod (n,s,t) -> aux ((n, NCic.Decl s) :: ctx) t
+ | NCic.LetIn (n,ty,t,b) -> aux ((n, NCic.Def (t,ty)) :: ctx) b
| _ -> assert false
in
- aux [] (fst (OCic2NCic.convert_term u t))
+ aux [] t
in
index_hint db c a b precedence
;;
String.concat "|" (List.map (NCicPp.ppterm ~metasenv:[] ~subst:[]
~context:[]) (HintSet.elements ds))));
*)
- let candidates1 = DB.retrieve_unifiables hdb (pair t1 t2) in
- let candidates2 = DB.retrieve_unifiables hdb (pair t2 t1) in
+ let candidates1 = DB.retrieve_unifiables hdb#uhint_db (pair t1 t2) in
+ let candidates2 = DB.retrieve_unifiables hdb#uhint_db (pair t2 t1) in
let candidates1 =
List.map (fun (prec,ty) ->
prec,true,saturate ~delta:max_int metasenv subst context ty 0)