]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_disambiguation/disambiguate.ml
snapshot
[helm.git] / helm / ocaml / cic_disambiguation / disambiguate.ml
index dd915a2829c0831961b860dbc76e02b7805cce8d..6848338c3bf06b5c09659bacf069df8deb1385ed 100644 (file)
@@ -561,7 +561,12 @@ let domain_of_obj ~context ast =
            List.flatten (
             List.rev_map
              (fun (_,ty) -> domain_rev_of_term [] ty) cl) @
-            domain_rev_of_term [] ty) tyl)
+            domain_rev_of_term [] ty) tyl) in
+      let dom = 
+       List.fold_left
+        (fun dom (_,ty) ->
+          domain_rev_of_term [] ty @ dom
+        ) dom params
       in
        List.filter
         (fun name ->
@@ -572,14 +577,17 @@ let domain_of_obj ~context ast =
       let dom =
        List.flatten
         (List.rev_map (fun (_,ty) -> domain_rev_of_term [] ty) fields) in
-      let dom' =
+      let dom =
        List.filter
         (fun name->
           not (  List.exists (fun (name',_) -> name = Id name') params
               || List.exists (fun (name',_) -> name = Id name') fields)
         ) dom
       in
-       dom' @ domain_rev_of_term [] ty
+       List.fold_left
+        (fun dom (_,ty) ->
+          domain_rev_of_term [] ty @ dom
+        ) (dom @ domain_rev_of_term [] ty) params
  in
   rev_uniq domain_rev