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