aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2019-08-18 20:27:52 +0200
committerEmilio Jesus Gallego Arias2019-08-19 23:03:45 +0200
commita74e055acf48583c6fece5d22c805736679376b2 (patch)
treebc86b65608590013d7569b9585cd37029f2fa274 /library
parent7f9a08b98b1637291dda687fce92198a21ffc395 (diff)
[api] Move handling of variable implicit data to impargs
We move `binder_kind` to the pretyping AST, removing the last data type in the now orphaned file `Decl_kinds`. This seems a better fit, as this data is not relevant to the lower layers but only used in `Impargs`. We also move state keeping to `Impargs`, so now implicit declaration must include the type. We also remove a duplicated function.
Diffstat (limited to 'library')
-rw-r--r--library/decl_kinds.ml11
-rw-r--r--library/lib.ml10
-rw-r--r--library/lib.mli3
-rw-r--r--library/library.mllib1
4 files changed, 3 insertions, 22 deletions
diff --git a/library/decl_kinds.ml b/library/decl_kinds.ml
deleted file mode 100644
index 17746645ee..0000000000
--- a/library/decl_kinds.ml
+++ /dev/null
@@ -1,11 +0,0 @@
-(************************************************************************)
-(* * The Coq Proof Assistant / The Coq Development Team *)
-(* v * INRIA, CNRS and contributors - Copyright 1999-2019 *)
-(* <O___,, * (see CREDITS file for the list of authors) *)
-(* \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) *)
-(************************************************************************)
-
-type binding_kind = Explicit | Implicit
diff --git a/library/lib.ml b/library/lib.ml
index 6b01eb07e9..3f51826315 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -441,9 +441,6 @@ let empty_section_data ~poly = {
let sectab =
Summary.ref ([] : section_data list) ~name:"section-context"
-let sec_implicits =
- Summary.ref Id.Map.empty ~name:"section-implicits"
-
let check_same_poly p sec =
if p != sec.sec_poly then
user_err Pp.(str "Cannot mix universe polymorphic and monomorphic declarations in sections.")
@@ -452,14 +449,13 @@ let add_section ~poly () =
List.iter (fun tab -> check_same_poly poly tab) !sectab;
sectab := empty_section_data ~poly :: !sectab
-let add_section_variable ~name ~kind ~poly =
+let add_section_variable ~name ~poly =
match !sectab with
| [] -> () (* because (Co-)Fixpoint temporarily uses local vars *)
| s :: sl ->
List.iter (fun tab -> check_same_poly poly tab) !sectab;
let s = { s with sec_entry = Variable {id=name} :: s.sec_entry } in
- sectab := s :: sl;
- sec_implicits := Id.Map.add name kind !sec_implicits
+ sectab := s :: sl
let add_section_context ctx =
match !sectab with
@@ -576,8 +572,6 @@ let section_segment_of_reference = let open GlobRef in function
let variable_section_segment_of_reference gr =
(section_segment_of_reference gr).abstr_ctx
-let variable_section_kind id = Id.Map.get id !sec_implicits
-
let section_instance = let open GlobRef in function
| VarRef id ->
let eq = function
diff --git a/library/lib.mli b/library/lib.mli
index 7dc8b52282..9ffa69ef93 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -177,12 +177,11 @@ val section_segment_of_mutual_inductive: MutInd.t -> abstr_info
val section_segment_of_reference : GlobRef.t -> abstr_info
val variable_section_segment_of_reference : GlobRef.t -> Constr.named_context
-val variable_section_kind : Id.t -> Decl_kinds.binding_kind
val section_instance : GlobRef.t -> Univ.Instance.t * Id.t array
val is_in_section : GlobRef.t -> bool
-val add_section_variable : name:Id.t -> kind:Decl_kinds.binding_kind -> poly:bool -> unit
+val add_section_variable : name:Id.t -> poly:bool -> unit
val add_section_context : Univ.ContextSet.t -> unit
val add_section_constant : poly:bool -> Constant.t -> Constr.named_context -> unit
val add_section_kn : poly:bool -> MutInd.t -> Constr.named_context -> unit
diff --git a/library/library.mllib b/library/library.mllib
index 35af5fa43b..a3d78cc81b 100644
--- a/library/library.mllib
+++ b/library/library.mllib
@@ -1,4 +1,3 @@
-Decl_kinds
Libnames
Globnames
Libobject