aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2017-01-21 18:41:28 -0500
committerGravatar Jason Gross <jgross@mit.edu>2017-01-21 18:41:28 -0500
commit7754c805fe7e956560bd5747f0324e22dc5b7bb7 (patch)
tree869ecd99f2b52c1545b8a9dbe7e2c219590a9e2b /src
parent2dd7e55c293cc458259a38683134cdfbe8cad018 (diff)
Add split_andb tactic
Diffstat (limited to 'src')
-rw-r--r--src/Util/Bool.v12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Util/Bool.v b/src/Util/Bool.v
index a59cf53f0..948e87417 100644
--- a/src/Util/Bool.v
+++ b/src/Util/Bool.v
@@ -57,3 +57,15 @@ Proof.
intros H; apply reflect_iff in H; intro b'; destruct b, b';
intuition congruence.
Qed.
+
+Definition andb_prop : forall a b : bool, a && b = true -> a = true /\ b = true. (* transparent version *)
+Proof. destruct a, b; simpl; split; try reflexivity; assumption. Defined.
+
+Ltac split_andb :=
+ repeat match goal with
+ | [ H : andb _ _ = true |- _ ] => apply andb_prop in H; destruct H
+ | [ H : is_true (andb ?x ?y) |- _ ]
+ => apply andb_prop in H;
+ change (is_true x /\ is_true y) in H;
+ destruct H
+ end.