Skip to content

Commit 3927843

Browse files
committed
Reduce the checking time for the "decidable_equality_from" tactic
Just moved a frequent failure case ahead of a costly "simpl".
1 parent 2696f9b commit 3927843

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/BoolEqual.v

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ Ltac bool_eq_refl_case :=
106106
end.
107107

108108
Ltac bool_eq_refl :=
109-
let H := fresh "Hrec" in let x := fresh "x" in
110-
fix H 1; intros x; destruct x; simpl; bool_eq_refl_case.
109+
let Hrec := fresh "Hrec" in let x := fresh "x" in
110+
fix Hrec 1; intros x; destruct x; simpl; bool_eq_refl_case.
111111

112112
Lemma false_not_true:
113113
forall (P: Prop), false = true -> P.
@@ -124,7 +124,6 @@ Qed.
124124

125125
Ltac bool_eq_sound_case :=
126126
match goal with
127-
| [ H: false = true |- _ ] => exact (false_not_true _ H)
128127
| [ H: _ && _ = true |- _ ] => apply andb_prop in H; destruct H; bool_eq_sound_case
129128
| [ H: proj_sumbool ?a = true |- _ ] => apply proj_sumbool_true in H; bool_eq_sound_case
130129
| [ |- ?C ?x1 ?x2 ?x3 ?x4 = ?C ?y1 ?y2 ?y3 ?y4 ] => apply f_equal4; auto
@@ -137,7 +136,9 @@ Ltac bool_eq_sound_case :=
137136

138137
Ltac bool_eq_sound :=
139138
let Hrec := fresh "Hrec" in let x := fresh "x" in let y := fresh "y" in
140-
fix Hrec 1; intros x y; destruct x, y; simpl; intro; bool_eq_sound_case.
139+
let H := fresh "EQ" in
140+
fix Hrec 1; intros x y; destruct x, y; intro H;
141+
try (apply (false_not_true _ H)); simpl in H; bool_eq_sound_case.
141142

142143
Lemma dec_eq_from_bool_eq:
143144
forall (A: Type) (f: A -> A -> bool)

0 commit comments

Comments
 (0)