Module Safe_typing
Safe environments
val empty_environment : safe_environmentval is_initial : safe_environment -> boolval env_of_safe_env : safe_environment -> Environ.envval sections_of_safe_env : safe_environment -> section_data Section.t optionval structure_body_of_safe_env : safe_environment -> Declarations.structure_body
type safe_transformer0= safe_environment -> safe_environmenttype 'a safe_transformer= safe_environment -> 'a * safe_environment
Stm machinery
val empty_private_constants : private_constantsval is_empty_private_constants : private_constants -> boolval concat_private : private_constants -> private_constants -> private_constantsconcat_private e1 e2adds the constants ofe1toe2, i.e. constants ine1must be more recent than those ofe2.
val inline_private_constants : Environ.env -> private_constants Entries.proof_output -> Constr.constr Univ.in_universe_context_setval push_private_constants : Environ.env -> private_constants -> Environ.envPush the constants in the environment if not already there.
val universes_of_private : private_constants -> Univ.ContextSet.tval is_curmod_library : safe_environment -> boolval is_joined_environment : safe_environment -> boolEnriching a safe environment
type global_declaration=|ConstantEntry : Entries.constant_entry -> global_declaration|OpaqueEntry : unit Entries.opaque_entry -> global_declarationtype side_effect_declaration=|DefinitionEff : Entries.definition_entry -> side_effect_declaration|OpaqueEff : Constr.constr Entries.opaque_entry -> side_effect_declarationtype exported_opaquetype exported_private_constant= Names.Constant.t * exported_opaque option
val repr_exported_opaque : exported_opaque -> Opaqueproof.opaque_handle * Opaqueproof.opaque_prooftermval export_private_constants : private_constants -> exported_private_constant list safe_transformerval add_constant : ?typing_flags:Declarations.typing_flags -> Names.Label.t -> global_declaration -> Names.Constant.t safe_transformerreturns the main constant
val add_private_constant : Names.Label.t -> Univ.ContextSet.t -> side_effect_declaration -> (Names.Constant.t * private_constants) safe_transformerSimilar to add_constant but also returns a certificate
Delayed proofs
type opaque_certificateWitness that a delayed Qed hole has a proof. This datatype is marshallable but care must be taken to marshal it at the same time as the environment it is referring to, since
fill_opaquerelies on a shared pointer between the environment and the certificate.
val check_opaque : safe_environment -> Opaqueproof.opaque_handle -> private_constants Entries.proof_output -> opaque_certificateCheck that the provided proof is correct for the corresponding handle. This does not modify the environment. Call
fill_opaquebelow for that.
val fill_opaque : opaque_certificate -> safe_transformer0Given an already checked proof for an opaque hole, actually fill it with the proof. This might fail if the current set of global universes is inconsistent with the one at the time of the call to
check_opaque. Precondition: the underlying handle must exist and must not have been filled.
val is_filled_opaque : Opaqueproof.opaque_handle -> safe_environment -> boolCheck whether a handle was filled. It assumes that the handle was introduced in the opaque table and throws an anomaly otherwise.
val repr_certificate : opaque_certificate -> Constr.t * Univ.ContextSet.t Opaqueproof.delayed_universesGet the proof term that was checked by the kernel.
Inductive blocks
val add_mind : ?typing_flags:Declarations.typing_flags -> Names.Label.t -> Entries.mutual_inductive_entry -> Names.MutInd.t safe_transformer
val add_module : Names.Label.t -> Entries.module_entry -> Declarations.inline -> (Names.ModPath.t * Mod_subst.delta_resolver) safe_transformerval add_modtype : Names.Label.t -> Entries.module_type_entry -> Declarations.inline -> Names.ModPath.t safe_transformer
val push_context_set : strict:bool -> Univ.ContextSet.t -> safe_transformer0val add_constraints : Univ.Constraints.t -> safe_transformer0val set_impredicative_set : bool -> safe_transformer0Setting the type theory flavor
val set_indices_matter : bool -> safe_transformer0val set_typing_flags : Declarations.typing_flags -> safe_transformer0val set_check_guarded : bool -> safe_transformer0val set_check_positive : bool -> safe_transformer0val set_check_universes : bool -> safe_transformer0val set_VM : bool -> safe_transformer0val set_native_compiler : bool -> safe_transformer0val set_allow_sprop : bool -> safe_transformer0
Interactive section functions
val open_section : safe_transformer0val close_section : safe_transformer0val sections_are_opened : safe_environment -> bool
val push_named_assum : (Names.Id.t * Constr.types) -> safe_transformer0val push_named_def : (Names.Id.t * Entries.section_def_entry) -> safe_transformer0val push_section_context : Univ.UContext.t -> safe_transformer0Add local universes to a polymorphic section
Interactive module functions
val start_module : Names.Label.t -> Names.ModPath.t safe_transformerval start_modtype : Names.Label.t -> Names.ModPath.t safe_transformerval add_module_parameter : Names.MBId.t -> Entries.module_struct_entry -> Declarations.inline -> Mod_subst.delta_resolver safe_transformerval module_num_parameters : safe_environment -> int listreturns the number of module (type) parameters following the nested module structure. The inner module (type) comes first in the list.
val module_is_modtype : safe_environment -> bool listreturns true if the module is a module type following the nested module structure. The inner module (type) comes first in the list. true means a module type, false a regular module
val allow_delayed_constants : bool Stdlib.refTraditional mode: check at end of module that no future was created.
val end_module : Names.Label.t -> (Entries.module_struct_entry * Declarations.inline) option -> (Names.ModPath.t * Names.MBId.t list * Mod_subst.delta_resolver) safe_transformerval end_modtype : Names.Label.t -> (Names.ModPath.t * Names.MBId.t list) safe_transformerval add_include : Entries.module_struct_entry -> bool -> Declarations.inline -> Mod_subst.delta_resolver safe_transformerval current_modpath : safe_environment -> Names.ModPath.tval current_dirpath : safe_environment -> Names.DirPath.t
Libraries : loading and saving compilation units
val module_of_library : compiled_library -> Declarations.module_bodyval univs_of_library : compiled_library -> Univ.ContextSet.tval start_library : Names.DirPath.t -> Names.ModPath.t safe_transformerval export : output_native_objects:bool -> safe_environment -> Names.DirPath.t -> Names.ModPath.t * compiled_library * Nativelib.native_libraryval import : compiled_library -> Univ.ContextSet.t -> vodigest -> Names.ModPath.t safe_transformer
Safe typing judgments
val j_val : judgment -> Constr.constrval j_type : judgment -> Constr.constrval typing : safe_environment -> Constr.constr -> judgmentThe safe typing of a term returns a typing judgment.
Queries
val exists_objlabel : Names.Label.t -> safe_environment -> boolval delta_of_senv : safe_environment -> Mod_subst.delta_resolver * Mod_subst.delta_resolverval constant_of_delta_kn_senv : safe_environment -> Names.KerName.t -> Names.Constant.tval mind_of_delta_kn_senv : safe_environment -> Names.KerName.t -> Names.MutInd.t
Retroknowledge / Native compiler
val register_inline : Names.Constant.t -> safe_transformer0val register_inductive : Names.inductive -> 'a CPrimitives.prim_ind -> safe_transformer0val set_strategy : Names.Constant.t Names.tableKey -> Conv_oracle.level -> safe_transformer0