| 1 |
Require Export Crypto.Util.FixCoqMistakes. |
| 2 |
|
| 3 |
Require Import Crypto.Util.Tactics.Head. |
| 4 |
Require Import Crypto.Util.Tactics.DestructHyps. |
| 5 |
|
| 6 |
Ltac destruct_head_matcher T HT := |
| 7 |
match head HT with |
| 8 |
| T => idtac |
| 9 |
end. |
| 10 |
Ltac destruct_head T := destruct_all_matches ltac:(destruct_head_matcher T). |
| 11 |
Ltac destruct_one_head T := destruct_one_match ltac:(destruct_head_matcher T). |
| 12 |
Ltac destruct_head' T := destruct_all_matches' ltac:(destruct_head_matcher T). |
| 13 |
Ltac destruct_one_head' T := destruct_one_match' ltac:(destruct_head_matcher T). |
| 14 |
|
| 15 |
Ltac inversion_head T := inversion_all_matches ltac:(destruct_head_matcher T). |
| 16 |
Ltac inversion_one_head T := inversion_one_match ltac:(destruct_head_matcher T). |
| 17 |
Ltac inversion_head' T := inversion_all_matches' ltac:(destruct_head_matcher T). |
| 18 |
Ltac inversion_one_head' T := inversion_one_match' ltac:(destruct_head_matcher T). |
| 19 |
|
| 20 |
|
| 21 |
Ltac head_hnf_matcher T HT := |
| 22 |
match head_hnf HT with |
| 23 |
| T => idtac |
| 24 |
end. |
| 25 |
Ltac destruct_head_hnf T := destruct_all_matches ltac:(head_hnf_matcher T). |
| 26 |
Ltac destruct_one_head_hnf T := destruct_one_match ltac:(head_hnf_matcher T). |
| 27 |
Ltac destruct_head_hnf' T := destruct_all_matches' ltac:(head_hnf_matcher T). |
| 28 |
Ltac destruct_one_head_hnf' T := destruct_one_match' ltac:(head_hnf_matcher T). |
| 29 |
|
| 30 |
Ltac inversion_head_hnf T := inversion_all_matches ltac:(head_hnf_matcher T). |
| 31 |
Ltac inversion_one_head_hnf T := inversion_one_match ltac:(head_hnf_matcher T). |
| 32 |
Ltac inversion_head_hnf' T := inversion_all_matches' ltac:(head_hnf_matcher T). |
| 33 |
Ltac inversion_one_head_hnf' T := inversion_one_match' ltac:(head_hnf_matcher T). |
| 34 |
|
| 35 |
(** Faster versions for some common connectives *) |
| 36 |
Ltac destruct_one_head'_ex := match goal with H : ex _ |- _ => destruct H end. |
| 37 |
Ltac destruct_one_head_ex := destruct_one_head'_ex; simpl in *. |
| 38 |
Ltac destruct_head'_ex := repeat destruct_one_head'_ex. |
| 39 |
Ltac destruct_head_ex := repeat destruct_one_head_ex. |
| 40 |
|
| 41 |
Ltac destruct_one_head'_sig := match goal with H : sig _ |- _ => destruct H end. |
| 42 |
Ltac destruct_one_head_sig := destruct_one_head'_sig; simpl in *. |
| 43 |
Ltac destruct_head'_sig := repeat destruct_one_head'_sig. |
| 44 |
Ltac destruct_head_sig := repeat destruct_one_head_sig. |
| 45 |
|
| 46 |
Ltac destruct_one_head'_sigT := match goal with H : sigT _ |- _ => destruct H end. |
| 47 |
Ltac destruct_one_head_sigT := destruct_one_head'_sigT; simpl in *. |
| 48 |
Ltac destruct_head'_sigT := repeat destruct_one_head'_sigT. |
| 49 |
Ltac destruct_head_sigT := repeat destruct_one_head_sigT. |
| 50 |
|
| 51 |
Ltac destruct_one_head'_prod := match goal with H : prod _ _ |- _ => destruct H end. |
| 52 |
Ltac destruct_one_head_prod := destruct_one_head'_prod; simpl in *. |
| 53 |
Ltac destruct_head'_prod := repeat destruct_one_head'_prod. |
| 54 |
Ltac destruct_head_prod := repeat destruct_one_head_prod. |
| 55 |
|
| 56 |
Ltac destruct_one_head'_and := match goal with H : and _ _ |- _ => destruct H end. |
| 57 |
Ltac destruct_one_head_and := destruct_one_head'_and; simpl in *. |
| 58 |
Ltac destruct_head'_and := repeat destruct_one_head'_and. |
| 59 |
Ltac destruct_head_and := repeat destruct_one_head_and. |
| 60 |
|
| 61 |
Ltac destruct_one_head'_or := match goal with H : or _ _ |- _ => destruct H end. |
| 62 |
Ltac destruct_one_head_or := destruct_one_head'_or; simpl in *. |
| 63 |
Ltac destruct_head'_or := repeat destruct_one_head'_or. |
| 64 |
Ltac destruct_head_or := repeat destruct_one_head_or. |
| 65 |
|
| 66 |
Ltac destruct_one_head'_sum := match goal with H : sum _ _ |- _ => destruct H end. |
| 67 |
Ltac destruct_one_head_sum := destruct_one_head'_sum; simpl in *. |
| 68 |
Ltac destruct_head'_sum := repeat destruct_one_head'_sum. |
| 69 |
Ltac destruct_head_sum := repeat destruct_one_head_sum. |
| 70 |
|
| 71 |
Ltac destruct_one_head'_unit := match goal with H : unit |- _ => clear H || destruct H end. |
| 72 |
Ltac destruct_one_head_unit := destruct_one_head'_unit; simpl in *. |
| 73 |
Ltac destruct_head'_unit := repeat destruct_one_head'_unit. |
| 74 |
Ltac destruct_head_unit := repeat destruct_one_head_unit. |
| 75 |
|
| 76 |
Ltac destruct_one_head'_True := match goal with H : True |- _ => clear H || destruct H end. |
| 77 |
Ltac destruct_one_head_True := destruct_one_head'_True; simpl in *. |
| 78 |
Ltac destruct_head'_True := repeat destruct_one_head'_True. |
| 79 |
Ltac destruct_head_True := repeat destruct_one_head_True. |
| 80 |
|
| 81 |
Ltac destruct_one_head'_bool := match goal with H : bool |- _ => clear H || destruct H end. |
| 82 |
Ltac destruct_one_head_bool := destruct_one_head'_bool; simpl in *. |
| 83 |
Ltac destruct_head'_bool := repeat destruct_one_head'_bool. |
| 84 |
Ltac destruct_head_bool := repeat destruct_one_head_bool. |
| 85 |
|
| 86 |
Ltac destruct_one_head'_False := match goal with H : False |- _ => destruct H end. |
| 87 |
Ltac destruct_one_head_False := destruct_one_head'_False; simpl in *. |
| 88 |
Ltac destruct_head'_False := repeat destruct_one_head'_False. |
| 89 |
Ltac destruct_head_False := repeat destruct_one_head_False. |
| 90 |
|
| 91 |
Ltac destruct_one_head'_Empty_set := match goal with H : Empty_set |- _ => destruct H end. |
| 92 |
Ltac destruct_one_head_Empty_set := destruct_one_head'_Empty_set; simpl in *. |
| 93 |
Ltac destruct_head'_Empty_set := repeat destruct_one_head'_Empty_set. |
| 94 |
Ltac destruct_head_Empty_set := repeat destruct_one_head_Empty_set. |