package coq
Module TypeopsSource
Typing functions (not yet tagged as safe)
They return unsafe judgments that are "in context" of a set of (local) universe variables (the ones that appear in the term) and associated constraints. In case of polymorphic definitions, these variables and constraints will be generalized.
When typechecking a term it may be updated to fix relevance marks. Do not discard the result.
Basic operations of the typing machine.
If j is the judgement $ c:t $ , then assumption_of_judgement env j returns the type $ c $ , checking that $ t $ is a sort.
val check_binder_annot :
Sorts.t ->
Names.Name.t Context.binder_annot ->
Names.Name.t Context.binder_annotType of sorts.
Type of a bound variable.
Type of variables
type of a constant
val judge_of_projection :
Environ.env ->
Names.Projection.t ->
Environ.unsafe_judgment ->
Environ.unsafe_judgmenttype of an applied projection
val judge_of_apply :
Environ.env ->
Environ.unsafe_judgment ->
Environ.unsafe_judgment array ->
Environ.unsafe_judgmentType of application.
Type of an abstraction.
Type of a product.
val type_of_product :
Environ.env ->
Names.Name.t Context.binder_annot ->
Sorts.t ->
Sorts.t ->
Constr.typess Type of a let in.
val judge_of_cast :
Environ.env ->
Environ.unsafe_judgment ->
Constr.cast_kind ->
Environ.unsafe_type_judgment ->
Environ.unsafe_judgmentType of a cast.
val judge_of_inductive :
Environ.env ->
Names.inductive Univ.puniverses ->
Environ.unsafe_judgmentInductive types.
val judge_of_constructor :
Environ.env ->
Names.constructor Univ.puniverses ->
Environ.unsafe_judgmentType of global references.
val type_of_global_in_context :
Environ.env ->
Names.GlobRef.t ->
Constr.types * Univ.AbstractContext.tReturns the type of the global reference, by creating a fresh instance of polymorphic references and computing their instantiated universe context. The type should not be used without pushing it's universe context in the environmnent of usage. For non-universe-polymorphic constants, it does not matter.
Miscellaneous.
val check_hyps_inclusion :
Environ.env ->
?evars:(Constr.existential -> Constr.constr option) ->
Names.GlobRef.t ->
Constr.named_context ->
unitCheck that hyps are included in env and fails with error otherwise
Types for primitives
val judge_of_array :
Environ.env ->
Univ.Instance.t ->
Environ.unsafe_judgment array ->
Environ.unsafe_judgment ->
Environ.unsafe_judgmentval type_of_prim_type :
Environ.env ->
Univ.Instance.t ->
'a CPrimitives.prim_type ->
Constr.typesval type_of_prim_or_type :
Environ.env ->
Univ.Instance.t ->
CPrimitives.op_or_type ->
Constr.typesAllow the checker to make this warning into an error.
We have case inversion exactly when going from irrelevant nonempty (ie 1 constructor) inductive to relevant type.