X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_kernel%2FnCic2OCic.ml;h=5f8279d7e67cb3660652e392b882a49cc4fa63a7;hb=b91d9e60b0a5f450d2725d4b9bb3ed7f81ef6d3a;hp=d78d5f3fe33c663d3f6504ec6d04deb34f0bcfa8;hpb=345f329e767d0b4a1a87d10e08f92657a95c10ac;p=helm.git diff --git a/helm/software/components/ng_kernel/nCic2OCic.ml b/helm/software/components/ng_kernel/nCic2OCic.ml index d78d5f3fe..5f8279d7e 100644 --- a/helm/software/components/ng_kernel/nCic2OCic.ml +++ b/helm/software/components/ng_kernel/nCic2OCic.ml @@ -15,6 +15,8 @@ let ouri_of_nuri u = UriManager.uri_of_string (NUri.string_of_uri u);; let ouri_of_reference (NReference.Ref (u,_)) = ouri_of_nuri u;; +let cprop = [false, NUri.uri_of_string ("cic:/matita/pts/CProp.univ")];; + let nn_2_on = function | "_" -> Cic.Anonymous | s -> Cic.Name s @@ -32,17 +34,20 @@ let convert_term uri n_fl t = | NCic.LetIn (n,ty_s,s,t) -> Cic.LetIn (nn_2_on n,convert_term k s,convert_term k ty_s, convert_term (k+1) t) | NCic.Sort NCic.Prop -> Cic.Sort Cic.Prop - | NCic.Sort NCic.CProp -> Cic.Sort Cic.CProp + | NCic.Sort (NCic.Type u) when + (* BUG HERE: I should use NCicEnvironment.universe_eq, but I do not + want to add this recursion between the modules *) + (*NCicEnvironment.universe_eq*) u=cprop -> Cic.Sort (Cic.CProp (CicUniv.fresh ())) | NCic.Sort (NCic.Type _) -> Cic.Sort (Cic.Type (CicUniv.fresh ())) | NCic.Implicit _ -> assert false - | NCic.Const (NReference.Ref (u,NReference.Ind (_,i))) -> + | NCic.Const (NReference.Ref (u,NReference.Ind (_,i,_))) -> Cic.MutInd (ouri_of_nuri u,i,[]) - | NCic.Const (NReference.Ref (u,NReference.Con (i,j))) -> + | NCic.Const (NReference.Ref (u,NReference.Con (i,j,_))) -> Cic.MutConstruct (ouri_of_nuri u,i,j,[]) | NCic.Const (NReference.Ref (u,NReference.Def _)) | NCic.Const (NReference.Ref (u,NReference.Decl)) -> Cic.Const (ouri_of_nuri u,[]) - | NCic.Match (NReference.Ref (u,NReference.Ind (_,i)),oty,t,pl) -> + | NCic.Match (NReference.Ref (u,NReference.Ind (_,i,_)),oty,t,pl) -> Cic.MutCase (ouri_of_nuri u,i, convert_term k oty, convert_term k t, List.map (convert_term k) pl) | NCic.Const (NReference.Ref (u,NReference.Fix (i,_,_))) @@ -100,5 +105,13 @@ let convert_nobj = function convert_term u 0 (let _,_,_,ty,_ = List.hd fl in ty), [], [])) (let rec seq = function 0 -> [0]|n -> n::seq (n-1) in seq (List.length fl-1)) - | _,_,_,_,NCic.Inductive _ -> assert false + | u,_,_,_,NCic.Inductive (inductive,leftno,itl,_) -> + let itl = + List.map + (function (_,name,ty,cl) -> + let cl=List.map (function (_,name,ty) -> name,convert_term u 0 ty) cl in + name,inductive,convert_term u 0 ty,cl + ) itl + in + [ouri_of_nuri u, Cic.InductiveDefinition (itl,[],leftno,[])] ;;