diff options
| author | Pierre-Marie Pédrot | 2018-12-18 10:21:00 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2018-12-18 10:21:00 +0100 |
| commit | 5dffdc66a47acd919c148e2e774252b4b4b51859 (patch) | |
| tree | 7e9e1d24af8749139d7f269adc638faffbcaf7de /tactics | |
| parent | 74313ad1ce4693ed197ada385edbdec2b7ce5a81 (diff) | |
| parent | c028333ee53d943f16bd30f1802afa1a313f857d (diff) | |
Merge PR #9160: Avoid user-given names in automatic introduction of binders
Diffstat (limited to 'tactics')
| -rw-r--r-- | tactics/tactics.ml | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 0756344ba3..b1f2ceee57 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -1063,9 +1063,16 @@ let intros_replacing ids = (* The standard for implementing Automatic Introduction *) let auto_intros_tac ids = - Tacticals.New.tclMAP (function - | Name id -> intro_mustbe_force id - | Anonymous -> intro) (List.rev ids) + let fold used = function + | Name id -> Id.Set.add id used + | Anonymous -> used + in + let avoid = NamingAvoid (List.fold_left fold Id.Set.empty ids) in + let naming = function + | Name id -> NamingMustBe CAst.(make id) + | Anonymous -> avoid + in + Tacticals.New.tclMAP (fun name -> intro_gen (naming name) MoveLast true false) (List.rev ids) (* User-level introduction tactics *) |
