X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Fcomponents%2Fng_kernel%2FoCic2NCic.ml;h=5b4d9f9e1222378768044194fd159b99f2902547;hb=805758c883a9bd9320942b310af8786ddb7f01b8;hp=b1b08ee3c7821db86fd7186e588c04467f7cf62f;hpb=83a4859b0a6fec3953dae70cd6177eecd850d012;p=helm.git diff --git a/helm/software/components/ng_kernel/oCic2NCic.ml b/helm/software/components/ng_kernel/oCic2NCic.ml index b1b08ee3c..5b4d9f9e1 100644 --- a/helm/software/components/ng_kernel/oCic2NCic.ml +++ b/helm/software/components/ng_kernel/oCic2NCic.ml @@ -215,10 +215,10 @@ let convert_term uri t = in let bctx, fixpoints_tys, tys, _ = List.fold_right - (fun (name,ty,_) (ctx, fixpoints, tys, idx) -> + (fun (name,ty,_) (bctx, fixpoints, tys, idx) -> let ty, fixpoints_ty = aux octx ctx n_fix uri ty in let r = Ref.reference_of_ouri buri(Ref.CoFix idx) in - Fix (r,name,ty) :: ctx, fixpoints_ty @ fixpoints,ty::tys,idx+1) + Fix (r,name,ty) :: bctx, fixpoints_ty @ fixpoints,ty::tys,idx+1) fl ([], [], [], 0) in let bctx = bctx @ ctx in @@ -357,6 +357,11 @@ let convert_term uri t = | Cic.MutConstruct (curi, tyno, consno, ens) -> aux_ens curi octx ctx n_fix uri ens (NCic.Const (Ref.reference_of_ouri curi (Ref.Con (tyno,consno)))) + | Cic.Var (curi, ens) -> + (match fst (CicEnvironment.get_obj CicUniv.oblivion_ugraph curi) with + Cic.Variable (_,Some bo,_,_,_) -> + aux octx ctx n_fix uri (CicSubstitution.subst_vars ens bo) + | _ -> assert false) | Cic.MutCase (curi, tyno, outty, t, branches) -> let r = Ref.reference_of_ouri curi (Ref.Ind tyno) in let outty, fixpoints_outty = aux octx ctx n_fix uri outty in @@ -369,7 +374,7 @@ let convert_term uri t = branches ([],[]) in NCic.Match (r,outty,t,branches), fixpoints_outty@fixpoints_t@fixpoints - | Cic.Implicit _ | Cic.Meta _ | Cic.Var _ -> assert false + | Cic.Implicit _ | Cic.Meta _ -> assert false and aux_ens curi octx ctx n_fix uri ens he = match ens with [] -> he,[] @@ -384,9 +389,13 @@ let convert_term uri t = let ens,objs = List.fold_right (fun luri (l,objs) -> - let t = List.assoc luri ens in - let t,o = aux octx ctx n_fix uri t in - t::l, o@objs + match fst (CicEnvironment.get_obj CicUniv.oblivion_ugraph luri) with + Cic.Variable (_,Some _,_,_,_) -> l, objs + | Cic.Variable (_,None,_,_,_) -> + let t = List.assoc luri ens in + let t,o = aux octx ctx n_fix uri t in + t::l, o@objs + | _ -> assert false ) params ([],[]) in NCic.Appl (he::ens),objs