diff options
author | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-12-06 01:57:08 +0000 |
---|---|---|
committer | herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-12-06 01:57:08 +0000 |
commit | 3eb1ae56f9f2ee380e6cc323ab2cbaeb45cdf386 (patch) | |
tree | 39b1a03a999c49f5714d601d6379331561cb5105 /tactics | |
parent | 61002f54b95e5d947e48fa8df22bb5758df4422f (diff) |
Amélioration nommage hypothèses NewInduction (et incompatibilités)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2275 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics')
-rw-r--r-- | tactics/tactics.ml | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/tactics/tactics.ml b/tactics/tactics.ml index dc87c10f2..90c937dfe 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -1144,22 +1144,31 @@ let induct_discharge old_style mind statuslists cname destopt avoid ra gl = let tophyp = ref None in let n = List.fold_left (fun n b -> if b then n+1 else n) 0 ra in let recvarname = - if n=1 then +(* if n=1 then *) cname - else (* To force renumbering if there is only one *) - make_ident (string_of_id cname) (Some 1) +(* else (* To force renumbering if there is only one *) + make_ident (string_of_id cname) (Some 1)*) in let indhyp = if old_style then "Hrec" else "IH" in let hyprecname = add_prefix indhyp - (if old_style || atompart_of_id recvarname <> "H" then recvarname + (if old_style || atompart_of_id cname <> "H" then cname else (snd (Global.lookup_inductive mind)).mind_typename) in let avoid = - if old_style then avoid - else (* Forbid to use cname0 and hyprecname0 *) - (make_ident (string_of_id cname) (Some 0)) :: - (make_ident (string_of_id hyprecname) (Some 0)) :: avoid in + if n=1 + or old_style (* for compatibility *) + or n=0 +(* & atompart_of_id cname <> "H" (* for compatibility *)*) + then avoid (* Rem: n=0 if Desctruct *) + else (* Forbid to use cname, cname0, hyprecname and hyprecname0 *) + let avoid = + (make_ident (string_of_id cname) (Some 0)) :: (* here for compat *) + (make_ident (string_of_id hyprecname) None) :: + (make_ident (string_of_id hyprecname) (Some 0)) :: avoid in + if atompart_of_id cname <> "H" then + (make_ident (string_of_id cname) None) :: avoid + else avoid in let rec peel_tac = function | true :: ra' -> (* For lstatus but _buggy_: if intro_gen renames |