aboutsummaryrefslogtreecommitdiff
path: root/checker/safe_checking.ml
diff options
context:
space:
mode:
Diffstat (limited to 'checker/safe_checking.ml')
-rw-r--r--checker/safe_checking.ml22
1 files changed, 22 insertions, 0 deletions
diff --git a/checker/safe_checking.ml b/checker/safe_checking.ml
new file mode 100644
index 0000000000..90b5188d26
--- /dev/null
+++ b/checker/safe_checking.ml
@@ -0,0 +1,22 @@
+(************************************************************************)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <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) *)
+(************************************************************************)
+
+open Declarations
+open Environ
+
+let import clib univs digest =
+ let mb = Safe_typing.module_of_library clib in
+ let env = push_context_set ~strict:true mb.mod_constraints (Global.env ()) in
+ let env = push_context_set ~strict:true univs env in
+ Mod_checking.check_module env mb.mod_mp mb;
+ let _ = Global.import clib univs digest in ()
+
+let unsafe_import clib univs digest =
+ let _ = Global.import clib univs digest in ()