summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-10 14:58:33 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-11-10 14:58:33 +0000
commit8ccc7f2f597aff2c8590c4e62552fb53406ad0f8 (patch)
treea553844ce1b6960ae5240f65593c085be733e3b2 /lib
parent74487f079dd56663f97f9731cea328931857495c (diff)
More realistic treatment of jump tables: show the absence of overflow when accessing the table
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1172 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'lib')
-rw-r--r--lib/Coqlib.v7
-rw-r--r--lib/Integers.v7
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/Coqlib.v b/lib/Coqlib.v
index 7bc4f8b..02fa7ba 100644
--- a/lib/Coqlib.v
+++ b/lib/Coqlib.v
@@ -648,6 +648,13 @@ Proof.
rewrite list_length_z_cons. omega.
Qed.
+Lemma list_length_z_map:
+ forall (A B: Type) (f: A -> B) (l: list A),
+ list_length_z (map f l) = list_length_z l.
+Proof.
+ induction l. reflexivity. simpl. repeat rewrite list_length_z_cons. congruence.
+Qed.
+
(** Extract the n-th element of a list, as [List.nth_error] does,
but the index [n] is of type [Z]. *)
diff --git a/lib/Integers.v b/lib/Integers.v
index c54b6fe..625973a 100644
--- a/lib/Integers.v
+++ b/lib/Integers.v
@@ -871,6 +871,13 @@ Proof.
apply neg_mul_distr_l.
Qed.
+Theorem mul_signed:
+ forall x y, mul x y = repr (signed x * signed y).
+Proof.
+ intros; unfold mul. apply eqm_samerepr.
+ apply eqm_mult; apply eqm_sym; apply eqm_signed_unsigned.
+Qed.
+
(** ** Properties of binary decompositions *)
Lemma Z_shift_add_bin_decomp: