summaryrefslogtreecommitdiff
path: root/lib/coq/Sail2_values.v
diff options
context:
space:
mode:
authorBrian Campbell2019-02-20 09:55:19 +0000
committerBrian Campbell2019-02-28 17:16:10 +0000
commit2fd45fa939ddae7cdb31ee0495e622e6e6a6235f (patch)
treefd12b7886a866516bdd9927728428161b2359dc3 /lib/coq/Sail2_values.v
parentfb362fcb5671b6f008794d0a7db31b1f2685e413 (diff)
Coq: some work on bool simplification
This introduces some simplification of informative booleans, but tries too hard to eliminate all of the existentials resulting in difficulties in and/or trees.
Diffstat (limited to 'lib/coq/Sail2_values.v')
-rw-r--r--lib/coq/Sail2_values.v10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/coq/Sail2_values.v b/lib/coq/Sail2_values.v
index 943d850a..bd2c0fdb 100644
--- a/lib/coq/Sail2_values.v
+++ b/lib/coq/Sail2_values.v
@@ -64,6 +64,16 @@ Lemma projBool_false {P:Prop} {b:Bool P} : projBool b = false <-> ~P.
destruct b; simpl; intuition.
Qed.
+Definition and_boolB {P Q} (l : Bool P) (r : Bool Q) : Bool (P /\ Q).
+refine (if l then if r then left _ else right _ else right _).
+all: tauto.
+Defined.
+
+Definition or_boolB {P Q} (l : Bool P) (r : Bool Q) : Bool (P \/ Q).
+refine (if l then left _ else if r then left _ else right _).
+all: tauto.
+Defined.
+
Definition generic_eq {T:Type} (x y:T) `{Decidable (x = y)} := Decidable_witness.
Definition generic_neq {T:Type} (x y:T) `{Decidable (x = y)} := negb Decidable_witness.