From ba8a8f870f6d44e71ec18b02964daa97200e8610 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Thu, 27 Oct 2016 19:40:38 -0400 Subject: Add some rewrites and admitted lemmas --- src/Util/WordUtil.v | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/Util/WordUtil.v') diff --git a/src/Util/WordUtil.v b/src/Util/WordUtil.v index de5cd0847..3c52146dc 100644 --- a/src/Util/WordUtil.v +++ b/src/Util/WordUtil.v @@ -15,6 +15,8 @@ Create HintDb push_wordToN discriminated. Hint Extern 1 => autorewrite with pull_wordToN in * : pull_wordToN. Hint Extern 1 => autorewrite with push_wordToN in * : push_wordToN. +Ltac word_util_arith := omega. + Lemma pow2_id : forall n, pow2 n = 2 ^ n. Proof. induction n; intros; simpl; auto. @@ -268,3 +270,32 @@ Proof. | [ H : weqb _ _ = true |- _ ] => apply weqb_true_iff in H; subst end. Qed. + +Local Notation bounds_2statement wop Zop + := (forall {sz} (x y : word sz), + (Z.log2 (Z.of_N (wordToN x)) < Z.of_nat sz + -> Z.log2 (Z.of_N (wordToN y)) < Z.of_nat sz + -> 0 <= Zop (Z.of_N (wordToN x)) (Z.of_N (wordToN y)) + -> Z.log2 (Zop (Z.of_N (wordToN x)) (Z.of_N (wordToN y))) < Z.of_nat sz + -> Z.of_N (wordToN (wop x y)) = (Zop (Z.of_N (wordToN x)) (Z.of_N (wordToN y))))%Z). + +Lemma wordToN_wplus : bounds_2statement (@wplus _) Z.add. +Proof. + admit. +Admitted. +Hint Rewrite @wordToN_wplus using word_util_arith : push_wordToN. +Hint Rewrite <- @wordToN_wplus using word_util_arith : pull_wordToN. + +Lemma wordToN_wminus : bounds_2statement (@wminus _) Z.sub. +Proof. + admit. +Admitted. +Hint Rewrite @wordToN_wminus using word_util_arith : push_wordToN. +Hint Rewrite <- @wordToN_wminus using word_util_arith : pull_wordToN. + +Lemma wordToN_wmult : bounds_2statement (@wmult _) Z.mul. +Proof. + admit. +Admitted. +Hint Rewrite @wordToN_wmult using word_util_arith : push_wordToN. +Hint Rewrite <- @wordToN_wmult using word_util_arith : pull_wordToN. -- cgit v1.2.3