]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_proof_checking/cicCooking.ml
Initial revision
[helm.git] / helm / ocaml / cic_proof_checking / cicCooking.ml
index 109c1582fa45afe2640a48b1dddd73ae27c0ead8..2c5d0b439ffbaebea810e836fe772828d5c88dba 100644 (file)
@@ -80,7 +80,6 @@ let cook curi cookingsno var is_letin =
           [C.Rel k])
        else
         C.Const (uri,UriManager.relative_depth curi uri cookingsno)
-    | C.Abst _ as t -> t
     | C.MutInd (uri,_,i) ->
        if not is_letin && match CicEnvironment.get_obj uri with
            C.InductiveDefinition (_,params,_) when mem var params -> true
@@ -197,7 +196,18 @@ let cook_one_level obj curi cookingsno vars =
            (name,inductive,cook_prod curi cookingsno arity vars,constructors')
         ) dl
       in
-       C.InductiveDefinition (dl', params, n_ind_params + List.length vars)
+       let number_of_variables_without_a_body =
+        let is_not_letin uri =
+         match CicEnvironment.get_obj uri with
+            C.Variable (_,None,_) -> true
+          | C.Variable (_,Some _,_) -> false
+          | _ -> raise (WrongUriToVariable (UriManager.string_of_uri uri))
+        in
+         List.fold_left
+          (fun i uri -> if is_not_letin uri then i + 1 else i) 0 vars
+       in
+        C.InductiveDefinition
+         (dl', params, n_ind_params + number_of_variables_without_a_body)
 ;; 
 
 let cook_obj obj uri =