diff options
author | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2020-12-20 14:34:59 +0100 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2020-12-20 14:34:59 +0100 |
commit | a08d7f68534cb9969de57fc2796e5af584c972f2 (patch) | |
tree | 9ca00508dec263a4fd3e6ec0ba739d7ac26babdf /aarch64/Asmblock.v | |
parent | a23b977c5e100c1fd24d47d99b7e860c0bcf64ae (diff) | |
parent | 91a07b5ef9935780942a53108ac80ef354a76248 (diff) | |
download | compcert-kvx-a08d7f68534cb9969de57fc2796e5af584c972f2.tar.gz compcert-kvx-a08d7f68534cb9969de57fc2796e5af584c972f2.zip |
Merge remote-tracking branch 'origin/aarch64-asmblockgenproof' into aarch64-peephole
Diffstat (limited to 'aarch64/Asmblock.v')
-rw-r--r-- | aarch64/Asmblock.v | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/aarch64/Asmblock.v b/aarch64/Asmblock.v index 58817776..ed84b7d8 100644 --- a/aarch64/Asmblock.v +++ b/aarch64/Asmblock.v @@ -41,6 +41,8 @@ Require Export Asm. Local Open Scope option_monad_scope. +Notation regset := Asm.regset. + (** * Abstract syntax *) (* First task: splitting the big [instruction] type below into CFI and basic instructions. @@ -420,6 +422,22 @@ Fixpoint size_blocks (l: bblocks): Z := end . +Lemma to_nat_pos : forall z:Z, (Z.to_nat z > 0)%nat -> z > 0. +Proof. + intros. destruct z; auto. + - contradict H. cbn. apply gt_irrefl. + - apply Zgt_pos_0. + - contradict H. cbn. apply gt_irrefl. +Qed. + +Lemma size_positive (b:bblock): size b > 0. +Proof. + unfold size. destruct b as [hd bdy ex cor]. cbn. + destruct ex; destruct bdy; try (apply to_nat_pos; rewrite Nat2Z.id; cbn; omega); + unfold non_empty_bblockb in cor; simpl in cor. + inversion cor. +Qed. + Record function : Type := mkfunction { fn_sig: signature; fn_blocks: bblocks }. Definition fundef := AST.fundef function. Definition program := AST.program fundef unit. |