diff options
author | Stephane Glondu <steph@glondu.net> | 2008-08-08 13:18:42 +0200 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2008-08-08 13:18:42 +0200 |
commit | 870075f34dd9fa5792bfbf413afd3b96f17e76a0 (patch) | |
tree | 0c647056de1832cf1dba5ba58758b9121418e4be /pretyping/inductiveops.ml | |
parent | a0cfa4f118023d35b767a999d5a2ac4b082857b4 (diff) |
Imported Upstream version 8.2~beta4+dfsgupstream/8.2.beta4+dfsg
Diffstat (limited to 'pretyping/inductiveops.ml')
-rw-r--r-- | pretyping/inductiveops.ml | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml index 0daff713..127cd0f2 100644 --- a/pretyping/inductiveops.ml +++ b/pretyping/inductiveops.ml @@ -6,7 +6,7 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(* $Id: inductiveops.ml 10114 2007-09-06 07:36:14Z herbelin $ *) +(* $Id: inductiveops.ml 11309 2008-08-06 10:30:35Z herbelin $ *) open Util open Names @@ -31,6 +31,11 @@ let type_of_constructor env cstr = Inductive.lookup_mind_specif env (inductive_of_constructor cstr) in Inductive.type_of_constructor cstr specif +(* Return constructor types in user form *) +let type_of_constructors env ind = + let specif = Inductive.lookup_mind_specif env ind in + Inductive.type_of_constructors ind specif + (* Return constructor types in normal form *) let arities_of_constructors env ind = let specif = Inductive.lookup_mind_specif env ind in @@ -87,7 +92,7 @@ let mis_nf_constructor_type (ind,mib,mip) j = and ntypes = mib.mind_ntypes and nconstr = Array.length mip.mind_consnames in let make_Ik k = mkInd ((fst ind),ntypes-k-1) in - if j > nconstr then error "Not enough constructors in the type"; + if j > nconstr then error "Not enough constructors in the type."; substl (list_tabulate make_Ik ntypes) specif.(j-1) (* Arity of constructors excluding parameters and local defs *) |