From: Enrico Tassi Date: Thu, 29 Jul 2010 15:09:38 +0000 (+0000) Subject: interpret non ambiguous symbols ASAP X-Git-Tag: make_still_working~2856 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=7c793c80721ff0b0a1d2898ba93721aa03aa4a98;p=helm.git interpret non ambiguous symbols ASAP --- diff --git a/helm/software/components/disambiguation/disambiguate.ml b/helm/software/components/disambiguation/disambiguate.ml index 5ac709f9b..d0d7460a6 100644 --- a/helm/software/components/disambiguation/disambiguate.ml +++ b/helm/software/components/disambiguation/disambiguate.ml @@ -447,6 +447,21 @@ let disambiguate_thing fix_instance item (Environment.find item e) with Not_found -> []) in + + (* items with 1 choice are interpreted ASAP *) + let aliases, todo_dom = + let rec aux (aliases,acc) = function + | [] -> aliases, acc + | (Node (_, item,extra) as node) :: tl -> + let tl = tl @ extra in + let choices = lookup_choices item in + if List.length choices <> 1 then aux (aliases, acc@[node]) tl + else if Environment.mem item aliases then aux (aliases, acc) tl + else aux (Environment.add item (List.hd choices) aliases, acc) tl + in + aux (aliases,[]) todo_dom + in + (* (* *) let _ =