X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_refiner%2FnCicCoercion.ml;h=04fddee83fdee339546a4bf42484bdf3e23d8f73;hb=0581f3c8dc2098b82cd31a0fbed224a95652bd88;hp=7d5d0101ad3de62287ad4197d6465a0efee51540;hpb=b91d9e60b0a5f450d2725d4b9bb3ed7f81ef6d3a;p=helm.git diff --git a/helm/software/components/ng_refiner/nCicCoercion.ml b/helm/software/components/ng_refiner/nCicCoercion.ml index 7d5d0101a..04fddee83 100644 --- a/helm/software/components/ng_refiner/nCicCoercion.ml +++ b/helm/software/components/ng_refiner/nCicCoercion.ml @@ -14,6 +14,9 @@ let debug s = prerr_endline (Lazy.force s);; let debug _ = ();; +let convert_term = ref (fun _ _ -> assert false);; +let set_convert_term f = convert_term := f;; + module COT : Set.OrderedType with type t = string * NCic.term * int * int * NCic.term * NCic.term = @@ -31,6 +34,12 @@ type db = DB.t * DB.t let empty_db = DB.empty,DB.empty +class type g_status = + object + inherit NCicUnifHint.g_status + method coerc_db: db + end + class status = object inherit NCicUnifHint.status @@ -38,9 +47,8 @@ class status = method coerc_db = db method set_coerc_db v = {< db = v >} method set_coercion_status - : 'status. < coerc_db : db; uhint_db: NCicUnifHint.db; .. > as 'status -> - 'self - = fun o -> {< db = o#coerc_db >}#set_unifhint_status o + : 'status. #g_status as 'status -> 'self + = fun o -> {< db = o#coerc_db >}#set_unifhint_status o end let index_coercion status name c src tgt arity arg = @@ -62,7 +70,7 @@ let index_old_db odb (status : #status) = List.fold_left (fun status (uri,_,arg) -> try - let c=fst (OCic2NCic.convert_term uri (CicUtil.term_of_uri uri)) in + let c=fst (!convert_term uri (CicUtil.term_of_uri uri)) in let arity = match tgt with | CoercDb.Fun i -> i | _ -> 0 in let src, tgt = let cty = NCicTypeChecker.typeof ~subst:[] ~metasenv:[] [] c in