aboutsummaryrefslogtreecommitdiff
path: root/vernac/declareDef.mli
diff options
context:
space:
mode:
Diffstat (limited to 'vernac/declareDef.mli')
-rw-r--r--vernac/declareDef.mli36
1 files changed, 32 insertions, 4 deletions
diff --git a/vernac/declareDef.mli b/vernac/declareDef.mli
index e9e051f732..ac4f44608b 100644
--- a/vernac/declareDef.mli
+++ b/vernac/declareDef.mli
@@ -11,18 +11,46 @@
open Names
open Decl_kinds
+(** Declaration hooks *)
+module Hook : sig
+ type t
+
+ (** Hooks allow users of the API to perform arbitrary actions at
+ proof/definition saving time. For example, to register a constant
+ as a Coercion, perform some cleanup, update the search database,
+ etc... *)
+ module S : sig
+ (** [S.t] passes to the client: *)
+ type t
+ = UState.t
+ (** [ustate]: universe constraints obtained when the term was closed *)
+ -> (Id.t * Constr.t) list
+ (** [(n1,t1),...(nm,tm)]: association list between obligation
+ name and the corresponding defined term (might be a constant,
+ but also an arbitrary term in the Expand case of obligations) *)
+ -> Decl_kinds.locality
+ (** [locality]: Locality of the original declaration *)
+ -> GlobRef.t
+ (** [ref]: identifier of the origianl declaration *)
+ -> unit
+ end
+
+ val make : S.t -> t
+ val call : ?hook:t -> ?fix_exn:Future.fix_exn -> S.t
+end
+
val declare_definition
: Id.t
-> definition_kind
- -> ?hook_data:(Lemmas.declaration_hook * UState.t * (Id.t * Constr.t) list)
- -> Evd.side_effects Entries.definition_entry
+ -> ?hook_data:(Hook.t * UState.t * (Id.t * Constr.t) list)
+ -> Evd.side_effects Proof_global.proof_entry
-> UnivNames.universe_binders
-> Impargs.manual_implicits
-> GlobRef.t
val declare_fix
: ?opaque:bool
- -> ?hook_data:(Lemmas.declaration_hook * UState.t * (Id.t * Constr.t) list)
+ -> ?hook_data:(Hook.t * UState.t * (Id.t * Constr.t) list)
-> definition_kind
-> UnivNames.universe_binders
-> Entries.universes_entry
@@ -36,7 +64,7 @@ val prepare_definition : allow_evars:bool ->
?opaque:bool -> ?inline:bool -> poly:bool ->
Evd.evar_map -> UState.universe_decl ->
types:EConstr.t option -> body:EConstr.t ->
- Evd.evar_map * Evd.side_effects Entries.definition_entry
+ Evd.evar_map * Evd.side_effects Proof_global.proof_entry
val prepare_parameter : allow_evars:bool ->
poly:bool -> Evd.evar_map -> UState.universe_decl -> EConstr.types ->