]> matita.cs.unibo.it Git - helm.git/commitdiff
Implemented translation of inductive types from the new to the old format.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sun, 18 May 2008 08:16:55 +0000 (08:16 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Sun, 18 May 2008 08:16:55 +0000 (08:16 +0000)
helm/software/components/ng_kernel/nCic2OCic.ml

index d78d5f3fe33c663d3f6504ec6d04deb34f0bcfa8..e67e1ba90f0e6f98e2f6a08562d3721a48149473 100644 (file)
@@ -100,5 +100,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,[])]
 ;;