List.nth ind_type_list typeno in
let i_constr_id,_ =
List.nth constructor_list (consno - 1) in
+ let seed = ref 0 in
let patterns =
List.map
(function (id,cty) ->
let binder' =
match binder with
C.Name b -> C.Name b
- | C.Anonymous -> C.Name "y"
+ | C.Anonymous ->
+ C.Name
+ (incr seed; "y" ^ string_of_int !seed)
in
C.Lambda (binder',source,(aux target (k+1)))
| _ ->
+if id = i_constr_id then (
+prerr_endline ("k= " ^ string_of_int k);
+prerr_endline ("paramsno= " ^ string_of_int paramsno);
+prerr_endline ("nr_param_constr " ^ string_of_int (k - 1 - paramsno));
+prerr_endline ("rel= " ^ string_of_int (k - i));
+);
let nr_param_constr = k - 1 - paramsno in
if id = i_constr_id
- then C.Rel (nr_param_constr - liftno)
+ then C.Rel (k - i)
else S.lift (nr_param_constr + 1) t1' (* + 1 per liftare anche il lambda aggiunto esternamente al case *)
in aux reduced_cty 1
) constructor_list in
(turi,typeno,outtype,C.Rel 1,patterns)) ;
t1]
in
+prerr_endline ("i=" ^ string_of_int i ^ "; liftno=" ^ string_of_int liftno);
prerr_endline ("XXX: " ^ CicPp.ppterm xxx);
prerr_endline ("WITH: " ^ CicPp.ppterm new_t1');
xxx,