Module Inductive
Extracting an inductive type from a construction
val find_rectype : Environ.env -> Constr.types -> Constr.pinductive * Constr.constr listval find_inductive : Environ.env -> Constr.types -> Constr.pinductive * Constr.constr listval find_coinductive : Environ.env -> Constr.types -> Constr.pinductive * Constr.constr list
type mind_specif= Declarations.mutual_inductive_body * Declarations.one_inductive_body
val lookup_mind_specif : Environ.env -> Names.inductive -> mind_specifFetching information in the environment about an inductive type. Raises an anomaly if the inductive type is not found.
val inductive_paramdecls : Declarations.mutual_inductive_body Univ.puniverses -> Constr.rel_contextFunctions to build standard types related to inductive
val instantiate_inductive_constraints : Declarations.mutual_inductive_body -> Univ.Instance.t -> Univ.Constraints.t
type param_univs= (unit -> Univ.Universe.t) list
val make_param_univs : Environ.env -> Constr.constr array -> param_univsThe constr array is the types of the arguments to a template polymorphic inductive.
val constrained_type_of_inductive : mind_specif Univ.puniverses -> Constr.types Univ.constrainedval constrained_type_of_inductive_knowing_parameters : mind_specif Univ.puniverses -> param_univs -> Constr.types Univ.constrainedval relevance_of_inductive : Environ.env -> Names.inductive -> Sorts.relevanceval type_of_inductive : mind_specif Univ.puniverses -> Constr.typesval type_of_inductive_knowing_parameters : ?polyprop:bool -> mind_specif Univ.puniverses -> param_univs -> Constr.typesval elim_sort : mind_specif -> Sorts.familyval is_private : mind_specif -> boolval is_primitive_record : mind_specif -> bool
val constrained_type_of_constructor : Constr.pconstructor -> mind_specif -> Constr.types Univ.constrainedval type_of_constructor : Constr.pconstructor -> mind_specif -> Constr.typesval arities_of_constructors : Constr.pinductive -> mind_specif -> Constr.types arrayReturn constructor types in normal form
val type_of_constructors : Constr.pinductive -> mind_specif -> Constr.types arrayReturn constructor types in user form
val abstract_constructor_type_relatively_to_inductive_types_context : int -> Names.MutInd.t -> Constr.types -> Constr.typesTurns a constructor type recursively referring to inductive types into the same constructor type referring instead to a context made from the abstract declaration of the inductive types (e.g. turns
nat->natintomkArrowR (Rel 1) (Rel 2)); takes as arguments the number of inductive types in the block and the name of the block
val inductive_params : mind_specif -> intval expand_case : Environ.env -> Constr.case -> Constr.case_info * Constr.constr * Constr.case_invert * Constr.constr * Constr.constr arrayGiven a pattern-matching represented compactly, expands it so as to produce lambda and let abstractions in front of the return clause and the pattern branches.
val expand_case_specif : Declarations.mutual_inductive_body -> Constr.case -> Constr.case_info * Constr.constr * Constr.case_invert * Constr.constr * Constr.constr arrayval contract_case : Environ.env -> (Constr.case_info * Constr.constr * Constr.case_invert * Constr.constr * Constr.constr array) -> Constr.caseDual operation of the above. Fails if the return clause or branch has not the expected form.
val instantiate_context : Univ.Instance.t -> Vars.substl -> Names.Name.t Context.binder_annot array -> Constr.rel_context -> Constr.rel_contextinstantiate_context u subst nas ctxapplies bothuandsubsttoctxwhile replacing names usingnas(order reversed). In particular, assumes thatctxandnashave the same length.
val type_case_branches : Environ.env -> (Constr.pinductive * Constr.constr list) -> Environ.unsafe_judgment -> Constr.constr -> Constr.types array * Constr.typestype_case_branches env (I,args) (p:A) ccomputes useful types about the following Cases expression: <p>Cases (c :: (I args)) of b1..bn end It computes the type of every branch (pattern variables are introduced by products), the type for the whole expression, and the universe constraints generated.
val build_branches_type : Constr.pinductive -> (Declarations.mutual_inductive_body * Declarations.one_inductive_body) -> Constr.constr list -> Constr.constr -> Constr.types arrayval mind_arity : Declarations.one_inductive_body -> Constr.rel_context * Sorts.familyReturn the arity of an inductive type
val inductive_sort_family : Declarations.one_inductive_body -> Sorts.familyval check_case_info : Environ.env -> Constr.pinductive -> Sorts.relevance -> Constr.case_info -> unitCheck a
case_infoactually correspond to a Case expression on the given inductive type.
Guard conditions for fix and cofix-points.
val is_primitive_positive_container : Environ.env -> Names.Constant.t -> boolis_primitive_positive_container env ctells if the constantcis registered as a primitive type that can be seen as a container where the occurrences of its parameters are positive, in which case the positivity and guard conditions are extended to allow inductive types to nest their subterms in these containers.
val check_fix : Environ.env -> Constr.fixpoint -> unitWhen
chkis false, the guard condition is not actually checked.
val check_cofix : Environ.env -> Constr.cofixpoint -> unit
Support for sort-polymorphic inductive types
exceptionSingletonInductiveBecomesProp of Names.Id.t
val max_inductive_sort : Sorts.t array -> Univ.Universe.t
Debug
type size=|Large|Stricttype subterm_spec=|Subterm of size * Declarations.wf_paths|Dead_code|Not_subtermtype guard_env={env : Environ.env;dB of last fixpoint
rel_min : int;dB of variables denoting subterms
genv : subterm_spec Stdlib.Lazy.t list;}type stack_element=|SClosure of guard_env * Constr.constr|SArg of subterm_spec Stdlib.Lazy.t
val subterm_specif : guard_env -> stack_element list -> Constr.constr -> subterm_specval abstract_mind_lc : int -> int -> Names.MutInd.t -> (Constr.rel_context * Constr.constr) array -> Constr.constr array