From cf7c7901d5c9ab3623537087cd98e204d703ac27 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Thu, 27 Oct 2016 19:13:36 -0400 Subject: Add beginnings of various interpretations of expression trees --- src/Util/WordUtil.v | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Util/WordUtil.v') diff --git a/src/Util/WordUtil.v b/src/Util/WordUtil.v index 2a3c48fcf..de5cd0847 100644 --- a/src/Util/WordUtil.v +++ b/src/Util/WordUtil.v @@ -10,6 +10,11 @@ Require Import Coq.micromega.Psatz. Local Open Scope nat_scope. +Create HintDb pull_wordToN discriminated. +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. + Lemma pow2_id : forall n, pow2 n = 2 ^ n. Proof. induction n; intros; simpl; auto. @@ -42,6 +47,8 @@ Proof. apply natToWord_wordToNat. Qed. +Hint Rewrite NToWord_wordToN : pull_wordToN. + Lemma bound_check_nat_N : forall x n, (Z.to_nat x < 2 ^ n)%nat -> (Z.to_N x < Npow2 n)%N. Proof. intros x n bound_nat. @@ -92,6 +99,7 @@ Proof. destruct pf; rewrite cast_word_refl; trivial. Qed. Lemma wordToN_cast_word {n} (w:word n) m pf : wordToN (@cast_word n m pf w) = wordToN w. Proof. destruct pf; rewrite cast_word_refl; trivial. Qed. +Hint Rewrite @wordToN_cast_word : push_wordToN. Import NPeano Nat. Local Infix "++" := combine. -- cgit v1.2.3