diff options
| author | Jasper Hugunin | 2018-12-12 22:22:33 -0800 |
|---|---|---|
| committer | Jasper Hugunin | 2018-12-15 20:58:36 -0800 |
| commit | c028333ee53d943f16bd30f1802afa1a313f857d (patch) | |
| tree | cc8623c41aa1dedd6a9f4e0759c0e0f662bed005 /tactics | |
| parent | 2a7992f75c86a15512568ac61ca4c43e23242b28 (diff) | |
Avoid explicit names in binders for automatic intros
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 9e9d52b72c..5b1d7dabba 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 *) |
