aboutsummaryrefslogtreecommitdiff
path: root/kernel/safe_typing.ml
diff options
context:
space:
mode:
authorEnrico Tassi2014-10-10 17:12:30 +0200
committerEnrico Tassi2014-10-13 18:13:20 +0200
commite3a0a4d58b74d2113485ceabe4235567fda962c8 (patch)
tree9c9ebffea1f29b0339460a2f7a2bc545536bd4d0 /kernel/safe_typing.ml
parent6c2d8c3026c1baeb0ff731907747a9c216d60400 (diff)
selective join/export of the safe_environment
This generalizes the BuildVi flag and lets one choose which opaque proofs are done and which not.
Diffstat (limited to 'kernel/safe_typing.ml')
-rw-r--r--kernel/safe_typing.ml14
1 files changed, 7 insertions, 7 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml
index 11079d25b1..bef72340cb 100644
--- a/kernel/safe_typing.ml
+++ b/kernel/safe_typing.ml
@@ -238,10 +238,12 @@ let push_context ctx = add_constraints (Now (Univ.UContext.constraints ctx))
let is_curmod_library senv =
match senv.modvariant with LIBRARY -> true | _ -> false
-let join_safe_environment e =
- Modops.join_structure (Environ.opaque_tables e.env) e.revstruct;
+let join_safe_environment ?(except=Future.UUIDSet.empty) e =
+ Modops.join_structure except (Environ.opaque_tables e.env) e.revstruct;
List.fold_left
- (fun e fc -> add_constraints (Now (Future.join fc)) e)
+ (fun e fc ->
+ if Future.UUIDSet.mem (Future.uuid fc) except then e
+ else add_constraints (Now (Future.join fc)) e)
{e with future_cst = []} e.future_cst
(** {6 Various checks } *)
@@ -745,11 +747,9 @@ let start_library dir senv =
modvariant = LIBRARY;
imports = senv.imports }
-let export compilation_mode senv dir =
+let export ?except senv dir =
let senv =
- try
- if compilation_mode = Flags.BuildVi then { senv with future_cst = [] }
- else join_safe_environment senv
+ try join_safe_environment ?except senv
with e ->
let e = Errors.push e in
Errors.errorlabstrm "export" (Errors.print e)