package coq
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=b1501d686c21836302191ae30f610cca57fb309214c126518ca009363ad2cd3c
doc/coq-core.kernel/Safe_typing/index.html
Module Safe_typing
Source
Safe environments
Since we are now able to type terms, we can define an abstract type of safe environments, where objects are typed before being added.
We also provide functionality for modules : start_module
, end_module
, etc.
The safe_environment state monad
Stm machinery
concat_private e1 e2
adds the constants of e1
to e2
, i.e. constants in e1
must be more recent than those of e2
.
val inline_private_constants :
Environ.env ->
private_constants Entries.proof_output ->
Constr.constr Univ.in_universe_context_set
Push the constants in the environment if not already there.
Enriching a safe environment
Insertion of global axioms or definitions
type global_declaration =
| ConstantEntry : Entries.constant_entry -> global_declaration
| OpaqueEntry : private_constants Entries.const_entry_body Entries.opaque_entry -> global_declaration
type side_effect_declaration =
| DefinitionEff : Entries.definition_entry -> side_effect_declaration
| OpaqueEff : Constr.constr Entries.opaque_entry -> side_effect_declaration
val export_private_constants :
private_constants ->
exported_private_constant list safe_transformer
val add_constant :
?typing_flags:Declarations.typing_flags ->
Names.Label.t ->
global_declaration ->
Names.Constant.t safe_transformer
returns the main constant
val add_private_constant :
Names.Label.t ->
side_effect_declaration ->
(Names.Constant.t * private_constants) safe_transformer
Similar to add_constant but also returns a certificate
Adding an inductive type
val add_mind :
?typing_flags:Declarations.typing_flags ->
Names.Label.t ->
Entries.mutual_inductive_entry ->
Names.MutInd.t safe_transformer
Adding a module or a module type
val add_module :
Names.Label.t ->
Entries.module_entry ->
Declarations.inline ->
(Names.ModPath.t * Mod_subst.delta_resolver) safe_transformer
val add_modtype :
Names.Label.t ->
Entries.module_type_entry ->
Declarations.inline ->
Names.ModPath.t safe_transformer
Adding universe constraints
Setting the type theory flavor
Interactive section functions
Insertion of local declarations (Local or Variables)
Add local universes to a polymorphic section
Interactive module functions
val add_module_parameter :
Names.MBId.t ->
Entries.module_struct_entry ->
Declarations.inline ->
Mod_subst.delta_resolver safe_transformer
Traditional mode: check at end of module that no future was created.
The optional result type is given without its functorial part
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_transformer
val add_include :
Entries.module_struct_entry ->
bool ->
Declarations.inline ->
Mod_subst.delta_resolver safe_transformer
Libraries : loading and saving compilation units
val export :
?except:Future.UUIDSet.t ->
output_native_objects:bool ->
safe_environment ->
Names.DirPath.t ->
Names.ModPath.t * compiled_library * Nativelib.native_library
val import :
compiled_library ->
Univ.ContextSet.t ->
vodigest ->
Names.ModPath.t safe_transformer
Safe typing judgments
The safe typing of a term returns a typing judgment.