let sx_context_ty_rev,_ = HExtlib.split_nth leftno (List.rev context) in
List.iter
(fun (k_relev,_,te) ->
- let _,k_relev = HExtlib.split_nth leftno k_relev in
+ let k_relev =
+ try snd (HExtlib.split_nth leftno k_relev)
+ with Failure _ -> k_relev in
let te = debruijn uri len [] te in
let context,te = NCicReduction.split_prods ~subst tys leftno te in
let _,chopped_context_rev =
let metasenv,subst,cl =
List.fold_right
(fun (k_relev,n,te) (metasenv,subst,res) ->
- let _,k_relev = HExtlib.split_nth leftno k_relev in
+ let k_relev =
+ try snd (HExtlib.split_nth leftno k_relev)
+ with Failure _ -> k_relev in
let te = NCicTypeChecker.debruijn uri len [] te in
let context,te = NCicReduction.split_prods ~subst tys leftno te in
let _,chopped_context_rev =