diff options
Diffstat (limited to 'kernel/indtypes.mli')
-rw-r--r-- | kernel/indtypes.mli | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/kernel/indtypes.mli b/kernel/indtypes.mli index 93bfb5454..7e803b11e 100644 --- a/kernel/indtypes.mli +++ b/kernel/indtypes.mli @@ -14,6 +14,7 @@ open Univ open Term open Declarations open Environ +open Typeops (*i*) @@ -37,21 +38,32 @@ type inductive_error = exception InductiveError of inductive_error -(*s The following function does checks on inductive declarations. *) +(*s Declaration of inductive types. *) + +(* Assume the following definition in concrete syntax: +\begin{verbatim} +Inductive I1 [x1:X1;...;xn:Xn] : A1 := c11 : T11 | ... | c1n1 : T1n1 +... +with Ip [x1:X1;...;xn:Xn] : Ap := cp1 : Tp1 | ... | cpnp : Tpnp. +\end{verbatim} +then, in $i^{th}$ block, [mind_entry_params] is [[xn:Xn;...;x1:X1]]; +[mind_entry_arity] is [Ai], defined in context [[[x1:X1;...;xn:Xn]]; +[mind_entry_lc] is [Ti1;...;Tini], defined in context [[A'1;...;A'p;x1:X1;...;xn:Xn]] where [A'i] is [Ai] generalized over [[x1:X1;...;xn:Xn]]. +*) -(* [mind_check_wellformed env mie] checks that the types declared for - all the inductive types are arities. It checks also that - constructor and inductive names altogether are distinct. It raises - an exception [InductiveError _] if [mie] is not well-formed *) +type one_inductive_entry = { + mind_entry_nparams : int; + mind_entry_params : (identifier * local_entry) list; + mind_entry_typename : identifier; + mind_entry_arity : constr; + mind_entry_consnames : identifier list; + mind_entry_lc : constr list } -val mind_check_wellformed : env -> mutual_inductive_entry -> unit +type mutual_inductive_entry = { + mind_entry_finite : bool; + mind_entry_inds : one_inductive_entry list } -(* [cci_inductive] checks positivity and builds an inductive body *) +(*s The following function does checks on inductive declarations. *) -val cci_inductive : - (identifier * variable) list -> env -> env -> path_kind -> bool -> - (Sign.rel_context * int * identifier * types * - identifier list * bool * bool * types array) - list -> - constraints -> - mutual_inductive_body +val check_inductive : + env -> mutual_inductive_entry -> mutual_inductive_body |