]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCicUtils.ml
Serious bug fixed: the max of two universes was computed using the polymorphic
[helm.git] / helm / software / components / ng_kernel / nCicUtils.ml
index b2312d101a79c47e8d0ae252bc11632ccfc6a5cf..3d3c2d90e243f145f8c887a1676d90ec342f6197 100644 (file)
@@ -50,18 +50,6 @@ let fold g k f acc = function
  | NCic.Match (_,oty,t,pl) -> List.fold_left (f k) (f k (f k acc oty) t) pl
 ;;
 
-let sharing_map f l =
-  let unchanged = ref true in
-  let rec aux b = function
-    | [] as t -> unchanged := b; t
-    | he::tl ->
-        let he1 = f he in
-        he1 :: aux (b && he1 == he) tl
-  in
-  let l1 = aux true l in
-  if !unchanged then l else l1
-;;
-        
 let map g k f = function
  | NCic.Meta _ -> assert false
  | NCic.Implicit _
@@ -70,7 +58,7 @@ let map g k f = function
  | NCic.Rel _ as t -> t
  | NCic.Appl [] | NCic.Appl [_] -> assert false
  | NCic.Appl l as orig ->
-    (match sharing_map (f k) l with
+    (match HExtlib.sharing_map (f k) l with
       | NCic.Appl l :: tl -> NCic.Appl (l@tl)
       | l1 when l == l1 -> orig
       | l1 -> NCic.Appl l1)
@@ -85,7 +73,7 @@ let map g k f = function
      let b1 = f (g (n,NCic.Def (t,ty)) k) b in
      if ty1 == ty && t1 == t && b1 == b then orig else NCic.LetIn (n,ty1,t1,b1)
  | NCic.Match (r,oty,t,pl) as orig -> 
-     let oty1 = f k oty in let t1 = f k t in let pl1 = sharing_map (f k) pl in
+     let oty1 = f k oty in let t1 = f k t in let pl1 = HExtlib.sharing_map (f k) pl in
      if oty1 == oty && t1 == t && pl1 == pl then orig 
      else NCic.Match(r,oty1,t1,pl1)
 ;;