diff options
| -rw-r--r-- | parsing/pptactic.ml | 2 | ||||
| -rw-r--r-- | tactics/tactics.ml | 5 | ||||
| -rw-r--r-- | test-suite/success/apply.v | 11 |
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. + |
