aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorherbelin2003-10-13 08:29:59 +0000
committerherbelin2003-10-13 08:29:59 +0000
commit470b98867ebcd92cc62e61ad2910275bfc36fdea (patch)
treed1555229d56be194baa5a7f51dc4867fd1acde37 /pretyping
parent4230a3ce91b909adfc97748bfdaa19fc8f1b4a55 (diff)
Deplacement next_global_ident_away dans Termops
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@4605 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/termops.ml17
-rw-r--r--pretyping/termops.mli3
2 files changed, 19 insertions, 1 deletions
diff --git a/pretyping/termops.ml b/pretyping/termops.ml
index 13983126ad..a36be94fcd 100644
--- a/pretyping/termops.ml
+++ b/pretyping/termops.ml
@@ -693,6 +693,23 @@ let is_section_variable id =
try let _ = Sign.lookup_named id (Global.named_context()) in true
with Not_found -> false
+let next_global_ident_from allow_secvar id avoid =
+ let rec next_rec id =
+ let id = next_ident_away_from id avoid in
+ if (allow_secvar && is_section_variable id) || not (is_global id) then
+ id
+ else
+ next_rec (lift_ident id)
+ in
+ next_rec id
+
+let next_global_ident_away allow_secvar id avoid =
+ let id = next_ident_away id avoid in
+ if (allow_secvar && is_section_variable id) || not (is_global id) then
+ id
+ else
+ next_global_ident_from allow_secvar (lift_ident id) avoid
+
(* Nouvelle version de renommage des variables (DEC 98) *)
(* This is the algorithm to display distinct bound variables
diff --git a/pretyping/termops.mli b/pretyping/termops.mli
index 0f970706a3..317a375632 100644
--- a/pretyping/termops.mli
+++ b/pretyping/termops.mli
@@ -153,6 +153,8 @@ type used_idents = identifier list
val occur_rel : int -> name list -> identifier -> bool
val occur_id : name list -> identifier -> constr -> bool
+val next_global_ident_away :
+ (*allow section vars:*) bool -> identifier -> identifier list -> identifier
val next_name_not_occuring :
bool -> name -> identifier list -> name list -> constr -> identifier
val concrete_name :
@@ -183,4 +185,3 @@ val global_reference_in_absolute_module : dir_path -> identifier -> constr
(* Test if an identifier is the basename of a global reference *)
val is_global : identifier -> bool
-