- if innersort = "Prop" then
- add_inner_type fresh_id'' ;
- C.AFix (fresh_id'', funno,
- List.map
- (fun (name, indidx, ty, bo) ->
- (name, indidx, aux' bs ty, aux' (names@bs) bo)
- ) funs
- )
- | C.CoFix (funno, funs) ->
- let names = List.map (fun (name,ty,_) -> C.Name name,ty) funs in
- Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
- if innersort = "Prop" then
- add_inner_type fresh_id'' ;
- C.ACoFix (fresh_id'', funno,
- List.map
- (fun (name, ty, bo) ->
- (name, aux' bs ty, aux' (names@bs) bo)
- ) funs
- )
- in
- aux true None env t
+ C.ALetIn
+ (fresh_id'', n, aux' context s,
+ aux' ((Some (n, C.Def s))::context) t)
+ | C.Appl l ->
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ if innersort = "Prop" then
+ add_inner_type fresh_id'' ;
+ C.AAppl (fresh_id'', List.map (aux' context) l)
+ | C.Const (uri,cn) ->
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ C.AConst (fresh_id'', uri, cn)
+ | C.MutInd (uri,cn,tyno) -> C.AMutInd (fresh_id'', uri, cn, tyno)
+ | C.MutConstruct (uri,cn,tyno,consno) ->
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ C.AMutConstruct (fresh_id'', uri, cn, tyno, consno)
+ | C.MutCase (uri, cn, tyno, outty, term, patterns) ->
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ if innersort = "Prop" then
+ add_inner_type fresh_id'' ;
+ C.AMutCase (fresh_id'', uri, cn, tyno, aux' context outty,
+ aux' context term, List.map (aux' context) patterns)
+ | C.Fix (funno, funs) ->
+ let tys =
+ List.map (fun (name,_,ty,_) -> Some (C.Name name, C.Decl ty)) funs
+ in
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ if innersort = "Prop" then
+ add_inner_type fresh_id'' ;
+ C.AFix (fresh_id'', funno,
+ List.map
+ (fun (name, indidx, ty, bo) ->
+ (name, indidx, aux' context ty, aux' (tys@context) bo)
+ ) funs
+ )
+ | C.CoFix (funno, funs) ->
+ let tys =
+ List.map (fun (name,ty,_) -> Some (C.Name name, C.Decl ty)) funs
+ in
+ Hashtbl.add ids_to_inner_sorts fresh_id'' innersort ;
+ if innersort = "Prop" then
+ add_inner_type fresh_id'' ;
+ C.ACoFix (fresh_id'', funno,
+ List.map
+ (fun (name, ty, bo) ->
+ (name, aux' context ty, aux' (tys@context) bo)
+ ) funs
+ )
+ in
+ aux true None context t