aboutsummaryrefslogtreecommitdiff
path: root/vernac/declareDef.mli
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-05-01 10:44:44 +0200
committerEmilio Jesus Gallego Arias2020-05-07 18:13:56 +0200
commit6675e7c54ae552df31a281098ba7f7d199372aec (patch)
tree294a830870202c75d1bb44ab4e9c8630961a4576 /vernac/declareDef.mli
parentad84e6948a86db491a00bb92ec3e00a9a743b1f9 (diff)
[declare] Merge DeclareDef into Declare
The API in `DeclareDef` should become the recommended API in `Declare`. This greatly reduces the exposure of internals; we still have a large offender in `Lemmas` but that will be taken care of in the next commit; effectively removing quite some chunks from `declare.mli`. This PR originally introduced a dependency cycle due to: - `Declare`: uses `Vernacexpr.decl_notation list` - `Vernacexpr`: uses `ComHint.hint_expr` - `ComHint`: uses `Declare.declare_constant` This is a real cycle in the sense that `ComHint` would have also move to `DeclareDef` in the medium term. There were quite a few ways to solve it, we have chosen to move the hints ast to `Vernacexpr` as it is not very invasive and seems consistent with the current style. Alternatives, which could be considered at a later stage are for example moving the notations AST to `Metasyntax`, having `Declare` not to depend on `Vernacexpr` [which seems actually a good thing to do in the medium term], reworking notation support more deeply...
Diffstat (limited to 'vernac/declareDef.mli')
-rw-r--r--vernac/declareDef.mli132
1 files changed, 0 insertions, 132 deletions
diff --git a/vernac/declareDef.mli b/vernac/declareDef.mli
deleted file mode 100644
index 3bc1e25f19..0000000000
--- a/vernac/declareDef.mli
+++ /dev/null
@@ -1,132 +0,0 @@
-(************************************************************************)
-(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * Copyright INRIA, CNRS and contributors *)
-(* <O___,, * (see version control and CREDITS file for authors & dates) *)
-(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
-(* * (see LICENSE file for the text of the license) *)
-(************************************************************************)
-
-open Names
-
-type locality = Discharge | Global of Declare.import_status
-
-(** 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
- type t =
- { uctx : UState.t
- (** [ustate]: universe constraints obtained when the term was closed *)
- ; obls : (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) *)
- ; scope : locality
- (** [scope]: Locality of the original declaration *)
- ; dref : GlobRef.t
- (** [dref]: identifier of the original declaration *)
- }
- end
-
- val make : (S.t -> unit) -> t
- val call : ?hook:t -> S.t -> unit
-end
-
-(** Declare an interactively-defined constant *)
-val declare_entry
- : name:Id.t
- -> scope:locality
- -> kind:Decls.logical_kind
- -> ?hook:Hook.t
- -> ?obls:(Id.t * Constr.t) list
- -> impargs:Impargs.manual_implicits
- -> uctx:UState.t
- -> Evd.side_effects Declare.proof_entry
- -> GlobRef.t
-
-(** Declares a non-interactive constant; [body] and [types] will be
- normalized w.r.t. the passed [evar_map] [sigma]. Universes should
- be handled properly, including minimization and restriction. Note
- that [sigma] is checked for unresolved evars, thus you should be
- careful not to submit open terms or evar maps with stale,
- unresolved existentials *)
-val declare_definition
- : name:Id.t
- -> scope:locality
- -> kind:Decls.logical_kind
- -> opaque:bool
- -> impargs:Impargs.manual_implicits
- -> udecl:UState.universe_decl
- -> ?hook:Hook.t
- -> ?obls:(Id.t * Constr.t) list
- -> poly:bool
- -> ?inline:bool
- -> types:EConstr.t option
- -> body:EConstr.t
- -> ?fix_exn:(Exninfo.iexn -> Exninfo.iexn)
- -> Evd.evar_map
- -> GlobRef.t
-
-val declare_assumption
- : ?fix_exn:(Exninfo.iexn -> Exninfo.iexn)
- -> name:Id.t
- -> scope:locality
- -> hook:Hook.t option
- -> impargs:Impargs.manual_implicits
- -> uctx:UState.t
- -> Entries.parameter_entry
- -> GlobRef.t
-
-module Recthm : sig
- type t =
- { name : Id.t
- (** Name of theorem *)
- ; typ : Constr.t
- (** Type of theorem *)
- ; args : Name.t list
- (** Names to pre-introduce *)
- ; impargs : Impargs.manual_implicits
- (** Explicitily declared implicit arguments *)
- }
-end
-
-val declare_mutually_recursive
- : opaque:bool
- -> scope:locality
- -> kind:Decls.logical_kind
- -> poly:bool
- -> uctx:UState.t
- -> udecl:UState.universe_decl
- -> ntns:Vernacexpr.decl_notation list
- -> rec_declaration:Constr.rec_declaration
- -> possible_indexes:int list list option
- -> ?restrict_ucontext:bool
- (** XXX: restrict_ucontext should be always true, this seems like a
- bug in obligations, so this parameter should go away *)
- -> Recthm.t list
- -> Names.GlobRef.t list
-
-val prepare_obligation
- : ?opaque:bool
- -> ?inline:bool
- -> name:Id.t
- -> poly:bool
- -> udecl:UState.universe_decl
- -> types:EConstr.t option
- -> body:EConstr.t
- -> Evd.evar_map
- -> Constr.constr * Constr.types * UState.t * RetrieveObl.obligation_info
-
-val prepare_parameter
- : poly:bool
- -> udecl:UState.universe_decl
- -> types:EConstr.types
- -> Evd.evar_map
- -> Evd.evar_map * Entries.parameter_entry