Skip to content

Commit 59c4003

Browse files
authored
Extend the boolean_equality tactic (#429)
Handle constructors with 5, 6 and 7 arguments. Handle lists.
1 parent 971c8ea commit 59c4003

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

lib/BoolEqual.v

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,26 @@ Ltac bool_eq_base x y :=
6565
change (bool_eq x y);
6666
match goal with
6767
| [ H: forall (x y: ?A), bool |- @bool_eq ?A x y ] => exact (H x y)
68-
| [ H: forall (x y: ?A), {x=y} + {x<>y} |- @bool_eq ?A x y ] => exact (proj_sumbool (H x y))
68+
| [ H: forall (x y: ?A), {x=y} + {x<>y} |- @bool_eq ?A x y ] => exact (proj_sumbool (H x y))
69+
| [ H: forall (x y: ?A), {x=y} + {x<>y} |- @bool_eq (list ?A) x y ] => exact (proj_sumbool (list_eq_dec H x y))
6970
| _ => idtac
7071
end.
7172

7273
Ltac bool_eq_case :=
7374
match goal with
75+
| |- bool_eq (?C ?x1 ?x2 ?x3 ?x4 ?x5 ?x6 ?x7) (?C ?y1 ?y2 ?y3 ?y4 ?y5 ?y6 ?y7) =>
76+
refine (_ && _ && _ && _ && _ && _ && _);
77+
[bool_eq_base x1 y1|bool_eq_base x2 y2|bool_eq_base x3 y3|
78+
bool_eq_base x4 y4|bool_eq_base x5 y5|bool_eq_base x6 y6|
79+
bool_eq_base x7 y7]
80+
| |- bool_eq (?C ?x1 ?x2 ?x3 ?x4 ?x5 ?x6) (?C ?y1 ?y2 ?y3 ?y4 ?y5 ?y6) =>
81+
refine (_ && _ && _ && _ && _ && _);
82+
[bool_eq_base x1 y1|bool_eq_base x2 y2|bool_eq_base x3 y3|
83+
bool_eq_base x4 y4|bool_eq_base x5 y5|bool_eq_base x6 y6]
84+
| |- bool_eq (?C ?x1 ?x2 ?x3 ?x4 ?x5) (?C ?y1 ?y2 ?y3 ?y4 ?y5) =>
85+
refine (_ && _ && _ && _ && _);
86+
[bool_eq_base x1 y1|bool_eq_base x2 y2|bool_eq_base x3 y3|
87+
bool_eq_base x4 y4|bool_eq_base x5 y5]
7488
| |- bool_eq (?C ?x1 ?x2 ?x3 ?x4) (?C ?y1 ?y2 ?y3 ?y4) =>
7589
refine (_ && _ && _ && _); [bool_eq_base x1 y1|bool_eq_base x2 y2|bool_eq_base x3 y3|bool_eq_base x4 y4]
7690
| |- bool_eq (?C ?x1 ?x2 ?x3) (?C ?y1 ?y2 ?y3) =>

0 commit comments

Comments
 (0)