diff options
author | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2021-01-07 17:47:55 +0100 |
---|---|---|
committer | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2021-01-07 17:47:55 +0100 |
commit | 728888d8a3f70afd526f6c4454327f52ea4c4746 (patch) | |
tree | c0e57b9ec1de6c5580bdf296d85a3024af738537 /lib/IterList.v | |
parent | ac8b7ae094cf7741fec63effd8fcfd1467fb2edf (diff) | |
download | compcert-kvx-728888d8a3f70afd526f6c4454327f52ea4c4746.tar.gz compcert-kvx-728888d8a3f70afd526f6c4454327f52ea4c4746.zip |
Val_cmp* -> Val.mxcmp*
Diffstat (limited to 'lib/IterList.v')
-rw-r--r-- | lib/IterList.v | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/IterList.v b/lib/IterList.v index 49beb1c5..bde47068 100644 --- a/lib/IterList.v +++ b/lib/IterList.v @@ -94,3 +94,18 @@ Lemma list_length_nat_z (A: Type) (l: list A): length l = Z.to_nat (list_length_ Proof. intros; rewrite list_length_z_nat, Nat2Z.id. auto. Qed. + +Lemma is_tail_list_nth_z A (l1 l2: list A): + is_tail l1 l2 -> list_nth_z l2 ((list_length_z l2) - (list_length_z l1)) = list_nth_z l1 0. +Proof. + induction 1; simpl. + - replace (list_length_z c - list_length_z c) with 0; omega || auto. + - assert (X: list_length_z (i :: c2) > list_length_z c1). + { rewrite !list_length_z_nat, <- Nat2Z.inj_gt. + exploit is_tail_bound; simpl; eauto. + omega. } + destruct (zeq (list_length_z (i :: c2) - list_length_z c1) 0) as [Y|Y]; try omega. + replace (Z.pred (list_length_z (i :: c2) - list_length_z c1)) with (list_length_z c2 - list_length_z c1); auto. + rewrite list_length_z_cons. + omega. +Qed. |