X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_kernel%2FnCicLibrary.ml;h=c75de5265b603d67808c7ff55582960f792779c0;hb=ae52a8447fbe67847eba356d26b568d637c90652;hp=43b4a78a3c59428bc7f5b2ef094c2a4de45065be;hpb=2338b758114eb40daf3fadf4fb016a9a1af541b6;p=helm.git diff --git a/helm/software/components/ng_kernel/nCicLibrary.ml b/helm/software/components/ng_kernel/nCicLibrary.ml index 43b4a78a3..c75de5265 100644 --- a/helm/software/components/ng_kernel/nCicLibrary.ml +++ b/helm/software/components/ng_kernel/nCicLibrary.ml @@ -23,16 +23,25 @@ let refresh_uri_in_universe = let rec refresh_uri_in_term = function + | NCic.Meta (i,(n,NCic.Ctx l)) -> + NCic.Meta (i,(n,NCic.Ctx (List.map refresh_uri_in_term l))) + | NCic.Meta _ as t -> t | NCic.Const (NReference.Ref (u,spec)) -> NCic.Const (NReference.reference_of_spec (refresh_uri u) spec) | NCic.Sort (NCic.Type l) -> NCic.Sort (NCic.Type (refresh_uri_in_universe l)) + | NCic.Match (NReference.Ref (uri,spec),outtype,term,pl) -> + let r = NReference.reference_of_spec (refresh_uri uri) spec in + let outtype = refresh_uri_in_term outtype in + let term = refresh_uri_in_term term in + let pl = List.map refresh_uri_in_term pl in + NCic.Match (r,outtype,term,pl) | t -> NCicUtils.map (fun _ _ -> ()) () (fun _ -> refresh_uri_in_term) t ;; let refresh_uri_in_obj (uri,height,metasenv,subst,obj_kind) = assert (metasenv = []); assert (subst = []); - uri,height,metasenv,subst, + refresh_uri uri,height,metasenv,subst, NCicUntrusted.map_obj_kind refresh_uri_in_term obj_kind ;; @@ -194,12 +203,13 @@ module Serializer(S: sig type status end) = let register tag require = assert (not (List.mem tag !already_registered)); already_registered := tag :: !already_registered; + let old_require1 = !require1 in require1 := - (fun (tag',data) as x -> - if tag=tag' then - require (Obj.magic data) ~refresh_uri_in_universe ~refresh_uri_in_term - else - !require1 x); + (fun (tag',data) as x -> + if tag=tag' then + require (Obj.magic data) ~refresh_uri_in_universe ~refresh_uri_in_term + else + old_require1 x); (fun x -> tag,Obj.repr x) let serialize = serialize