]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_omdoc/eta_fixing.ml
split into two major parts:
[helm.git] / helm / ocaml / cic_omdoc / eta_fixing.ml
index c379110145b522a87d441d5f322f9cf69c7d7d21..24242b42675f34f4f4cdefaca68cdaa1a2f4a5d4 100644 (file)
@@ -192,7 +192,7 @@ let eta_fix metasenv t =
        in
        C.Meta (n,l')
    | C.Sort s -> C.Sort s
-   | C.Implicit -> C.Implicit
+   | C.Implicit _ as t -> t
    | C.Cast (v,t) -> C.Cast (eta_fix' context v, eta_fix' context t)
    | C.Prod (n,s,t) -> 
        C.Prod 
@@ -270,7 +270,15 @@ let eta_fix metasenv t =
            in
             (match term_type with
                C.Appl (hd::params) -> 
-                 List.map (fun (_,t) -> clean_up t params) constructors
+                 let rec first_n n l =
+                   if n = 0 then []
+                   else 
+                     (match l with
+                        a::tl -> a::(first_n (n-1) tl)
+                     | _ -> assert false) in 
+                 List.map 
+                  (fun (_,t) -> 
+                     clean_up t (first_n noparams params)) constructors
              | _ -> prerr_endline ("QUA"); assert false) in 
        let patterns2 = 
          List.map2 fix_lambdas_wrt_type