List.fold_right (fun x i -> i && does_not_occur context n nn x) tl true
| C.Appl ((C.MutConstruct (uri,i,j,exp_named_subst))::tl) ->
let consty =
- match CicEnvironment.get_cooked_obj ~trust:false uri with
+ let obj =
+ try
+ CicEnvironment.get_cooked_obj ~trust:false uri
+ with Not_found -> assert false
+ in
+ match obj with
C.InductiveDefinition (itl,_,_) ->
let (_,_,_,cl) = List.nth itl i in
let (_,cons) = List.nth cl (j - 1) in
(TypeCheckerFailure ("Case analasys: sort elimination not allowed"));
(* let's check if the type of branches are right *)
let parsno =
- match CicEnvironment.get_cooked_obj ~trust:false uri with
+ let obj =
+ try
+ CicEnvironment.get_cooked_obj ~trust:false uri
+ with Not_found -> assert false
+ in
+ match obj with
C.InductiveDefinition (_,_,parsno) -> parsno
| _ ->
raise (TypeCheckerFailure
match CicReduction.whd context ty with
C.MutInd (uri,i,_) ->
(*CSC: definire una funzioncina per questo codice sempre replicato *)
- (match CicEnvironment.get_cooked_obj ~trust:false uri with
+ let obj =
+ try
+ CicEnvironment.get_cooked_obj ~trust:false uri
+ with Not_found -> assert false
+ in
+ (match obj with
C.InductiveDefinition (itl,_,_) ->
let (_,is_inductive,_,_) = List.nth itl i in
if is_inductive then None else (Some uri)