TemplateAritytype template_arity = | | NonTemplateArg of Names.Name.t EConstr.binder_annot * EConstr.types * template_arity | 
| | TemplateArg of Names.Name.t EConstr.binder_annot * EConstr.rel_context * template_binder * template_arity | 
| | DefParam of Names.Name.t EConstr.binder_annot * EConstr.constr * EConstr.types * template_arity | 
| | CtorType of Declarations.template_universes * EConstr.types | 
| | IndType of Declarations.template_universes * EConstr.rel_context * Sorts.t | 
NB: the types and rel_contexts may mention previous args eg "sigT : forall A, (A -> Type) -> Type" is "TemplateArg (, u, TemplateArg (_:Rel 1, v, IndType (_, , Type@max(u,v))))" note the "Rel 1"
val get_template_arity : Environ.env -> Names.inductive -> ctoropt:int option -> template_arity