let new_coercions =
CoercGraph.close_coercion_graph src_uri tgt_uri coer_uri in
let status =
- List.fold_left (fun s (uri,o,_) -> MatitaSync.add_obj uri o status)
+ List.fold_left (fun s (uri,o,_) ->
+ let status = MatitaSync.add_obj uri o status in
+ {status with coercions = uri :: status.coercions})
status new_coercions in
+ let status = {status with coercions = coer_uri :: status.coercions} in
let statement_of name =
GrafiteAst.Coercion (DisambiguateTypes.dummy_floc,
(CicNotationPt.Ident (name, None)))
proof_status = No_proof;
options = default_options ();
objects = [];
+ coercions = [];
notation_ids = [];
}
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
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 _ ->
proof_status: proof_status; (** logical status *)
options: options;
objects: (UriManager.uri * string) list; (** in-scope objects, with paths *)
+ coercions: UriManager.uri list; (** defined coercions *)
notation_ids: CicNotation.notation_id list; (** in-scope notation ids *)
}