aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGaëtan Gilbert2018-06-23 15:38:00 +0200
committerGaëtan Gilbert2018-07-24 13:49:17 +0200
commit0108db19c96e1b46346f032964f2cca3f8149cb3 (patch)
tree6414910c08328fceeb45c82414bea1ee0b601c91 /library
parent7817af48a554573fb649028263ecfc0fabe400d8 (diff)
Projections use index representation
The upper layers still need a mapping constant -> projection, which is provided by Recordops.
Diffstat (limited to 'library')
-rw-r--r--library/lib.ml8
-rw-r--r--library/lib.mli1
2 files changed, 9 insertions, 0 deletions
diff --git a/library/lib.ml b/library/lib.ml
index a20de55bf6..8b83261e48 100644
--- a/library/lib.ml
+++ b/library/lib.ml
@@ -656,6 +656,14 @@ let discharge_kn kn =
let discharge_con cst =
if con_defined_in_sec cst then Globnames.pop_con cst else cst
+let discharge_proj_repr =
+ Projection.Repr.map_npars (fun mind npars ->
+ if not (defined_in_sec mind) then mind, npars
+ else
+ let modlist = replacement_context () in
+ let _, newpars = Mindmap.find mind (snd modlist) in
+ Globnames.pop_kn mind, npars + Array.length newpars)
+
let discharge_inductive (kn,i) =
(discharge_kn kn,i)
diff --git a/library/lib.mli b/library/lib.mli
index 5abfccfc7d..c6856a55b4 100644
--- a/library/lib.mli
+++ b/library/lib.mli
@@ -189,6 +189,7 @@ val replacement_context : unit -> Opaqueproof.work_list
val discharge_kn : MutInd.t -> MutInd.t
val discharge_con : Constant.t -> Constant.t
+val discharge_proj_repr : Projection.Repr.t -> Projection.Repr.t
val discharge_global : GlobRef.t -> GlobRef.t
val discharge_inductive : inductive -> inductive
val discharge_abstract_universe_context :