aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics
diff options
context:
space:
mode:
authorGravatar Jasper Hugunin <jasperh@cs.washington.edu>2018-02-17 07:35:57 -0800
committerGravatar Jasper Hugunin <jasperh@cs.washington.edu>2018-02-17 07:35:57 -0800
commit5968648f9e9db09de462dd8c3530febd66466312 (patch)
tree32b40e69b44345209042481fef71c26a4525f778 /tactics
parent8dd6d091ffbfa237f7266eeca60187263a9b521f (diff)
Implement name mangling option
Diffstat (limited to 'tactics')
-rw-r--r--tactics/tactics.ml11
1 files changed, 5 insertions, 6 deletions
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index 9fded04db..ae1b69516 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -411,12 +411,11 @@ let find_name mayrepl decl naming gl = match naming with
new_fresh_id idl (default_id env sigma decl) gl
| NamingBasedOn (id,idl) -> new_fresh_id idl id gl
| NamingMustBe (loc,id) ->
- (* When name is given, we allow to hide a global name *)
- let ids_of_hyps = Tacmach.New.pf_ids_set_of_hyps gl in
- let id' = next_ident_away id ids_of_hyps in
- if not mayrepl && not (Id.equal id' id) then
- user_err ?loc (Id.print id ++ str" is already used.");
- id
+ (* When name is given, we allow to hide a global name *)
+ let ids_of_hyps = Tacmach.New.pf_ids_set_of_hyps gl in
+ if not mayrepl && Id.Set.mem id ids_of_hyps then
+ user_err ?loc (Id.print id ++ str" is already used.");
+ id
(**************************************************************)
(* Computing position of hypotheses for replacing *)