Module Declare
module Hook : sig ... endDeclaration hooks, to be run when a constant is saved. Use with care, as imperative effects may become not supported in the future.
One-go, non-interactive declaration API
module CInfo : sig ... endInformation for a single top-level named constant
module Info : sig ... endInformation for a declaration, interactive or not, includes parameters shared by mutual constants
val declare_definition : info:Info.t -> cinfo:EConstr.t option CInfo.t -> opaque:bool -> body:EConstr.t -> Evd.evar_map -> Names.GlobRef.tDeclares a non-interactive constant;
bodyandtypeswill be normalized w.r.t. the passedevar_mapsigma. Universes should be handled properly, including minimization and restriction. Note thatsigmais checked for unresolved evars, thus you should be careful not to submit open terms
val declare_assumption : name:Names.Id.t -> scope:Locality.locality -> hook:Hook.t option -> impargs:Impargs.manual_implicits -> uctx:UState.t -> Entries.parameter_entry -> Names.GlobRef.t
val declare_mutually_recursive : info:Info.t -> cinfo:Constr.t CInfo.t list -> opaque:bool -> ntns:Vernacexpr.decl_notation list -> uctx:UState.t -> rec_declaration:Constr.rec_declaration -> possible_indexes:lemma_possible_guards option -> Names.GlobRef.t list
Declaration of interactive constants
module OblState : sig ... endsave/save_admittedcan update obligations state, so we need to expose the state here
module Proof : sig ... endDeclare.Proof.tConstruction of constants using interactive proofs.
low-level, internla API, avoid using unless you have special needs
type 'a proof_entryProof entries represent a proof that has been finished, but still not registered with the kernel.
XXX: This is an internal, low-level API and could become scheduled for removal from the public API, use higher-level declare APIs instead
val definition_entry : ?opaque:bool -> ?using:Names.Id.Set.t -> ?inline:bool -> ?types:Constr.types -> ?univs:Entries.universes_entry -> Constr.constr -> Evd.side_effects proof_entryval declare_entry : name:Names.Id.t -> scope:Locality.locality -> kind:Decls.logical_kind -> ?hook:Hook.t -> impargs:Impargs.manual_implicits -> uctx:UState.t -> Evd.side_effects proof_entry -> Names.GlobRef.tXXX: This is an internal, low-level API and could become scheduled for removal from the public API, use higher-level declare APIs instead
val declare_variable : name:Names.variable -> kind:Decls.logical_kind -> typ:Constr.types -> impl:Glob_term.binding_kind -> unitDeclaration of local constructions (Variable/Hypothesis/Local)
type 'a constant_entry=|DefinitionEntry of 'a proof_entry|ParameterEntry of Entries.parameter_entry|PrimitiveEntry of Entries.primitive_entryDeclaration of global constructions i.e. Definition/Theorem/Axiom/Parameter/...
XXX: This is an internal, low-level API and could become scheduled for removal from the public API, use higher-level declare APIs instead
val prepare_parameter : poly:bool -> udecl:UState.universe_decl -> types:EConstr.types -> Evd.evar_map -> Evd.evar_map * Entries.parameter_entryval declare_constant : ?local:Locality.import_status -> name:Names.Id.t -> kind:Decls.logical_kind -> ?typing_flags:Declarations.typing_flags -> Evd.side_effects constant_entry -> Names.Constant.tdeclare_constant id cddeclares a global declaration (constant/parameter) with nameidin the current section; it returns the full path of the declarationXXX: This is an internal, low-level API and could become scheduled for removal from the public API, use higher-level declare APIs instead
val definition_message : Names.Id.t -> unitXXX: Scheduled for removal from public API, do not use
val assumption_message : Names.Id.t -> unitval fixpoint_message : int array option -> Names.Id.t list -> unitval check_exists : Names.Id.t -> unitval build_by_tactic : ?side_eff:bool -> Environ.env -> uctx:UState.t -> poly:bool -> typ:EConstr.types -> unit Proofview.tactic -> Constr.constr * Constr.types option * Entries.universes_entry * bool * UState.tSemantics of this function is a bit dubious, use with care
Program mode API
Solving of obligations: Solved obligations are stored as regular global declarations in the global environment, usually with name constant_obligation_number where constant is the original constant and number is the corresponding (internal) number.
Solving an obligation can trigger a bit of a complex cascaded callback path; closing an obligation can indeed allow all other obligations to be closed, which in turn may trigged the declaration of the original constant. Care must be taken, as this can modify Global.env in arbitrarily ways. Current code takes some care to refresh the env in the proper boundaries, but the invariants remain delicate.
Saving of obligations: as open obligations use the regular proof mode, a `Qed` will call `Lemmas.save_lemma` first. For this reason obligations code is split in two: this file, Obligations, taking care of the top-level vernac commands, and Declare, which is called by `Lemmas` to close an obligation proof and eventually to declare the top-level Programed constant.
module Obls : sig ... endFor internal support, do not use
module Internal : sig ... end