aboutsummaryrefslogtreecommitdiffstats
path: root/aarch64/Asmblock.v
diff options
context:
space:
mode:
Diffstat (limited to 'aarch64/Asmblock.v')
-rw-r--r--aarch64/Asmblock.v18
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.