| 1 |
Require Import Crypto.Util.Tactics.Test. |
| 2 |
Require Import Crypto.Util.Tactics.Not. |
| 3 |
Require Export Crypto.Util.FixCoqMistakes. |
| 4 |
|
| 5 |
(** Do something with every hypothesis. *) |
| 6 |
Ltac do_with_hyp' tac := |
| 7 |
match goal with |
| 8 |
| [ H : _ |- _ ] => tac H |
| 9 |
end. |
| 10 |
|
| 11 |
(** Do something with any hypothesis, as long as there is only one hypothesis that it works with *) |
| 12 |
Ltac do_with_exactly_one_hyp tac := |
| 13 |
match goal with |
| 14 |
| [ H : _ |- _ ] |
| 15 |
=> test (tac H); |
| 16 |
not (idtac; match goal with |
| 17 |
| [ H' : _ |- _ ] => tryif constr_eq H H' then fail else tac H' |
| 18 |
end); |
| 19 |
tac H |
| 20 |
end. |