Ind#
Ltac2.Ind
type t = inductiveAn inductive is the name of a mutually inductive type, along with the index of an inductive block within that type.
type data = inductive * Declarations.mutual_inductive_bodyThe actual data specified by a concrete declaration of an inductive type, containing, e.g., its constructors and its parameters. A value of type data corresponds to one inductive type within a larger mutually inductive block.
val data : Environ.env -> t -> datadata env ind gets the data of ind in the environment env.
repr data returns the name of the inductive type corresponding to the block. Inverse of data.
val index : t -> intindex ind returns the index of the inductive type inside its mutual block. Guaranteed to range between 0 and nblocks data - 1 where data was retrieved using the above function.
val nblocks : data -> intnblocks data returns the number of inductive types appearing in a mutual block.
val nconstructors : data -> intnconstructors data returns the number of constructors appearing in the current block.
get_block data n is the block corresponding to the nth inductive type in data's parent mutually inductive type. Index must range between 0 and nblocks data - 1, otherwise the function returns None.
val get_constructor : data -> int -> constructor optionget_constructor data n returns the nth constructor of the inductive type. Index must range between 0 and nconstructors data - 1, otherwise the function returns None.
val nparams : data -> intnparams data returns the number of parameters of the inductive type, including both uniform and non-uniform parameters. Does not count local let-ins.
val nparams_uniform : data -> intnparams_uniform data returns the number of recursively uniform (i.e., ordinary) parameters of the inductive type.
val get_projections : data -> projection array optionget_projections data returns the list of projections for a primitive record, or None if the inductive is not a primitive record.
val constructor_nargs : data -> int array(constructor_nargs data).(n) is the number of non-parameter arguments accepted by the nth constructor of this inductive type. Add (constructor_nargs data).(n) to nparams data to get the total number of arguments of the constructor.
val constructor_ndecls : data -> int array(constructor_ndecls data).(n) is the number of variables bound in a pattern match expression by the nth constructor of this inductive type. Can be greater than constructor_nargs data if the constructors have local let-bindings, e.g., applied to Inductive Ind (A : Type) (f : A -> A) : Set := Constr (x : A) (y := f x) it would return [|2|], because in match t with Constr _ _ x y => e end, x and y are bound in e.