diff options
author | 2010-06-30 18:24:56 +0000 | |
---|---|---|
committer | 2010-06-30 18:24:56 +0000 | |
commit | 13e53564fdc4beb14bd04612214a648630549417 (patch) | |
tree | f5f5109dca2e5e8dd093432304e995ff6f3014ad /tactics | |
parent | 889589ab6f03d09e7187e50e29e9720ef1134c46 (diff) |
Fix generalize_eqs tactic to not consider defined variables as being generalizable.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13226 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics')
-rw-r--r-- | tactics/tactics.ml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 9f5c61123..bcebe1629 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -2321,6 +2321,9 @@ let linear vars args = true with Seen -> false +let is_defined_variable env id = + pi2 (lookup_named id env) <> None + let abstract_args gl generalize_vars dep id defined f args = let sigma = project gl in let env = pf_env gl in @@ -2348,7 +2351,7 @@ let abstract_args gl generalize_vars dep id defined f args = let liftargty = lift lenctx argty in let leq = constr_cmp Reduction.CUMUL liftargty ty in match kind_of_term arg with - | Var id when leq && not (Idset.mem id nongenvars) -> + | Var id when not (is_defined_variable env id) && leq && not (Idset.mem id nongenvars) -> (subst1 arg arity, ctx, ctxenv, mkApp (c, [|arg|]), args, eqs, refls, Idset.add id nongenvars, Idset.remove id vars, env) | _ -> @@ -2375,7 +2378,7 @@ let abstract_args gl generalize_vars dep id defined f args = let parvars = ids_of_constr ~all:true Idset.empty f' in if not (linear parvars args') then true, f, args else - match array_find_i (fun i x -> not (isVar x)) args' with + match array_find_i (fun i x -> not (isVar x) || is_defined_variable env (destVar x)) args' with | None -> false, f', args' | Some nonvar -> let before, after = array_chop nonvar args' in |