let module UM = UriManager in
DTE.fold (
fun k ((v,_) as value) acc ->
- let v = UM.strip_xpointer (UM.uri_of_string v) in
- if List.exists (fun (s,_) -> s = v) new_status.objects then
+ let b =
+ try
+ let v = UM.strip_xpointer (UM.uri_of_string v) in
+ List.exists (fun (s,_) -> s = v) new_status.objects
+ with UM.IllFormedUri _ -> false
+ in
+ if b then
acc
else
DTE.add k value acc
in
diff status1.objects status2.objects
+let remove_coercion uri =
+ CoercDb.remove_coercion (fun (_,_,u) -> UriManager.eq u uri)
+
let time_travel ~present ~past =
let list_of_objs_to_remove = List.rev (delta_status past present) in
(* List.rev is just for the debugging code, which otherwise may list both
* something.ind and something.ind#xpointer ... (ask Enrico :-) *)
let debug_list = ref [] in
- List.iter (fun (x,p) ->
- remove_object_from_disk x p;
+ List.iter (fun (uri,p) ->
+ remove_object_from_disk uri p;
+ remove_coercion uri;
(try
- CicEnvironment.remove_obj x
+ CicEnvironment.remove_obj uri
with CicEnvironment.Object_not_found _ ->
MatitaLog.debug
(sprintf "time_travel removes from cache %s that is not in"
- (UriManager.string_of_uri x)));
- let l = MatitaDb.remove_uri x in
- debug_list := UriManager.string_of_uri x :: !debug_list @ l)
+ (UriManager.string_of_uri uri)));
+ let l = MatitaDb.remove_uri uri in
+ debug_list := UriManager.string_of_uri uri :: !debug_list @ l)
list_of_objs_to_remove;
(* this is debug code
--- /dev/null
+alias id "eq" = "cic:/Coq/Init/Logic/eq.ind#xpointer(1/1)".
+alias id "n" = "cic:/Suresnes/BDD/canonicite/Canonicity_BDT/n.con".
+alias id "nat" = "cic:/Coq/Init/Datatypes/nat.ind#xpointer(1/1)".
+theorem a:
+ (\forall p: nat \to Prop.
+ \forall n: nat. p n \to p n ) \to (eq nat n n).
+intro.
+apply (H (\lambda n:nat.(eq nat n n))).
\ No newline at end of file
--- /dev/null
+inductive pos: Set \def
+| one : pos
+| next : pos \to pos.
+
+inductive nat:Set \def
+| O : nat
+| S : nat \to nat.
+
+inductive empty : Set \def .
+
+definition pos2nat : pos \to nat \def
+ \lambda x:pos . match x with
+ [ one \Rightarrow O
+ | (next z) \Rightarrow O].
+
+definition empty2nat : empty \to nat \def
+ \lambda x : empty . S (match x in empty with []).
\ No newline at end of file