-nCicEnvironment.cmi: nUri.cmi nCic.cmo
+nCicEnvironment.cmi: nUri.cmi nReference.cmi nCic.cmo
nCicTypeChecker.cmi: nCic.cmo
nReference.cmi: nUri.cmi
oCic2NCic.cmi: nCic.cmo
nCicSubstitution.cmi: nCic.cmo
nCicUtils.cmi: nCic.cmo
+nCic2OCic.cmi: nCic.cmo
nCic.cmo: nUri.cmi nReference.cmi
nCic.cmx: nUri.cmx nReference.cmx
-nCicEnvironment.cmo: oCic2NCic.cmi nUri.cmi nCicEnvironment.cmi
-nCicEnvironment.cmx: oCic2NCic.cmx nUri.cmx nCicEnvironment.cmi
+nCicEnvironment.cmo: oCic2NCic.cmi nUri.cmi nReference.cmi nCic.cmo \
+ nCicEnvironment.cmi
+nCicEnvironment.cmx: oCic2NCic.cmx nUri.cmx nReference.cmx nCic.cmx \
+ nCicEnvironment.cmi
nCicTypeChecker.cmo: nCicTypeChecker.cmi
nCicTypeChecker.cmx: nCicTypeChecker.cmi
nReference.cmo: nUri.cmi nReference.cmi
nReference.cmx: nUri.cmx nReference.cmi
oCicTypeChecker.cmo: oCic2NCic.cmi nCicTypeChecker.cmi oCicTypeChecker.cmi
oCicTypeChecker.cmx: oCic2NCic.cmx nCicTypeChecker.cmx oCicTypeChecker.cmi
-oCic2NCic.cmo: nUri.cmi nCic.cmo oCic2NCic.cmi
-oCic2NCic.cmx: nUri.cmx nCic.cmx oCic2NCic.cmi
+oCic2NCic.cmo: nUri.cmi nReference.cmi nCic.cmo oCic2NCic.cmi
+oCic2NCic.cmx: nUri.cmx nReference.cmx nCic.cmx oCic2NCic.cmi
nUri.cmo: nUri.cmi
nUri.cmx: nUri.cmi
nCicSubstitution.cmo: nCicUtils.cmi nCic.cmo nCicSubstitution.cmi
nCicSubstitution.cmx: nCicUtils.cmx nCic.cmx nCicSubstitution.cmi
nCicUtils.cmo: nCic.cmo nCicUtils.cmi
nCicUtils.cmx: nCic.cmx nCicUtils.cmi
-nCicReduction.cmo: nReference.cmi nCicSubstitution.cmi nCicEnvironment.cmi \
- nCic.cmo nCicReduction.cmi
-nCicReduction.cmx: nReference.cmx nCicSubstitution.cmx nCicEnvironment.cmx \
- nCic.cmx nCicReduction.cmi
+nCicReduction.cmo: nReference.cmi nCicUtils.cmi nCicSubstitution.cmi \
+ nCicEnvironment.cmi nCic.cmo nCicReduction.cmi
+nCicReduction.cmx: nReference.cmx nCicUtils.cmx nCicSubstitution.cmx \
+ nCicEnvironment.cmx nCic.cmx nCicReduction.cmi
+nCic2OCic.cmo: nUri.cmi nReference.cmi nCic.cmo nCic2OCic.cmi
+nCic2OCic.cmx: nUri.cmx nReference.cmx nCic.cmx nCic2OCic.cmi
--- /dev/null
+
+let rec convert_term k = function (* pass k along *)
+ | NCic.Rel i -> Cic.Rel i
+ | NCic.Meta _ -> assert false
+ | NCic.Appl l -> Cic.Appl (List.map (convert_term k) l)
+ | NCic.Prod (n,s,t) -> Cic.Prod (Cic.Name n,convert_term k s, convert_term k t)
+ | NCic.Lambda (n,s,t) -> Cic.Lambda(Cic.Name n,convert_term k s, convert_term k t)
+ | NCic.LetIn (n,_,s,t) -> Cic.LetIn (Cic.Name n,convert_term k s, convert_term k t)
+ | NCic.Sort NCic.Prop -> Cic.Sort Cic.Prop
+ | NCic.Sort NCic.CProp -> Cic.Sort Cic.CProp
+ | NCic.Sort NCic.Set -> Cic.Sort Cic.Set
+ | NCic.Sort (NCic.Type _) -> Cic.Sort (Cic.Type (CicUniv.fresh ()))
+ | NCic.Implicit _ -> assert false
+ | NCic.Const (NReference.Ref (_,u,NReference.Ind i)) ->
+ Cic.MutInd (NUri.ouri_of_nuri u,i,[])
+ | NCic.Const (NReference.Ref (_,u,NReference.Con (i,j))) ->
+ Cic.MutConstruct (NUri.ouri_of_nuri u,i,j,[])
+ | NCic.Const (NReference.Ref (_,u,NReference.Def))
+ | NCic.Const (NReference.Ref (_,u,NReference.Decl)) ->
+ Cic.Const (NUri.ouri_of_nuri u,[])
+ | NCic.Match (NReference.Ref (_,u,NReference.Ind i),oty,t,pl) ->
+ Cic.MutCase (NUri.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,_))) -> assert false
+ (* map to rel if is the self-fix, otherwise explode *)
+ | NCic.Const (NReference.Ref (_,u,NReference.CoFix i)) -> assert false
+ (* map to rel if is the self-fix, otherwise explode *)
+ | _ -> assert false
+;;
+
+let convert_fix k fl =
+ let n_fl = List.length fl in
+ let fl =
+ List.map
+ (fun (_, name,recno,ty,bo) ->
+ name, recno, convert_term 0 ty, convert_term 0 bo)
+ fl
+ in
+ Cic.Fix (k, fl)
+;;
+
+let convert_nobj = function
+ | _,_,_,_,NCic.Constant (rel, name, Some bo, ty, _) ->
+ Cic.Constant (name, Some (convert_term 0 bo), convert_term 0 ty, [],[])
+ | _,_,_,_,NCic.Constant (rel, name, None, ty, _) ->
+ Cic.Constant (name, None, convert_term 0 ty, [],[])
+ | _,_,_,_,NCic.Fixpoint (is_fix, fl, _) ->
+ Cic.Constant ("pippo", Some (convert_fix 0 fl),
+ convert_term 0 (let _,_,_,ty,_ = List.hd fl in ty), [], [])
+ | _,_,_,_,NCic.Inductive _ -> assert false
+;;