summaryrefslogtreecommitdiff
path: root/kernel/safe_typing.mli
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
committerGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2004-07-28 21:54:47 +0000
commit6b649aba925b6f7462da07599fe67ebb12a3460e (patch)
tree43656bcaa51164548f3fa14e5b10de5ef1088574 /kernel/safe_typing.mli
Imported Upstream version 8.0pl1upstream/8.0pl1
Diffstat (limited to 'kernel/safe_typing.mli')
-rw-r--r--kernel/safe_typing.mli127
1 files changed, 127 insertions, 0 deletions
diff --git a/kernel/safe_typing.mli b/kernel/safe_typing.mli
new file mode 100644
index 00000000..84b98984
--- /dev/null
+++ b/kernel/safe_typing.mli
@@ -0,0 +1,127 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(*i $Id: safe_typing.mli,v 1.33.2.1 2004/07/16 19:30:26 herbelin Exp $ i*)
+
+(*i*)
+open Names
+open Term
+open Declarations
+open Entries
+(*i*)
+
+(*s Safe environments. Since we are now able to type terms, we can
+ define an abstract type of safe environments, where objects are
+ typed before being added.
+
+ We also add [open_structure] and [close_section], [close_module] to
+ provide functionnality for sections and interactive modules
+*)
+
+type safe_environment
+
+val env_of_safe_env : safe_environment -> Environ.env
+
+val empty_environment : safe_environment
+
+(* Adding and removing local declarations (Local or Variables) *)
+val push_named_assum :
+ identifier * types -> safe_environment ->
+ Univ.constraints * safe_environment
+val push_named_def :
+ identifier * constr * types option -> safe_environment ->
+ Univ.constraints * safe_environment
+
+(* Adding global axioms or definitions *)
+type global_declaration =
+ | ConstantEntry of constant_entry
+ | GlobalRecipe of Cooking.recipe
+
+val add_constant :
+ dir_path -> label -> global_declaration -> safe_environment ->
+ kernel_name * safe_environment
+
+(* Adding an inductive type *)
+val add_mind :
+ dir_path -> label -> mutual_inductive_entry -> safe_environment ->
+ mutual_inductive * safe_environment
+
+(* Adding a module *)
+val add_module :
+ label -> module_entry -> safe_environment
+ -> module_path * safe_environment
+
+(* Adding a module type *)
+val add_modtype :
+ label -> module_type_entry -> safe_environment
+ -> kernel_name * safe_environment
+
+(* Adding universe constraints *)
+val add_constraints :
+ Univ.constraints -> safe_environment -> safe_environment
+
+(* Settin the strongly constructive or classical logical engagement *)
+val set_engagement : Environ.engagement -> safe_environment -> safe_environment
+
+
+(*s Interactive module functions *)
+val start_module :
+ label -> (mod_bound_id * module_type_entry) list
+ -> module_type_entry option
+ -> safe_environment -> module_path * safe_environment
+
+val end_module :
+ label -> safe_environment -> module_path * safe_environment
+
+
+val start_modtype :
+ label -> (mod_bound_id * module_type_entry) list
+ -> safe_environment -> module_path * safe_environment
+
+val end_modtype :
+ label -> safe_environment -> kernel_name * safe_environment
+
+
+val current_modpath : safe_environment -> module_path
+val current_msid : safe_environment -> mod_self_id
+
+
+(* Loading and saving compilation units *)
+
+(* exporting and importing modules *)
+type compiled_library
+
+val start_library : dir_path -> safe_environment
+ -> module_path * safe_environment
+
+val export : safe_environment -> dir_path
+ -> mod_self_id * compiled_library
+
+val import : compiled_library -> Digest.t -> safe_environment
+ -> module_path * safe_environment
+
+(* Remove the body of opaque constants *)
+
+val lighten_library : compiled_library -> compiled_library
+
+(*s Typing judgments *)
+
+type judgment
+
+val j_val : judgment -> constr
+val j_type : judgment -> constr
+
+(* Safe typing of a term returning a typing judgment and universe
+ constraints to be added to the environment for the judgment to
+ hold. It is guaranteed that the constraints are satisfiable
+ *)
+val safe_infer : safe_environment -> constr -> judgment * Univ.constraints
+
+val typing : safe_environment -> constr -> judgment
+
+