]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/cic_disambiguation/disambiguateTypes.ml
This alternative version of disambiguate.crit2 implements the following
[helm.git] / helm / software / components / cic_disambiguation / disambiguateTypes.ml
index 79388f8198d3e20372a6f19c6ad17d55d0e0837a..1eade4ca09850d1b6d6636d5b3bb8e203142e5ee 100644 (file)
@@ -40,7 +40,7 @@ type domain_item =
   | Symbol of string * int     (* literal, instance num *)
   | Num of int                 (* instance num *)
 
-exception Invalid_choice of string Lazy.t
+exception Invalid_choice of Stdpp.location option * string Lazy.t
 
 module OrderedDomain =
   struct
@@ -55,6 +55,16 @@ struct
 
   include Environment'
 
+  let find k env =
+   match k with
+      Symbol (sym,n) ->
+       (try find k env
+        with Not_found -> find (Symbol (sym,0)) env)
+    | Num n ->
+       (try find k env
+        with Not_found -> find (Num 0) env)
+    | _ -> find k env
+
   let cons k v env =
     try
       let current = find k env in
@@ -106,7 +116,7 @@ module type Callbacks =
       UriManager.uri list
     val interactive_interpretation_choice:
       string -> int ->
-      (Token.flocation list * string * string) list list -> int list
+      (Stdpp.location list * string * string) list list -> int list
     val input_or_locate_uri:
       title:string -> ?id:string -> unit -> UriManager.uri option
   end