(uri,exp_named_subst,typeno,args)
| _ -> raise NotAnInductiveTypeToEliminate
in
- let paramsno,patterns =
+ let paramsno,itty,patterns =
match CicEnvironment.get_obj CicUniv.empty_ugraph uri with
C.InductiveDefinition (tys,_,paramsno,_),_ ->
- let _,_,_,cl = List.nth tys typeno in
+ let _,_,itty,cl = List.nth tys typeno in
let rec aux n context t =
match n,CicReduction.whd context t with
0,C.Prod (name,source,target) ->
| 0,_ -> C.Implicit None
| _,_ -> assert false
in
- paramsno,
+ paramsno,itty,
List.map (function (_,cty) -> aux paramsno context cty) cl
| _ -> assert false
in
0 -> target
| n -> C.Lambda (C.Name "fixme",C.Implicit None,add_lambdas (n-1))
in
- add_lambdas paramsno
+ add_lambdas (count_prods context itty - paramsno)
in
let term_to_refine =
C.MutCase (uri,typeno,outtype,term,patterns)