@@ -36,6 +36,8 @@ type t =
3636 ; sign_notations : float notation SymMap .t ref
3737 (* * Maps symbols to their notation if they have some. *)
3838 ; sign_ind : ind_data SymMap .t ref
39+ ; sign_tc : SymSet .t ref
40+ ; sign_tc_inst : SymSet .t ref
3941 ; sign_cp_pos : cp_pos list SymMap .t ref
4042 (* * Maps a symbol to the critical pair positions it is heading in the
4143 rules. *) }
@@ -51,6 +53,7 @@ let dummy : unit -> t = fun () ->
5153 { sign_symbols = ref StrMap. empty; sign_path = []
5254 ; sign_deps = ref Path.Map. empty; sign_builtins = ref StrMap. empty
5355 ; sign_notations = ref SymMap. empty; sign_ind = ref SymMap. empty
56+ ; sign_tc = ref SymSet. empty; sign_tc_inst = ref SymSet. empty
5457 ; sign_cp_pos = ref SymMap. empty }
5558
5659(* * [find sign name] finds the symbol named [name] in [sign] if it exists, and
@@ -212,11 +215,11 @@ let unlink : t -> unit = fun sign ->
212215 arguments [impl], no definition and no rules. [name] should not already be
213216 used in [sign]. The created symbol is returned. *)
214217let add_symbol : t -> expo -> prop -> match_strat -> bool -> strloc -> term ->
215- bool list -> bool -> sym =
216- fun sign sym_expo sym_prop sym_mstrat sym_opaq name typ impl sym_tc ->
218+ bool list -> sym =
219+ fun sign sym_expo sym_prop sym_mstrat sym_opaq name typ impl ->
217220 let sym =
218221 create_sym sign.sign_path sym_expo sym_prop sym_mstrat sym_opaq name
219- (cleanup typ) (minimize_impl impl) sym_tc
222+ (cleanup typ) (minimize_impl impl)
220223 in
221224 sign.sign_symbols := StrMap. add name.elt sym ! (sign.sign_symbols);
222225 sym
@@ -265,6 +268,8 @@ let read : string -> t = fun fname ->
265268 unsafe_reset sign.sign_notations;
266269 unsafe_reset sign.sign_ind;
267270 unsafe_reset sign.sign_cp_pos;
271+ unsafe_reset sign.sign_tc;
272+ unsafe_reset sign.sign_tc_inst;
268273 let shallow_reset_sym s =
269274 unsafe_reset s.sym_type;
270275 unsafe_reset s.sym_def;
@@ -301,6 +306,8 @@ let read : string -> t = fun fname ->
301306 StrMap. iter (fun _ s -> reset_sym s) ! (sign.sign_symbols);
302307 StrMap. iter (fun _ s -> shallow_reset_sym s) ! (sign.sign_builtins);
303308 SymMap. iter (fun s _ -> shallow_reset_sym s) ! (sign.sign_notations);
309+ SymSet. iter (fun s -> reset_sym s) ! (sign.sign_tc);
310+ SymSet. iter (fun s -> reset_sym s) ! (sign.sign_tc_inst);
304311 let f _ sm = StrMap. iter (fun _ rs -> List. iter reset_rule rs) sm in
305312 Path.Map. iter f ! (sign.sign_deps);
306313 let reset_ind i =
@@ -382,3 +389,12 @@ let rec dependencies : t -> (Path.t * t) list = fun sign ->
382389 | d ::deps -> minimize ((List. filter not_here d) :: acc) deps
383390 in
384391 List. concat (minimize [] deps)
392+
393+ let add_tc : t -> sym -> unit =
394+ fun sign sym ->
395+ sign.sign_tc := SymSet. add sym ! (sign.sign_tc)
396+
397+ let add_tc_inst : t -> sym -> unit =
398+ fun sign sym ->
399+ sign.sign_tc_inst := SymSet. add sym ! (sign.sign_tc_inst);
400+
0 commit comments