aboutsummaryrefslogtreecommitdiff
path: root/doc/plugin_tutorial/tuto1/src/simple_declare.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-06-06 06:09:24 +0200
committerEmilio Jesus Gallego Arias2019-06-24 20:55:09 +0200
commit8b903319eae4d645f9385e8280d04d18a4f3a2bc (patch)
tree97f39249d6eef4c4fda252ca74d0a35ade40caef /doc/plugin_tutorial/tuto1/src/simple_declare.ml
parent70a11c78e790d7f2f4175d1002e08f79d3ed8486 (diff)
[lemmas] [proof] Split proof kinds into per-layer components.
We split `{goal,declaration,assumption}_kind` into their components. This makes sense as each part of this triple is handled by a different layer, namely: - `polymorphic` status: necessary for the lower engine layers; - `locality`: only used in `vernac` top-level constants - `kind`: merely used for cosmetic purposes [could indeed be removed / pushed upwards] We also profit from this refactoring to add some named parameters to the top-level definition API which is quite parameter-hungry. More refactoring is possible and will come in further commits, in particular this is a step towards unifying the definition / lemma save path.
Diffstat (limited to 'doc/plugin_tutorial/tuto1/src/simple_declare.ml')
-rw-r--r--doc/plugin_tutorial/tuto1/src/simple_declare.ml12
1 files changed, 5 insertions, 7 deletions
diff --git a/doc/plugin_tutorial/tuto1/src/simple_declare.ml b/doc/plugin_tutorial/tuto1/src/simple_declare.ml
index eb8161c2bb..7fbad3ea96 100644
--- a/doc/plugin_tutorial/tuto1/src/simple_declare.ml
+++ b/doc/plugin_tutorial/tuto1/src/simple_declare.ml
@@ -1,14 +1,12 @@
-let edeclare ?hook ident (_, poly, _ as k) ~opaque sigma udecl body tyopt imps =
+let edeclare ?hook ~name ~poly ~scope ~kind ~opaque sigma udecl body tyopt imps =
let sigma, ce = DeclareDef.prepare_definition ~allow_evars:false
~opaque ~poly sigma udecl ~types:tyopt ~body in
let uctx = Evd.evar_universe_context sigma in
let ubinders = Evd.universe_binders sigma in
let hook_data = Option.map (fun hook -> hook, uctx, []) hook in
- DeclareDef.declare_definition ident k ce ubinders imps ?hook_data
+ DeclareDef.declare_definition ~name ~scope ~kind ubinders ce imps ?hook_data
-let declare_definition ~poly ident sigma body =
- let k = Decl_kinds.(Global ImportDefaultBehavior, poly, Definition) in
+let declare_definition ~poly name sigma body =
let udecl = UState.default_univ_decl in
- edeclare ident k ~opaque:false sigma udecl body None []
-
-(* But this definition cannot be undone by Reset ident *)
+ edeclare ~name ~poly ~scope:Decl_kinds.(Global ImportDefaultBehavior)
+ ~kind:Decl_kinds.Definition ~opaque:false sigma udecl body None []