diff options
author | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2020-10-17 17:03:07 +0200 |
---|---|---|
committer | Sylvain Boulmé <sylvain.boulme@univ-grenoble-alpes.fr> | 2020-10-17 17:03:07 +0200 |
commit | 41a97a2d5eace2a0b113d7da590df69f1cc0d763 (patch) | |
tree | 9d5d00835078f7505229e052122c3d20e42b6bc5 /common | |
parent | db3183cacb132d7153f653e2c3ae20b92ddfc03c (diff) | |
download | compcert-kvx-41a97a2d5eace2a0b113d7da590df69f1cc0d763.tar.gz compcert-kvx-41a97a2d5eace2a0b113d7da590df69f1cc0d763.zip |
proves op_valid_pointer_eq lemma for RISC-V (necessary for the pre-pass scheduler)
Diffstat (limited to 'common')
-rw-r--r-- | common/Values.v | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/common/Values.v b/common/Values.v index 6401ba52..65b0b5ef 100644 --- a/common/Values.v +++ b/common/Values.v @@ -2706,3 +2706,25 @@ Proof. unfold compose_meminj; rewrite H1; rewrite H3; eauto. rewrite Ptrofs.add_assoc. decEq. unfold Ptrofs.add. apply Ptrofs.eqm_samerepr. auto with ints. Qed. + + +(** Particular cases of extensionality lemma *) + +Lemma cmpu_bool_valid_pointer_eq vptr1 vptr2 c v1 v2: + (forall (b : block) (z : Z), vptr1 b z = vptr2 b z) -> + Val.cmpu_bool vptr1 c v1 v2 = Val.cmpu_bool vptr2 c v1 v2. +Proof. + intros EQ; unfold Val.cmpu_bool; destruct v1; try congruence; + destruct v2; try congruence; + rewrite !EQ; auto. +Qed. + +Lemma cmplu_bool_valid_pointer_eq vptr1 vptr2 c v1 v2: + (forall (b : block) (z : Z), vptr1 b z = vptr2 b z) -> + Val.cmplu_bool vptr1 c v1 v2 = Val.cmplu_bool vptr2 c v1 v2. +Proof. + intros EQ; unfold Val.cmplu_bool; destruct v1; try congruence; + destruct v2; try congruence; + rewrite !EQ; auto. +Qed. + |