]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/disambiguation/disambiguate.ml
One-shot aliases were no longer generated because of a bug (i.e. all aliases
[helm.git] / helm / software / components / disambiguation / disambiguate.ml
index 52411d6ed2abf458ef8706691419713ffb6eb6bc..5ac709f9b82fc4e7b5e6dbe6f85fee64abc53570 100644 (file)
@@ -311,6 +311,7 @@ let rec domain_of_term ?(loc = HExtlib.dummy_floc) ~context = function
             [ Node ([loc], Id name, terms) ]))
   | Ast.Uri _ -> []
   | Ast.NRef _ -> []
+  | Ast.NCic _ -> []
   | Ast.Implicit _ -> []
   | Ast.Num (num, i) -> [ Node ([loc], Num i, []) ]
   | Ast.Meta (index, local_context) ->
@@ -407,11 +408,16 @@ let domain_diff dom1 dom2 =
 
 let refine_profiler = HExtlib.profile "disambiguate_thing.refine_thing"
 
+type alias_spec =
+  | Ident_alias of string * string        (* identifier, uri *)
+  | Symbol_alias of string * int * string (* name, instance no, description *)
+  | Number_alias of int * string          (* instance no, description *)
+
 let disambiguate_thing 
   ~context ~metasenv ~subst ~use_coercions
   ~string_context_of_context
   ~initial_ugraph:base_univ ~expty
-  ~mk_implicit ~description_of_alias
+  ~mk_implicit ~description_of_alias ~fix_instance
   ~aliases ~universe ~lookup_in_library 
   ~uri ~pp_thing ~domain_of_thing ~interpretate_thing ~refine_thing 
   ~mk_localization_tbl
@@ -438,12 +444,7 @@ let disambiguate_thing
             input_or_locate_uri item
       | Some e ->
           (try
-            let item =
-              match item with
-              | Symbol (symb, _) -> Symbol (symb, 0)
-              | item -> item
-            in
-            Environment.find item e
+            fix_instance item (Environment.find item e)
           with Not_found -> [])
    in
 (*