X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcic_acic%2Fcic2acic.ml;h=98b14298274542288534df848c3bedf4303fa78d;hb=ac1f50b898154dc3d74aa8fa2fff212a7d3a235c;hp=6cb2ad9a21fbbf4afaa16c3704c97a979daecf47;hpb=abd2098b6c4a40b36bb4b950c607eb4b4a7852bc;p=helm.git diff --git a/helm/software/components/cic_acic/cic2acic.ml b/helm/software/components/cic_acic/cic2acic.ml index 6cb2ad9a2..98b142982 100644 --- a/helm/software/components/cic_acic/cic2acic.ml +++ b/helm/software/components/cic_acic/cic2acic.ml @@ -301,12 +301,19 @@ let acic_of_cic_context' ~computeinnertypes:global_computeinnertypes (fresh_id'',n, aux' context idrefs s, aux' ((Some (n, C.Decl s)::context)) (fresh_id''::idrefs) t) | C.LetIn (n,s,t) -> - xxx_add ids_to_inner_sorts fresh_id'' innersort ; - if innersort = `Prop then - add_inner_type fresh_id'' ; - C.ALetIn - (fresh_id'', n, aux' context idrefs s, - aux' ((Some (n, C.Def(s,None)))::context) (fresh_id''::idrefs) t) + let s_ty = + try + (cic_CicHash_find terms_to_types s).D.synthesized + with + Not_found -> + cicReduction_whd context (xxx_type_of_aux' metasenv context s); + in + xxx_add ids_to_inner_sorts fresh_id'' innersort ; + if innersort = `Prop then + add_inner_type fresh_id'' ; + C.ALetIn + (fresh_id'', n, aux' context idrefs s, + aux' ((Some (n, C.Def(s,Some s_ty)))::context) (fresh_id''::idrefs) t) | C.Appl l -> xxx_add ids_to_inner_sorts fresh_id'' innersort ; if innersort = `Prop then @@ -346,8 +353,12 @@ let acic_of_cic_context' ~computeinnertypes:global_computeinnertypes let fresh_idrefs = List.map (function _ -> gen_id seed) funs in let new_idrefs = List.rev fresh_idrefs @ idrefs in - let tys = - List.map (fun (name,_,ty,_) -> Some (C.Name name, C.Decl ty)) funs + let tys,_ = + List.fold_left + (fun (types,len) (n,_,ty,_) -> + (Some (C.Name n,(C.Decl (CicSubstitution.lift len ty)))::types, + len+1) + ) ([],0) funs in xxx_add ids_to_inner_sorts fresh_id'' innersort ; if innersort = `Prop then @@ -363,8 +374,12 @@ let acic_of_cic_context' ~computeinnertypes:global_computeinnertypes let fresh_idrefs = List.map (function _ -> gen_id seed) funs in let new_idrefs = List.rev fresh_idrefs @ idrefs in - let tys = - List.map (fun (name,ty,_) -> Some (C.Name name, C.Decl ty)) funs + let tys,_ = + List.fold_left + (fun (types,len) (n,ty,_) -> + (Some (C.Name n,(C.Decl (CicSubstitution.lift len ty)))::types, + len+1) + ) ([],0) funs in xxx_add ids_to_inner_sorts fresh_id'' innersort ; if innersort = `Prop then @@ -556,8 +571,8 @@ let acic_object_of_cic_object ?(eta_fix=false) obj = = aconjecture_of_conjecture' conjectures conjecture in (cid,i,acanonical_context,aterm)) conjectures' in -(* let time1 = Sys.time () in *) - let bo' = (*eta_fix conjectures' []*) bo in + (* let bo' = eta_fix conjectures' [] bo in *) + let bo' = bo in let ty' = eta_fix conjectures' [] ty in (* let time2 = Sys.time () in @@ -680,9 +695,12 @@ let plain_acic_term_of_cic_term = C.AMutCase (fresh_id, uri, tyno, aux context outty, aux context term, List.map (aux context) patterns) | C.Fix (funno, funs) -> - let tys = - List.map - (fun (name,_,ty,_) -> mk_fresh_id (), Some (C.Name name, C.Decl ty)) funs + let tys,_ = + List.fold_left + (fun (types,len) (n,_,ty,_) -> + (mk_fresh_id (),(Some (C.Name n,(C.Decl (CicSubstitution.lift len ty)))))::types, + len+1 + ) ([],0) funs in C.AFix (fresh_id, funno, List.map2 @@ -691,9 +709,12 @@ let plain_acic_term_of_cic_term = ) tys funs ) | C.CoFix (funno, funs) -> - let tys = - List.map (fun (name,ty,_) -> - mk_fresh_id (),Some (C.Name name, C.Decl ty)) funs + let tys,_ = + List.fold_left + (fun (types,len) (n,ty,_) -> + (mk_fresh_id (),(Some (C.Name n,(C.Decl (CicSubstitution.lift len ty)))))::types, + len+1 + ) ([],0) funs in C.ACoFix (fresh_id, funno, List.map2