aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorherbelin2009-10-25 21:16:51 +0000
committerherbelin2009-10-25 21:16:51 +0000
commit14893db7bda6542fa466508d962920ee64d3e45a (patch)
tree4920d09d5f2313c3b5cacc3a898c398a108d572e
parentfb956e945678e0c69766c219cd7ab026925a57ea (diff)
Restore (and test) broken chaining of lemmas in "apply in" in presence
of side conditions. Fix a small presentation issue in printing the "exists" tactic. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12416 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--parsing/pptactic.ml2
-rw-r--r--tactics/tactics.ml5
-rw-r--r--test-suite/success/apply.v11
3 files changed, 16 insertions, 2 deletions
diff --git a/parsing/pptactic.ml b/parsing/pptactic.ml
index d316a8b05f..a0c9a15ad7 100644
--- a/parsing/pptactic.ml
+++ b/parsing/pptactic.ml
@@ -820,7 +820,7 @@ and pr_atom1 = function
| TacLeft (ev,l) -> hov 1 (str (with_evars ev "left") ++ pr_bindings l)
| TacRight (ev,l) -> hov 1 (str (with_evars ev "right") ++ pr_bindings l)
| TacSplit (ev,false,l) -> hov 1 (str (with_evars ev "split") ++ prlist_with_sep pr_coma pr_bindings l)
- | TacSplit (ev,true,l) -> hov 1 (str (with_evars ev "exists") ++ prlist_with_sep pr_coma pr_ex_bindings l)
+ | TacSplit (ev,true,l) -> hov 1 (str (with_evars ev "exists") ++ prlist_with_sep (fun () -> str",") pr_ex_bindings l)
| TacAnyConstructor (ev,Some t) ->
hov 1 (str (with_evars ev "constructor") ++ pr_arg (pr_tac_level (latom,E)) t)
| TacAnyConstructor (ev,None) as t -> pr_atom0 t
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index b2f7a43744..f99da0247b 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -1392,9 +1392,12 @@ let as_tac id ipat = match ipat with
user_err_loc (loc,"", str "Disjunctive/conjunctive pattern expected")
| None -> tclIDTAC
+let tclMAPFIRST tacfun l =
+ List.fold_right (fun x -> tclTHENFIRST (tacfun x)) l tclIDTAC
+
let general_apply_in with_delta with_destruct with_evars id lemmas ipat gl =
tclTHENFIRST (* Skip the side conditions of the applied lemma *)
- (tclMAP (apply_in_once with_delta with_destruct with_evars id) lemmas)
+ (tclMAPFIRST (apply_in_once with_delta with_destruct with_evars id) lemmas)
(as_tac id ipat)
gl
diff --git a/test-suite/success/apply.v b/test-suite/success/apply.v
index c3d3b0e3b4..7f00417148 100644
--- a/test-suite/success/apply.v
+++ b/test-suite/success/apply.v
@@ -296,3 +296,14 @@ apply H in H0 as ->.
reflexivity.
exact I.
Qed.
+
+(* Check chaining of "apply in" on the last subgoal (assuming that
+ side conditions come first) *)
+
+Lemma chaining :
+ forall B C D : Prop, (True -> B -> C) -> (C -> D) -> B -> D.
+Proof.
+intros.
+apply H, H0 in H1; auto.
+Qed.
+