diff options
author | 2016-10-18 10:58:42 +0200 | |
---|---|---|
committer | 2016-10-19 13:48:52 +0200 | |
commit | 7b4dbbb83e3da2fe716dacad627ddd3497653f07 (patch) | |
tree | 2d3d81fc36bc1180e2244fa9a02b8e7ae8516d2f | |
parent | ad81c04a923c594b7a893f08bb5571a6db74c92a (diff) |
CLEANUP: rename "Nameops.lift_subscript" to "Nameops.increment_subscript".
The word "increment" is more appropriate in this case than "lifting".
The world "lifting", in computer science, usually denotes something else:
https://en.wikipedia.org/wiki/Lambda_lifting
-rw-r--r-- | dev/doc/changes.txt | 1 | ||||
-rw-r--r-- | engine/namegen.ml | 2 | ||||
-rw-r--r-- | interp/implicit_quantifiers.ml | 2 | ||||
-rw-r--r-- | library/nameops.ml | 2 | ||||
-rw-r--r-- | library/nameops.mli | 6 | ||||
-rw-r--r-- | plugins/extraction/common.ml | 2 | ||||
-rw-r--r-- | plugins/funind/merge.ml | 2 |
7 files changed, 9 insertions, 8 deletions
diff --git a/dev/doc/changes.txt b/dev/doc/changes.txt index faf4b4c31..c00167b62 100644 --- a/dev/doc/changes.txt +++ b/dev/doc/changes.txt @@ -10,6 +10,7 @@ We renamed the following functions: Context.Named.Declaration.fold -> Context.Named.Declaration.fold_constr Printer.pr_var_list_decl -> Printer.pr_compacted_decl Printer.pr_var_decl -> Printer.pr_named_decl + Nameops.lift_subscript -> Nameops.increment_subscript We removed the following functions: diff --git a/engine/namegen.ml b/engine/namegen.ml index 1497dbda8..8ab2fdd82 100644 --- a/engine/namegen.ml +++ b/engine/namegen.ml @@ -170,7 +170,7 @@ let it_mkLambda_or_LetIn_name env b hyps = (* Looks for next "good" name by lifting subscript *) let next_ident_away_from id bad = - let rec name_rec id = if bad id then name_rec (lift_subscript id) else id in + let rec name_rec id = if bad id then name_rec (increment_subscript id) else id in name_rec id (* Restart subscript from x0 if name starts with xN, or x00 if name diff --git a/interp/implicit_quantifiers.ml b/interp/implicit_quantifiers.ml index bfa01532f..77a8ed680 100644 --- a/interp/implicit_quantifiers.ml +++ b/interp/implicit_quantifiers.ml @@ -188,7 +188,7 @@ let generalizable_vars_of_glob_constr ?(bound=Id.Set.empty) ?(allowed=Id.Set.emp vars let rec make_fresh ids env x = - if is_freevar ids env x then x else make_fresh ids env (Nameops.lift_subscript x) + if is_freevar ids env x then x else make_fresh ids env (Nameops.increment_subscript x) let next_name_away_from na avoid = match na with diff --git a/library/nameops.ml b/library/nameops.ml index 71405d024..f3c257001 100644 --- a/library/nameops.ml +++ b/library/nameops.ml @@ -69,7 +69,7 @@ let root_of_id id = (* Rem: semantics is a bit different, if an ident starts with toto00 then after successive renamings it comes to toto09, then it goes on with toto10 *) -let lift_subscript id = +let increment_subscript id = let id = Id.to_string id in let len = String.length id in let rec add carrypos = diff --git a/library/nameops.mli b/library/nameops.mli index 39ce409bc..a1ea0231f 100644 --- a/library/nameops.mli +++ b/library/nameops.mli @@ -21,9 +21,9 @@ val root_of_id : Id.t -> Id.t (** remove trailing digits, ' and _ *) val add_suffix : Id.t -> string -> Id.t val add_prefix : string -> Id.t -> Id.t -val has_subscript : Id.t -> bool -val lift_subscript : Id.t -> Id.t -val forget_subscript : Id.t -> Id.t +val has_subscript : Id.t -> bool +val increment_subscript : Id.t -> Id.t +val forget_subscript : Id.t -> Id.t val out_name : Name.t -> Id.t (** [out_name] associates [id] to [Name id]. Raises [Failure "Nameops.out_name"] diff --git a/plugins/extraction/common.ml b/plugins/extraction/common.ml index 3c5f6cb72..9446cf667 100644 --- a/plugins/extraction/common.ml +++ b/plugins/extraction/common.ml @@ -145,7 +145,7 @@ type env = Id.t list * Id.Set.t (*s Generic renaming issues for local variable names. *) let rec rename_id id avoid = - if Id.Set.mem id avoid then rename_id (lift_subscript id) avoid else id + if Id.Set.mem id avoid then rename_id (increment_subscript id) avoid else id let rec rename_vars avoid = function | [] -> diff --git a/plugins/funind/merge.ml b/plugins/funind/merge.ml index 7cbe787c3..19c2ed417 100644 --- a/plugins/funind/merge.ml +++ b/plugins/funind/merge.ml @@ -81,7 +81,7 @@ let ident_global_exist id = global env) with base [id]. *) let next_ident_fresh (id:Id.t) = let res = ref id in - while ident_global_exist !res do res := Nameops.lift_subscript !res done; + while ident_global_exist !res do res := Nameops.increment_subscript !res done; !res |