aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
authorherbelin2009-03-22 22:01:32 +0000
committerherbelin2009-03-22 22:01:32 +0000
commit3a8946b8b1a77941f02e80230286280ee86d23a0 (patch)
treec40749605c5d1edba8cd81101569feebd805089a /tactics
parent171bb32cd6eb1e0f93d10d90d3c81bb3ecc4f6d0 (diff)
Backport from v8.2 branch of 11986 (interpretation of quantified
hypotheses in induction, unbalanced parenthesis in ltac call stack printer) and 12003 (late update of CREDITS) + update of magic numbers (using a somehow arbitrary value between the 8.2 magic numbers and the possibly forthcoming 8.3 magic numbers). git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12007 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics')
-rw-r--r--tactics/tacinterp.ml22
1 files changed, 17 insertions, 5 deletions
diff --git a/tactics/tacinterp.ml b/tactics/tacinterp.ml
index a348731660..d926684b31 100644
--- a/tactics/tacinterp.ml
+++ b/tactics/tacinterp.ml
@@ -542,7 +542,9 @@ let intern_induction_arg ist = function
| ElimOnIdent (loc,id) ->
if !strict_check then
(* If in a defined tactic, no intros-until *)
- ElimOnConstr (intern_constr ist (CRef (Ident (dloc,id))),NoBindings)
+ match intern_constr ist (CRef (Ident (dloc,id))) with
+ | RVar (loc,id),_ -> ElimOnIdent (loc,id)
+ | c -> ElimOnConstr (c,NoBindings)
else
ElimOnIdent (loc,id)
@@ -1722,10 +1724,20 @@ let interp_induction_arg ist gl = function
| ElimOnConstr c -> ElimOnConstr (interp_constr_with_bindings ist gl c)
| ElimOnAnonHyp n as x -> x
| ElimOnIdent (loc,id) ->
- if Tactics.is_quantified_hypothesis id gl then ElimOnIdent (loc,id)
- else ElimOnConstr
- (pf_interp_constr ist gl (RVar (loc,id),Some (CRef (Ident (loc,id)))),
- NoBindings)
+ try
+ match List.assoc id ist.lfun with
+ | VInteger n -> ElimOnAnonHyp n
+ | VIntroPattern (IntroIdentifier id) -> ElimOnIdent (loc,id)
+ | VConstr c -> ElimOnConstr (c,NoBindings)
+ | _ -> user_err_loc (loc,"",
+ strbrk "Cannot coerce " ++ pr_id id ++
+ strbrk " neither to a quantified hypothesis nor to a term.")
+ with Not_found ->
+ (* Interactive mode *)
+ if Tactics.is_quantified_hypothesis id gl then ElimOnIdent (loc,id)
+ else ElimOnConstr
+ (pf_interp_constr ist gl (RVar (loc,id),Some (CRef (Ident (loc,id)))),
+ NoBindings)
let mk_constr_value ist gl c = VConstr (pf_interp_constr ist gl c)
let mk_hyp_value ist gl c = VConstr (mkVar (interp_hyp ist gl c))