InductiveopsThe following three functions are similar to the ones defined in Inductive, but they expect an env
val type_of_inductive :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.typesval e_type_of_inductive :
Environ.env ->
Evd.evar_map ->
Names.inductive EConstr.puniverses ->
EConstr.typesval type_of_constructor :
Environ.env ->
Names.constructor Evd.puniverses ->
EConstr.typesReturn type as quoted by the user
val e_type_of_constructor :
Environ.env ->
Evd.evar_map ->
Names.constructor EConstr.puniverses ->
EConstr.typesval type_of_constructors :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.types arrayval arities_of_constructors :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.types arrayReturn constructor types in normal form
An inductive type with its parameters (transparently supports reasoning either with only recursively uniform parameters or with all parameters including the recursively non-uniform ones
val make_ind_family :
(Names.inductive Evd.puniverses * EConstr.constr list) ->
inductive_familyval dest_ind_family :
inductive_family ->
Names.inductive Evd.puniverses * EConstr.constr listval map_ind_family :
(EConstr.constr -> EConstr.constr) ->
inductive_family ->
inductive_familyval liftn_inductive_family : int -> int -> inductive_family -> inductive_familyval lift_inductive_family : int -> inductive_family -> inductive_familyval substnl_ind_family :
EConstr.constr list ->
int ->
inductive_family ->
inductive_familyval relevance_of_inductive :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.ERelevance.tval relevance_of_inductive_family :
Environ.env ->
inductive_family ->
EConstr.ERelevance.tAn inductive type with its parameters and real arguments
val make_ind_type : (inductive_family * EConstr.constr list) -> inductive_typeval dest_ind_type : inductive_type -> inductive_family * EConstr.constr listval map_inductive_type :
(EConstr.constr -> EConstr.constr) ->
inductive_type ->
inductive_typeval liftn_inductive_type : int -> int -> inductive_type -> inductive_typeval lift_inductive_type : int -> inductive_type -> inductive_typeval substnl_ind_type :
EConstr.constr list ->
int ->
inductive_type ->
inductive_typeval ind_of_ind_type : inductive_type -> Names.inductiveval relevance_of_inductive_type :
Environ.env ->
inductive_type ->
EConstr.ERelevance.tval mkAppliedInd : inductive_type -> EConstr.constrval dest_recarg : Declarations.recarg Rtree.Kind.t -> Declarations.recargval dest_subterms :
Declarations.recarg Rtree.Kind.t ->
Declarations.recarg Rtree.Kind.t array arrayval mis_is_recursive : Declarations.one_inductive_body -> boolCheck if a one_inductive_body is recursive, possibly nestedly
val mis_is_nested :
Environ.env ->
Names.MutInd.t ->
Declarations.mutual_inductive_body ->
boolval mis_nf_constructor_type :
Names.constructor Evd.puniverses ->
(Declarations.mutual_inductive_body * Declarations.one_inductive_body) ->
EConstr.constrval nconstructors : Environ.env -> Names.inductive -> intval constructors_nrealargs : Environ.env -> Names.inductive -> int arrayval constructors_nrealdecls : Environ.env -> Names.inductive -> int arrayval inductive_nrealargs : Environ.env -> Names.inductive -> intval inductive_nrealdecls : Environ.env -> Names.inductive -> intval inductive_nallargs : Environ.env -> Names.inductive -> intval inductive_nalldecls : Environ.env -> Names.inductive -> intval inductive_nparams : Environ.env -> Names.inductive -> intval inductive_nparamdecls : Environ.env -> Names.inductive -> intval inductive_paramdecls :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.rel_contextval inductive_alldecls :
Environ.env ->
Names.inductive Evd.puniverses ->
EConstr.rel_contextval constructor_nallargs : Environ.env -> Names.constructor -> intval constructor_nalldecls : Environ.env -> Names.constructor -> intval constructor_nrealargs : Environ.env -> Names.constructor -> intval constructor_nrealdecls : Environ.env -> Names.constructor -> intval inductive_alltags : Environ.env -> Names.inductive -> bool listval constructor_alltags : Environ.env -> Names.constructor -> bool listval inductive_has_local_defs : Environ.env -> Names.inductive -> boolIs there local defs in params or args ?
val constant_sorts_below :
UnivGen.QualityOrSet.t ->
UnivGen.QualityOrSet.t listval sorts_for_schemes : Declarations.mind_specif -> UnivGen.QualityOrSet.t listval is_squashed :
Evd.evar_map ->
(Declarations.mind_specif * EConstr.EInstance.t) ->
Inductive.squash optionval squash_elim_sort :
Evd.evar_map ->
Inductive.squash ->
EConstr.ESorts.t ->
Evd.evar_mapTake into account elimination constraints. When there is an elimination constraint and the predicate is underspecified, i.e. a QSort, we make a non-canonical choice for the return type. Incompatible constraints produce a universe inconsistency.
val is_allowed_elimination :
Evd.evar_map ->
(Declarations.mind_specif * EConstr.EInstance.t) ->
EConstr.ESorts.t ->
boolval make_allowed_elimination :
Evd.evar_map ->
(Declarations.mind_specif * EConstr.EInstance.t) ->
EConstr.ESorts.t ->
Evd.evar_map optionReturns Some sigma' if the elimination can be allowed, possibly adding constraints in sigma'
val elim_sort : Declarations.mind_specif -> UnivGen.QualityOrSet.tval top_allowed_sort : Environ.env -> Names.inductive -> UnivGen.QualityOrSet.tval has_dependent_elim :
Evd.evar_map ->
Declarations.mind_specif ->
EConstr.EInstance.t ->
bool(Co)Inductive records with primitive projections do not have eta-conversion, hence no dependent elimination.
val always_dependent_elim : Declarations.mind_specif -> boolval type_of_projection_knowing_arg :
Environ.env ->
Evd.evar_map ->
Names.Projection.t ->
EConstr.t ->
EConstr.types ->
EConstr.typesPrimitive projections
Extract information from an inductive family
type constructor_summary = {cs_name : Names.Id.t;cs_cstr : Names.constructor Evd.puniverses;cs_params : EConstr.constr list;cs_nargs : int;cs_args : EConstr.rel_context;cs_concl_realargs : EConstr.constr array;}val lift_constructor : int -> constructor_summary -> constructor_summaryval get_constructor :
(Names.inductive Evd.puniverses
* Declarations.mutual_inductive_body
* Declarations.one_inductive_body
* EConstr.constr list) ->
int ->
constructor_summaryval get_constructors :
Environ.env ->
inductive_family ->
constructor_summary arrayval get_arity : Environ.env -> inductive_family -> EConstr.rel_contextget_arity returns the arity of the inductive family instantiated with the parameters; if recursively non-uniform parameters are not part of the inductive family, they appears in the arity
val build_dependent_constructor : constructor_summary -> EConstr.constrval build_dependent_inductive :
Environ.env ->
inductive_family ->
EConstr.constrval make_arity_signature :
Environ.env ->
Evd.evar_map ->
bool ->
inductive_family ->
EConstr.rel_contextval make_arity :
Environ.env ->
Evd.evar_map ->
bool ->
inductive_family ->
EConstr.ESorts.t ->
EConstr.typesval extract_mrectype :
Evd.evar_map ->
EConstr.t ->
(Names.inductive * EConstr.EInstance.t) * EConstr.constr listRaise Not_found if not given a valid inductive type
val find_mrectype :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
(Names.inductive * EConstr.EInstance.t) * EConstr.constr listval find_mrectype_vect :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
(Names.inductive * EConstr.EInstance.t) * EConstr.constr arrayval find_rectype :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
inductive_typeval find_inductive :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
(Names.inductive * EConstr.EInstance.t) * EConstr.constr listval find_coinductive :
Environ.env ->
Evd.evar_map ->
EConstr.types ->
(Names.inductive * EConstr.EInstance.t) * EConstr.constr listval instantiate_constructor_params :
Names.constructor Evd.puniverses ->
Declarations.mind_specif ->
EConstr.constr list ->
EConstr.constrinstantiate_constructor_params cstr mind params instantiates the type of the given constructor with parameters params
val arity_of_case_predicate :
Environ.env ->
inductive_family ->
bool ->
EConstr.ESorts.t ->
EConstr.typesBuilds the case predicate arity (dependent or not)
val make_case_info :
Environ.env ->
Names.inductive ->
Constr.case_style ->
Constr.case_infoAnnotation for cases
val make_case_or_project :
Environ.env ->
Evd.evar_map ->
inductive_type ->
Constr.case_info ->
(EConstr.constr * EConstr.ERelevance.t) ->
EConstr.constr ->
EConstr.constr array ->
EConstr.constrMake a case or substitute projections if the inductive type is a record with primitive projections. Fail with an error if the elimination is dependent while the inductive type does not allow dependent elimination.
val simple_make_case_or_project :
Environ.env ->
Evd.evar_map ->
Constr.case_info ->
(EConstr.constr * EConstr.ERelevance.t) ->
EConstr.case_invert ->
EConstr.constr ->
EConstr.constr array ->
EConstr.constrSometimes make_case_or_project is nicer to call with a pre-built case_invert than inductive_type.
val make_case_invert :
Environ.env ->
Evd.evar_map ->
inductive_type ->
case_relevance:EConstr.ERelevance.t ->
Constr.case_info ->
EConstr.case_invertval compute_projections :
Environ.env ->
Names.inductive ->
(EConstr.constr * EConstr.types) arrayGiven a primitive record type, for every field computes the eta-expanded projection and its type.
val control_only_guard : Environ.env -> Evd.evar_map -> EConstr.types -> unitval paramdecls_fresh_template :
Evd.evar_map ->
(Declarations.mutual_inductive_body * Evd.einstance) ->
Evd.evar_map * EConstr.rel_context * Inductive.template_subst optionGeneralize template polymorphic universe variables, subtitute the instance, and returns the context of parameters, the new evar_map, and the substitution for the template variable if there is one.
val get_template_instance :
Declarations.mutual_inductive_body ->
Evd.einstance ->
Evd.einstancemodule Internal : sig ... end