aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorherbelin2001-05-25 06:22:08 +0000
committerherbelin2001-05-25 06:22:08 +0000
commite6ba2e83fe0cb5e2fc53844bd0f5fe4b6d8ffb97 (patch)
treecd8129b18ea71d58dde99ae1aeb9d01bcd6295fd /kernel
parentdc2e676c9cdedea43805c21a4b3203832a985f95 (diff)
Remplacement push_rec_types (Rel) pour Fix parpush_named_rec_types
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1762 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/environ.ml11
-rw-r--r--kernel/environ.mli5
2 files changed, 15 insertions, 1 deletions
diff --git a/kernel/environ.ml b/kernel/environ.ml
index ac813e233e..db187880ff 100644
--- a/kernel/environ.ml
+++ b/kernel/environ.ml
@@ -131,6 +131,17 @@ let push_rec_types (lna,typarray,_) env =
Array.fold_left
(fun e assum -> push_rel_assum assum e) env ctxt
+let push_named_rec_types (lna,typarray,_) env =
+ let ctxt =
+ array_map2_i
+ (fun i na t ->
+ match na with
+ | Name id -> (id, type_app (lift i) t)
+ | Anonymous -> anomaly "Fix declarations must be named")
+ lna typarray in
+ Array.fold_left
+ (fun e assum -> push_named_assum assum e) env ctxt
+
let reset_rel_context env =
{ env with
env_context = { env_named_context = env.env_context.env_named_context;
diff --git a/kernel/environ.mli b/kernel/environ.mli
index adbbf0c5ce..ca93b84e78 100644
--- a/kernel/environ.mli
+++ b/kernel/environ.mli
@@ -54,9 +54,12 @@ val names_of_rel_context : env -> names_context
(*s Returns also the substitution to be applied to rel's *)
val push_rel_context_to_named_context : env -> constr list * env
-(*s Push the types of a (co-)fixpoint *)
+(*s Push the types of a (co-)fixpoint to [rel_context] *)
val push_rec_types : rec_declaration -> env -> env
+(*s Push the types of a (co-)fixpoint to [named_context] *)
+val push_named_rec_types : rec_declaration -> env -> env
+
(* Gives identifiers in [named_context] and [rel_context] *)
val ids_of_context : env -> identifier list
val map_context : (constr -> constr) -> env -> env