aboutsummaryrefslogtreecommitdiff
path: root/tactics
diff options
context:
space:
mode:
authorHugo Herbelin2020-04-24 22:12:20 +0200
committerHugo Herbelin2020-11-20 10:45:02 +0100
commitefecceaaba8fc1fc447ce502ef64ac8d66544a0d (patch)
tree0783ab290d2b08ec2c919fc8cb1e11834d0f696c /tactics
parent57c85b0d54e54ca33238399cab3285ef34d4edd2 (diff)
Granting #9816: apply in takes several hypotheses.
Diffstat (limited to 'tactics')
-rw-r--r--tactics/tactics.ml11
-rw-r--r--tactics/tactics.mli2
2 files changed, 7 insertions, 6 deletions
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index e3369bc9be..8b38bc1b0a 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -2635,7 +2635,7 @@ let assert_as first hd ipat t =
(* apply in as *)
let general_apply_in ?(respect_opaque=false) with_delta
- with_destruct with_evars id lemmas ipat =
+ with_destruct with_evars id lemmas ipat then_tac =
let tac (naming,lemma) tac id =
apply_in_delayed_once ~respect_opaque with_delta
with_destruct with_evars naming id lemma tac in
@@ -2653,7 +2653,8 @@ let general_apply_in ?(respect_opaque=false) with_delta
List.map (fun lem -> (NamingMustBe (CAst.make id),lem)) first, (naming,last)
in
(* We chain apply_in_once, ending with an intro pattern *)
- List.fold_right tac lemmas_target (tac last_lemma_target ipat_tac) id
+ List.fold_right tac lemmas_target
+ (tac last_lemma_target (fun id -> Tacticals.New.tclTHEN (ipat_tac id) then_tac)) id
end
(*
@@ -2666,10 +2667,10 @@ let general_apply_in ?(respect_opaque=false) with_delta
let apply_in simple with_evars id lemmas ipat =
let lemmas = List.map (fun (k,{CAst.loc;v=l}) -> k, CAst.make ?loc (fun _ sigma -> (sigma,l))) lemmas in
- general_apply_in simple simple with_evars id lemmas ipat
+ general_apply_in simple simple with_evars id lemmas ipat Tacticals.New.tclIDTAC
-let apply_delayed_in simple with_evars id lemmas ipat =
- general_apply_in ~respect_opaque:true simple simple with_evars id lemmas ipat
+let apply_delayed_in simple with_evars id lemmas ipat then_tac =
+ general_apply_in ~respect_opaque:true simple simple with_evars id lemmas ipat then_tac
(*****************************)
(* Tactics abstracting terms *)
diff --git a/tactics/tactics.mli b/tactics/tactics.mli
index 54c781af5c..0fd2f1253f 100644
--- a/tactics/tactics.mli
+++ b/tactics/tactics.mli
@@ -233,7 +233,7 @@ val apply_in :
val apply_delayed_in :
advanced_flag -> evars_flag -> Id.t ->
(clear_flag * delayed_open_constr_with_bindings CAst.t) list ->
- intro_pattern option -> unit Proofview.tactic
+ intro_pattern option -> unit Proofview.tactic -> unit Proofview.tactic
(** {6 Elimination tactics. } *)