]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/cic_disambiguation/disambiguate.ml
New declarative commands (ast, pretty-printing and parsing only):
[helm.git] / helm / software / components / cic_disambiguation / disambiguate.ml
index 85f05aa1c8700048224840ed34f262f21e0e29f8..cb4d85cfd245fafb088410a89b092dd4b8375972 100644 (file)
@@ -710,9 +710,15 @@ let domain_of_obj ~context ast =
   (* dom1 \ dom2 *)
 let domain_diff dom1 dom2 =
 (* let domain_diff = Domain.diff *)
-  let is_in_dom2 =
-    List.fold_left (fun pred elt -> (fun elt' -> elt' = elt || pred elt'))
-      (fun _ -> false) dom2
+  let is_in_dom2 elt =
+    List.exists
+     (function
+       | Symbol (symb, 0) ->
+          (match elt with
+              Symbol (symb',_) when symb = symb' -> true
+            | _ -> false)
+       | item -> elt = item
+     ) dom2
   in
   List.filter (fun (_,elt) -> not (is_in_dom2 elt)) dom1
 
@@ -833,7 +839,7 @@ let refine_profiler = HExtlib.profile "disambiguate_thing.refine_thing"
                     | item -> item
                   in
                   Environment.find item e
-                with Not_found -> [])
+                with Not_found -> lookup_in_library ())
           in
           choices
       in