+let mk_inductive types lpsno =
+ let map1 (lps1, cons) (name, arity) =
+ let lps2, arity = strip_lps lpsno arity in
+ merge_lps lps1 lps2, (name, arity) :: cons
+ in
+ let map2 (lps1, types) (_, name, kind, arity, cons) =
+ let lps2, arity = strip_lps lpsno arity in
+ let lps1, rev_cons = List.fold_left map1 (lps1, []) cons in
+ merge_lps lps1 lps2, (name, kind, arity, List.rev rev_cons) :: types
+ in
+ let map3 (name, xw) = arel_of_name name, xw in
+ let rev_lps, rev_types = List.fold_left map2 ([], []) types in
+ let lpars, types = List.rev_map map3 rev_lps, List.rev rev_types in
+ let obj = N.Inductive (lpars, types) in
+ G.Executable (floc, G.Command (floc, G.Obj (floc, obj)))
+