aboutsummaryrefslogtreecommitdiff
path: root/src/Testbit.v
diff options
context:
space:
mode:
authorGravatar jadep <jade.philipoom@gmail.com>2016-06-30 15:16:50 -0400
committerGravatar jadep <jade.philipoom@gmail.com>2016-06-30 15:16:50 -0400
commite215871febb7d1294aa5aa13b0c70b2207e745e2 (patch)
tree618c2782b13fe99d07db7cfcf63db968052fe6fc /src/Testbit.v
parenta12c5e7bd5df69138bcb0c890594a0daacf0cc70 (diff)
added and proved shift/or decode operation 'decode_bitwise'
Diffstat (limited to 'src/Testbit.v')
-rw-r--r--src/Testbit.v7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Testbit.v b/src/Testbit.v
index 2bfcc3df6..545c3cbce 100644
--- a/src/Testbit.v
+++ b/src/Testbit.v
@@ -179,9 +179,10 @@ Proof.
- rewrite nth_default_cons_S.
erewrite IHus; eauto using no_overflow_tail.
remember (i * limb_width)%nat as k.
- rewrite Z_shiftr_add_land by omega.
- replace (limb_width + k - limb_width)%nat with k by omega.
- reflexivity.
+ rewrite Z_shiftr_add_shiftl_high; rewrite ?Nat2Z.inj_add;
+ repeat f_equal; try omega.
+ rewrite Z.land_ones by apply Nat2Z.is_nonneg.
+ apply Z.mod_pos_bound. zero_bounds.
Qed.
Lemma unfold_bits_testbit : forall limb_width us n, (0 < limb_width)%nat ->