]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/matita/matitaSync.ml
DisambiguationError exceptions (that have locations inside) are now relocated
[helm.git] / helm / matita / matitaSync.ml
index cbf305261eb3fbdcba374c23e4b8721192fec41d..74340421f2c1f117dd268b7e93245fa2464a4d8a 100644 (file)
@@ -153,7 +153,6 @@ let save_object_to_disk status uri obj ugraph univlist =
       xmlunivgraphpath, univgraphuri = 
     paths_and_uris_of_obj uri status 
   in
-  let path_scheme_of path = "file://" ^ path in
   List.iter HExtlib.mkdir (List.map Filename.dirname [xmlpath]);
   (* now write to disk *)
   ensure_path_exists xmlpath;
@@ -229,13 +228,20 @@ module UriSet = Set.Make (OrderedUri)
 module IdSet  = Set.Make (OrderedId)
 
   (** @return l2 \ l1 *)
-let uri_list_diff l2 l1 =
+let urixstring_list_diff l2 l1 =
   let module S = UriSet in
   let s1 = List.fold_left (fun set uri -> S.add uri set) S.empty l1 in
   let s2 = List.fold_left (fun set uri -> S.add uri set) S.empty l2 in
   let diff = S.diff s2 s1 in
   S.fold (fun uri uris -> uri :: uris) diff []
 
+let uri_list_diff l2 l1 =
+  let module S = UriManager.UriSet in
+  let s1 = List.fold_left (fun set uri -> S.add uri set) S.empty l1 in
+  let s2 = List.fold_left (fun set uri -> S.add uri set) S.empty l2 in
+  let diff = S.diff s2 s1 in
+  S.fold (fun uri uris -> uri :: uris) diff []
+
   (** @return l2 \ l1 *)
 let id_list_diff l2 l1 =
   let module S = IdSet in
@@ -248,15 +254,16 @@ let remove_coercion uri =
   CoercDb.remove_coercion (fun (_,_,u) -> UriManager.eq u uri)
   
 let time_travel ~present ~past =
-  let objs_to_remove = uri_list_diff present.objects past.objects in
+  let objs_to_remove = urixstring_list_diff present.objects past.objects in
+  let coercions_to_remove = uri_list_diff present.coercions past.coercions in
   let notation_to_remove =
     id_list_diff present.notation_ids past.notation_ids
   in
   let debug_list = ref [] in
+  List.iter remove_coercion coercions_to_remove;
   List.iter
     (fun (uri,p) -> 
       MatitaMisc.safe_remove p;
-      remove_coercion uri;
       (try 
         CicEnvironment.remove_obj uri
       with CicEnvironment.Object_not_found _ ->