| 1 | (************************************************************************) |
| 2 | (* * The Rocq Prover / The Rocq Development Team *) |
| 3 | (* v * Copyright INRIA, CNRS and contributors *) |
| 4 | (* <O___,, * (see version control and CREDITS file for authors & dates) *) |
| 5 | (* \VV/ **************************************************************) |
| 6 | (* // * This file is distributed under the terms of the *) |
| 7 | (* * GNU Lesser General Public License Version 2.1 *) |
| 8 | (* * (see LICENSE file for the text of the license) *) |
| 9 | (************************************************************************) |
| 10 | |
| 11 | open Names |
| 12 | open EConstr |
| 13 | |
| 14 | type template_binder = { |
| 15 | bind_sort : Sorts.t; |
| 16 | default : Sorts.t; |
| 17 | } |
| 18 | |
| 19 | (** NB: the types and rel_contexts may mention previous args |
| 20 | eg "sigT : forall A, (A -> Type) -> Type" is |
| 21 | "TemplateArg ([], u, TemplateArg ([_:Rel 1], v, IndType (_, [], Type@{max(u,v)})))" |
| 22 | note the "Rel 1" *) |
| 23 | type template_arity = |
| 24 | | NonTemplateArg of Name.t binder_annot * types * template_arity |
| 25 | | TemplateArg of Name.t binder_annot * rel_context * template_binder * template_arity |
| 26 | | DefParam of Name.t binder_annot * constr * types * template_arity |
| 27 | | CtorType of Declarations.template_universes * types |
| 28 | | IndType of Declarations.template_universes * rel_context * Sorts.t |
| 29 | |
| 30 | val get_template_arity |
| 31 | : Environ.env |
| 32 | -> Names.inductive |
| 33 | -> ctoropt:int option |
| 34 | -> template_arity |