summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-22 09:41:12 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-22 09:41:12 +0000
commit97a1231b8f3de4d413fc3347f941812860616575 (patch)
tree62c32ce3b2120d8314ab81c77e09e94545ea3912 /lib
parent6ceceaed3d71a785fa1cccc1059c9a141e99eee1 (diff)
Changelog, doc: updated for release 1.9
lib/Integers, Makefile: unsuccessful experiments with coqchk git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1723 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'lib')
-rw-r--r--lib/Integers.v15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Integers.v b/lib/Integers.v
index 6e7a6cb..75bc63d 100644
--- a/lib/Integers.v
+++ b/lib/Integers.v
@@ -2742,18 +2742,17 @@ Qed.
(** ** Properties of [one_bits] (decomposition in sum of powers of two) *)
-Opaque Z_one_bits. (* Otherwise, next Qed blows up! *)
-
Theorem one_bits_range:
forall x i, In i (one_bits x) -> ltu i iwordsize = true.
Proof.
+ assert (A: forall p, 0 <= p < Z_of_nat wordsize -> ltu (repr p) iwordsize = true).
+ intros. unfold ltu, iwordsize. apply zlt_true.
+ repeat rewrite unsigned_repr. tauto.
+ generalize wordsize_max_unsigned. omega.
+ generalize wordsize_max_unsigned. omega.
intros. unfold one_bits in H.
- elim (list_in_map_inv _ _ _ H). intros i0 [EQ IN].
- subst i. unfold ltu. unfold iwordsize. apply zlt_true.
- generalize (Z_one_bits_range _ _ IN). intros.
- assert (0 <= Z_of_nat wordsize <= max_unsigned).
- generalize wordsize_pos wordsize_max_unsigned; omega.
- repeat rewrite unsigned_repr; omega.
+ destruct (list_in_map_inv _ _ _ H) as [i0 [EQ IN]].
+ subst i. apply A. apply Z_one_bits_range with (unsigned x); auto.
Qed.
Fixpoint int_of_one_bits (l: list int) : int :=