@@ -71,7 +71,7 @@ Local Ltac2 target_equals_goal_judgementally (target : constr) :=
7171 *)
7272
7373
74- Ltac2 guarantee_stated_goal_matches (sttd_goal : constr ) :=
74+ Local Ltac2 guarantee_stated_goal_matches (sttd_goal : constr ) :=
7575 let sttd_goal := correct_type_by_wrapping sttd_goal in
7676 let sttd_goal := (eval unfold subset_type, ge_op, R_ge_type, nat_ge_type, gt_op, R_gt_type, nat_gt_type in $sttd_goal) in
7777 let current_goal := Control.goal () in
@@ -145,7 +145,7 @@ Local Ltac2 core_conclude_by (xtr_lemmas : constr list) (xtr_dbs : hint_db_name
145145
146146(** Adaptation of [core_conclude_by] that turns the [FailedToUse] errors
147147 which might be thrown into user readable errors. *)
148- Ltac2 conclude_by (xtr_lemmas : constr list) (xtr_dbs : hint_db_name list) :=
148+ Local Ltac2 conclude_by (xtr_lemmas : constr list) (xtr_dbs : hint_db_name list) :=
149149 wrapper_core_by_tactic core_conclude_by xtr_lemmas xtr_dbs.
150150
151151(** Adaptation of [core_conclude_by] that allows user to use mathematical statements themselves
@@ -164,7 +164,7 @@ Local Ltac2 conclude_since (xtr_claim : constr) :=
164164 Does:
165165 - Removes the wrapper [StateGoal.Wrapper G].
166166 *)
167- Ltac2 unwrap_state_goal_no_check () :=
167+ Local Ltac2 unwrap_state_goal_no_check () :=
168168 lazy_match! goal with
169169 | [|- StateGoal.Wrapper _] => apply StateGoal.wrap
170170 | [|- VerifyGoal.Wrapper _] => apply VerifyGoal.wrap
@@ -203,12 +203,19 @@ Ltac2 Notation "It" "follows" _(opt("that")) target_goal(lconstr) :=
203203
204204 Arguments:
205205 - [target_goal: constr], expression that should equal the goal under focus.
206- - [xtr_lemma: constr], lemma that can be and has to be used for proof of [target_goal].
206+ - [xtr_lemmas: constr list], extra lemmas that can be used for proof of [target_goal].
207+ - [xtr_dbs: hint_db_name list], extra hint databases that can be used for proof of [target_goal].
207208
208209 Raises exceptions:
209210 - [AutomationFailure], if [waterprove] fails the prove the goal (i.e. the goal is too difficult, or does not hold).
210211 - [ConcludeError], if [target_goal] is not equivalent to the actual goal under focus, even after rewriting.
211212 *)
213+ Ltac2 wp_conclude_by_with_checks (target_goal : constr ) (xtr_lemmas : constr list) (xtr_dbs : hint_db_name list) :=
214+ unwrap_state_goal_no_check ();
215+ panic_if_goal_wrapped ();
216+ guarantee_stated_goal_matches target_goal;
217+ conclude_by xtr_lemmas xtr_dbs.
218+
212219Ltac2 Notation "Since" xtr_claim(lconstr) "we" "conclude" _(opt("that")) target_goal(lconstr) :=
213220 unwrap_state_goal_no_check ();
214221 panic_if_goal_wrapped ();
0 commit comments