| _ -> assert false)
| k -> k
in
- let localization_tbl = Cic.CicHash.create 503 in
+ let mk_localization_tbl x = Cic.CicHash.create x in
MultiPassDisambiguator.disambiguate_thing ~context ~metasenv ~subst
~initial_ugraph ~aliases ~string_context_of_context
~universe ~lookup_in_library ~mk_implicit ~description_of_alias
~domain_of_thing:Disambiguate.domain_of_term
~interpretate_thing:(interpretate_term (?create_dummy_ids:None) ~mk_choice)
~refine_thing:refine_term (text,prefix_len,term)
- ~localization_tbl
+ ~mk_localization_tbl
~hint
~freshen_thing:CicNotationUtil.freshen_term
~passes:(MultiPassDisambiguator.passes ())
~aliases ~universe ~lookup_in_library ~uri (text,prefix_len,obj)
=
let hint = (fun _ x -> x), fun k -> k in
- let localization_tbl = Cic.CicHash.create 503 in
+ let mk_localization_tbl x = Cic.CicHash.create x in
MultiPassDisambiguator.disambiguate_thing ~context:[] ~metasenv:[] ~subst:[]
~aliases ~universe ~uri ~string_context_of_context
~pp_thing:(CicNotationPp.pp_obj CicNotationPp.pp_term)
~initial_ugraph:CicUniv.empty_ugraph
~interpretate_thing:(interpretate_obj ~mk_choice)
~refine_thing:refine_obj
- ~localization_tbl
+ ~mk_localization_tbl
~hint
~passes:(MultiPassDisambiguator.passes ())
~freshen_thing:CicNotationUtil.freshen_obj
'metasenv -> 'subst -> 'context -> 'uri -> use_coercions:bool ->
'raw_thing -> 'ugraph -> localization_tbl:'cichash ->
('refined_thing, 'metasenv,'subst,'ugraph) test_result) ->
- localization_tbl:'cichash ->
+ mk_localization_tbl:(int -> 'cichash) ->
string * int * 'ast_thing ->
((DisambiguateTypes.Environment.key * 'alias) list *
'metasenv * 'subst * 'refined_thing * 'ugraph)
~mk_implicit ~description_of_alias
~aliases ~universe ~lookup_in_library
~uri ~pp_thing ~domain_of_thing ~interpretate_thing ~refine_thing
- ~localization_tbl
+ ~mk_localization_tbl
(thing_txt,thing_txt_prefix_len,thing)
=
debug_print (lazy "DISAMBIGUATE INPUT");
env in
aux (aux env l) tl in
let filled_env = aux aliases todo_dom in
+ let localization_tbl = mk_localization_tbl 503 in
let cic_thing =
interpretate_thing ~context ~env:filled_env
~uri ~is_path:false thing ~localization_tbl
(inner_dom@remaining_dom@rem_dom) base_univ
with
| Ok (thing, metasenv,subst,new_univ) ->
+(* prerr_endline "OK"; *)
let res =
(match inner_dom with
| [] ->
in
res @@ filter tl
| Uncertain loc_msg ->
+(* prerr_endline ("UNCERTAIN"); *)
let res =
(match inner_dom with
| [] -> [],[new_env,new_diff,loc_msg],[]
in
res @@ filter tl
| Ko loc_msg ->
+(* prerr_endline "KO"; *)
let res = [],[],[new_env,new_diff,loc_msg,true] in
res @@ filter tl)
in
'metasenv -> 'subst -> 'context -> 'uri -> use_coercions:bool ->
'raw_thing -> 'ugraph -> localization_tbl:'cichash ->
('refined_thing, 'metasenv,'subst,'ugraph) test_result) ->
- localization_tbl:'cichash ->
+ mk_localization_tbl:(int -> 'cichash) ->
string * int * 'ast_thing ->
((DisambiguateTypes.Environment.key * 'alias) list *
'metasenv * 'subst * 'refined_thing * 'ugraph)
let disambiguate_thing ~passes ~freshen_thing ~context ~metasenv ~subst
~string_context_of_context ~initial_ugraph ~hint ~mk_implicit
~description_of_alias ~aliases ~universe ~lookup_in_library ~uri ~pp_thing
- ~domain_of_thing ~interpretate_thing ~refine_thing ~localization_tbl thing
+ ~domain_of_thing ~interpretate_thing ~refine_thing ~mk_localization_tbl thing
=
let f ~fresh_instances ~aliases ~universe ~use_coercions (txt,len,thing) =
- let thing = if fresh_instances then freshen_thing thing else thing
- in
+ let thing = if fresh_instances then freshen_thing thing else thing in
Disambiguate.disambiguate_thing
~context ~metasenv ~subst ~use_coercions ~string_context_of_context
~initial_ugraph ~hint ~mk_implicit ~description_of_alias
~aliases ~universe ~lookup_in_library
~uri ~pp_thing ~domain_of_thing ~interpretate_thing ~refine_thing
- ~localization_tbl (txt,len,thing)
+ ~mk_localization_tbl (txt,len,thing)
in
disambiguate_thing ~description_of_alias ~passes ~aliases ~universe ~f thing
'metasenv -> 'subst -> 'context -> 'uri -> use_coercions:bool ->
'raw_thing -> 'ugraph -> localization_tbl:'cichash ->
('refined_thing, 'metasenv,'subst,'ugraph) Disambiguate.test_result) ->
- localization_tbl:'cichash ->
+ mk_localization_tbl:(int -> 'cichash) ->
string * int * 'ast_thing ->
((DisambiguateTypes.Environment.key * 'alias) list *
'metasenv * 'subst * 'refined_thing * 'ugraph)
match t with
| CicNotationPt.AttributedTerm (`Loc loc, term) ->
let res = aux ~localize loc context term in
- if localize then NCicUntrusted.NCicHash.add localization_tbl res loc;
- res
+ if localize then
+ NCicUntrusted.NCicHash.add localization_tbl res loc;
+ res
| CicNotationPt.AttributedTerm (_, term) -> aux ~localize loc context term
| CicNotationPt.Appl (CicNotationPt.Symbol (symb, i) :: args) ->
let cic_args = List.map (aux ~localize loc context) args in
| _ -> assert false (* god bless Bologna *)
in
- prerr_endline (NCicPp.ppterm ~metasenv:[] ~context:[] ~subst:[]
- res);
+(* prerr_endline (NCicPp.ppterm ~metasenv:[] ~context:[] ~subst:[] res); *)
res
and aux_option ~localize loc context annotation = function
| None -> NCic.Implicit annotation
| Some (CicNotationPt.AttributedTerm (`Loc loc, term)) ->
let res = aux_option ~localize loc context annotation (Some term) in
- if localize then NCicUntrusted.NCicHash.add localization_tbl res loc;
+ if localize then
+ NCicUntrusted.NCicHash.add localization_tbl res loc;
res
| Some (CicNotationPt.AttributedTerm (_, term)) ->
aux_option ~localize loc context annotation (Some term)
~aliases ~universe ~lookup_in_library
(text,prefix_len,term)
=
- let localization_tbl = NCicUntrusted.NCicHash.create 503 in
+ let mk_localization_tbl x = NCicUntrusted.NCicHash.create x in
let hint =
match goal with
None -> (fun _ y -> y),(fun x -> x)
~lookup_in_library ~domain_of_thing:domain_of_term
~interpretate_thing:(interpretate_term ~mk_choice (?create_dummy_ids:None))
~refine_thing:refine_term (text,prefix_len,term)
- ~localization_tbl ~hint ~subst
+ ~mk_localization_tbl ~hint ~subst
in
List.map (function (a,b,c,d,_) -> a,b,c,d) res, b
;;