X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_proof_checking%2FcicTypeChecker.ml;h=35015e541202d36fe82a245ddd167e7322fc2c1c;hb=67dd51c6c9ceb0186490033d77769d49404964ac;hp=a5e745af3592ac08dd47fb3f6dc59ebba80ceb1f;hpb=7fa28badba2091f1e3d207f13743a1f68d6bf1f3;p=helm.git diff --git a/helm/software/components/cic_proof_checking/cicTypeChecker.ml b/helm/software/components/cic_proof_checking/cicTypeChecker.ml index a5e745af3..35015e541 100644 --- a/helm/software/components/cic_proof_checking/cicTypeChecker.ml +++ b/helm/software/components/cic_proof_checking/cicTypeChecker.ml @@ -838,7 +838,9 @@ and guarded_by_destructors = let module C = Cic in let module U = UriManager in - match CicReduction.whd ~subst context t with + let t = CicReduction.whd ~delta:false ~subst context t in + let res = + match t with C.Rel m when m > n && m <= nn -> false | C.Rel m -> (match List.nth context (m-1) with @@ -995,6 +997,14 @@ and guarded_by_destructors List.fold_right (fun t i -> i && guarded_by_destructors rec_uri rec_uri_len ~logger ~metasenv ~subst context n nn kl x safes t) tl true + in + if res then res + else + let t' = CicReduction.whd ~subst context t in + if t = t' then + false + else + guarded_by_destructors rec_uri rec_uri_len ~logger ~metasenv ~subst context n nn kl x safes t' (* the boolean h means already protected *) (* args is the list of arguments the type of the constructor that may be *)