aboutsummaryrefslogtreecommitdiffstats
path: root/src/QInst.v
diff options
context:
space:
mode:
authorChantal Keller <Chantal.Keller@lri.fr>2021-04-26 18:27:37 +0200
committerChantal Keller <Chantal.Keller@lri.fr>2021-04-26 18:27:37 +0200
commitcdadc5d338e3c00c4cd22a3a3d7197f71d4d7a44 (patch)
tree66697deb3845810897976e1eecbb5b88ad2bab09 /src/QInst.v
parent39b4d1d31c6446c937164039cac585dbe91b8b29 (diff)
downloadsmtcoq-cdadc5d338e3c00c4cd22a3a3d7197f71d4d7a44.tar.gz
smtcoq-cdadc5d338e3c00c4cd22a3a3d7197f71d4d7a44.zip
Equality between Booleans should be changed for hypotheses
Diffstat (limited to 'src/QInst.v')
-rw-r--r--src/QInst.v43
1 files changed, 42 insertions, 1 deletions
diff --git a/src/QInst.v b/src/QInst.v
index 4ebdcc9..4a4ddc2 100644
--- a/src/QInst.v
+++ b/src/QInst.v
@@ -29,7 +29,7 @@ Qed.
Hint Resolve impl_split.
-(* verit silently transforms an <implb (a || b) c> into a <or (not a) c>
+(** verit silently transforms an <implb (a || b) c> into a <or (not a) c>
or into a <or (not b) c> when instantiating such a quantified theorem *)
Lemma impl_or_split_right a b c:
implb (a || b) c = true -> negb b || c = true.
@@ -45,6 +45,35 @@ Proof.
destruct a; destruct c; intuition.
Qed.
+(** same for Boolean equivalence, modulo symmetry *)
+Lemma eqb_sym_or_split_right a b c:
+ Bool.eqb c (a || b) = true -> negb b || c = true.
+Proof.
+ intro H.
+ destruct a; destruct c; intuition.
+Qed.
+
+Lemma eqb_sym_or_split_left a b c:
+ Bool.eqb c (a || b) = true -> negb a || c = true.
+Proof.
+ intro H.
+ destruct a; destruct c; intuition.
+Qed.
+
+Lemma eqb_or_split_right a b c:
+ Bool.eqb (a || b) c = true -> negb b || c = true.
+Proof.
+ intro H.
+ destruct a; destruct c; intuition.
+Qed.
+
+Lemma eqb_or_split_left a b c:
+ Bool.eqb (a || b) c = true -> negb a || c = true.
+Proof.
+ intro H.
+ destruct a; destruct c; intuition.
+Qed.
+
(** verit considers equality modulo its symmetry, so we have to recover the
right direction in the instances of the theorems *)
(* TODO: currently incomplete *)
@@ -159,6 +188,18 @@ Ltac vauto :=
| eapply impl_or_split_left;
first [ strategy1 H
| strategy2 H ]
+ | eapply eqb_sym_or_split_right;
+ first [ strategy1 H
+ | strategy2 H ]
+ | eapply eqb_sym_or_split_left;
+ first [ strategy1 H
+ | strategy2 H ]
+ | eapply eqb_or_split_right;
+ first [ strategy1 H
+ | strategy2 H ]
+ | eapply eqb_or_split_left;
+ first [ strategy1 H
+ | strategy2 H ]
]
end
]