| 1 |
(** If [tac_in H] operates in [H] and leaves side-conditions before |
| 2 |
the original goal, then |
| 3 |
[side_conditions_before_to_side_conditions_after tac_in H] does |
| 4 |
the same thing to [H], but leaves side-conditions after the |
| 5 |
original goal. *) |
| 6 |
Ltac side_conditions_before_to_side_conditions_after tac_in H := |
| 7 |
let HT := type of H in |
| 8 |
let HTT := type of HT in |
| 9 |
let H' := fresh in |
| 10 |
rename H into H'; |
| 11 |
let HT' := fresh in |
| 12 |
evar (HT' : HTT); |
| 13 |
cut HT'; |
| 14 |
[ subst HT'; intro H |
| 15 |
| tac_in H'; |
| 16 |
[ .. |
| 17 |
| subst HT'; eexact H' ] ]; |
| 18 |
[ (* We preserve the order of the hypotheses. We need to do this |
| 19 |
here, after evars are instantiated, and not above. *) |
| 20 |
move H after H'; clear H' |
| 21 |
| .. ]. |