| C.Cast (te,ty) -> is_closed k te && is_closed k ty
| C.Prod (name,so,dest) -> is_closed k so && is_closed (k+1) dest
| C.Lambda (_,so,dest) -> is_closed k so && is_closed (k+1) dest
- | C.LetIn (_,so,dest) -> is_closed k so && is_closed (k+1) dest
+ | C.LetIn (_,so,ty,dest) ->
+ is_closed k so && is_closed k ty && is_closed (k+1) dest
| C.Appl l ->
List.fold_right (fun x i -> i && is_closed k x) l true
| C.Var (_,exp_named_subst)
| C.Cast (te,ty) -> is_meta_closed te && is_meta_closed ty
| C.Prod (name,so,dest) -> is_meta_closed so && is_meta_closed dest
| C.Lambda (_,so,dest) -> is_meta_closed so && is_meta_closed dest
- | C.LetIn (_,so,dest) -> is_meta_closed so && is_meta_closed dest
+ | C.LetIn (_,so,ty,dest) ->
+ is_meta_closed so &&
+ is_meta_closed ty &&
+ is_meta_closed dest
| C.Appl l ->
not (List.exists (fun x -> not (is_meta_closed x)) l)
| C.Var (_,exp_named_subst)
| C.ACast (id,_,_)
| C.AProd (id,_,_,_)
| C.ALambda (id,_,_,_)
- | C.ALetIn (id,_,_,_)
+ | C.ALetIn (id,_,_,_,_)
| C.AAppl (id,_)
| C.AConst (id,_,_)
| C.AMutInd (id,_,_,_)
| C.Cast (te,ty) -> C.Cast (rehash_term te, rehash_term ty)
| C.Prod (n,s,t) -> C.Prod (n, rehash_term s, rehash_term t)
| C.Lambda (n,s,t) -> C.Lambda (n, rehash_term s, rehash_term t)
- | C.LetIn (n,s,t) -> C.LetIn (n, rehash_term s, rehash_term t)
+ | C.LetIn (n,s,ty,t) ->
+ C.LetIn (n, rehash_term s, rehash_term ty, rehash_term t)
| C.Appl l -> C.Appl (List.map rehash_term l)
| C.Const (uri,exp_named_subst) ->
let uri' = recons uri in
| Some (name,C.Decl t) ->
Some (name,C.Decl (rehash_term t))
| Some (name,C.Def (bo,ty)) ->
- let ty' =
- match ty with
- None -> None
- | Some ty'' -> Some (rehash_term ty'')
- in
- Some (name,C.Def (rehash_term bo, ty'))) hyps,
+ Some (name,C.Def (rehash_term bo, rehash_term ty))) hyps,
rehash_term ty))
conjs
in
List.flatten (List.map (fun (u, t) -> metas_of_term t) ens)
| C.Cast (s, t)
| C.Prod (_, s, t)
- | C.Lambda (_, s, t)
- | C.LetIn (_, s, t) -> (metas_of_term s) @ (metas_of_term t)
+ | C.Lambda (_, s, t) -> (metas_of_term s) @ (metas_of_term t)
+ | C.LetIn (_, s, ty, t) ->
+ (metas_of_term s) @ (metas_of_term ty) @ (metas_of_term t)
| C.Appl l -> List.flatten (List.map metas_of_term l)
| C.MutCase (uri, i, s, t, l) ->
(metas_of_term s) @ (metas_of_term t) @
S.empty ens
| C.Cast (s, t)
| C.Prod (_, s, t)
- | C.Lambda (_, s, t)
- | C.LetIn (_, s, t) -> S.union (metas_of_term_set s) (metas_of_term_set t)
+ | C.Lambda (_, s, t) -> S.union (metas_of_term_set s) (metas_of_term_set t)
+ | C.LetIn (_, s, ty, t) ->
+ S.union (metas_of_term_set s)
+ (S.union (metas_of_term_set ty) (metas_of_term_set t))
| C.Appl l ->
List.fold_left
(fun s t -> S.union s (metas_of_term_set t))
aux s s' && aux t t'
| C.Lambda (_,s,t), C.Lambda (_,s',t') ->
aux s s' && aux t t'
- | C.LetIn (_,s,t), C.LetIn(_,s',t') ->
- aux s s' && aux t t'
+ | C.LetIn (_,s,ty,t), C.LetIn(_,s',ty',t') ->
+ aux s s' && aux ty ty' && aux t t'
| C.Appl l, C.Appl l' when List.length l = List.length l' ->
(try
List.fold_left2
| C.MutConstruct (_, _, _, xnss)
| C.MutInd (_, _, xnss) -> sober_xnss g xnss
| C.Meta (_, xss) -> sober_xss g xss
- | C.LetIn (_, v, t)
| C.Lambda (_, v, t)
| C.Prod (_, v, t)
| C.Cast (t, v) -> sober_term (sober_term g t) v
+ | C.LetIn (_, v, ty, t) -> sober_term
+ (sober_term (sober_term g t) ty) v
| C.Appl []
| C.Appl [_] -> fun b -> false
| C.Appl ts -> sober_terms g ts