]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gTopLevel/oldDisambiguate.ml
The disambiguation now returns a list of interpretations.
[helm.git] / helm / gTopLevel / oldDisambiguate.ml
index 39be585e55e3082dd4256fd7207f9ffb6c12f6ec..9b1d4937cfc1de9a3cc660301c4e6caf4a7a2fda 100644 (file)
@@ -46,7 +46,7 @@ module type Callbacks =
       ?enable_button_for_non_vars:bool ->
       title:string -> msg:string -> id:string -> string list -> string list
     val interactive_interpretation_choice :
-      (string * string) list list -> int
+      (string * string) list list -> int list
     val input_or_locate_uri : title:string -> UriManager.uri
   end
 ;;
@@ -232,10 +232,10 @@ prerr_endline ("%%% PRUNED!!! " ^ CicPp.ppterm expr) ;
            exit 1
           end
        ) resolve_ids ;
-      let resolve_id',term,metasenv' =
+      let res =
        match resolve_ids with
           [] -> raise ThereDoesNotExistAnyWellTypedInterpretationOfTheInput
-        | [resolve_id] -> resolve_id
+        | [_] -> resolve_ids
         | _ ->
           let choices =
            List.map
@@ -266,10 +266,13 @@ prerr_endline ("%%% PRUNED!!! " ^ CicPp.ppterm expr) ;
                ) dom
             ) resolve_ids
           in
-           let index = C.interactive_interpretation_choice choices in
-            List.nth resolve_ids index
+           let indexes = C.interactive_interpretation_choice choices in
+            List.map (List.nth resolve_ids) indexes
       in
-       (known_ids @ dom', resolve_id'), metasenv',term
+       List.map
+        (fun (resolve_id',term,metasenv') ->
+          (known_ids @ dom', resolve_id'), metasenv',term
+        ) res
 end
 ;;