24.04.2013 Views

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

APPENDIX B. THEORETICAL BASIS FOR LAYOUT REASONING 192<br />

inst :: "[’a, (’a=>’b=>bool,’a=>’b=>int)block,’b]=>(bool, int)block" ("_ ;;; _ ;;;<br />

_" [45, 46, 47] 45)<br />

"inst == (% x B y. (| Def = Def B x y, Height = Height B x y, Width = Width B x y<br />

|))"<br />

section {* Simplification theorems *}<br />

theorem height_extract [simp]: "Height (x ;;; A ;;; y) = ((Height A) x y)"<br />

by (simp add:inst_def)<br />

theorem width_extract [simp]: "Width (x ;;; A ;;; y) = ((Width A) x y)"<br />

by (simp add:inst_def)<br />

theorem def_extract: "Def (x ;;; A ;;; y) = (Def A) x y"<br />

by (simp add: inst_def)<br />

theorem height_ap [simp]: "Height (A $ x) = (Height A) x"<br />

by (simp add: ap_def)<br />

theorem width_ap [simp]: "Width (A $ x) = (Width A) x"<br />

by (simp add: ap_def)<br />

theorem def_ap [simp]: "Def (A $ x) = (Def A) x"<br />

by (simp add: ap_def)<br />

section {* Congruence, for recdef pro<strong>of</strong>s *}<br />

theorem ap_cong: "((| Def = s, Height = h, Width = w|) $ l) = (| Def = s l, Height =<br />

h l, Width = w l|)"<br />

by (simp)<br />

declare ap_cong [recdef_cong]<br />

end<br />

B.4 Inbuilt<br />

header {* In-built language blocks: zip and unzip *}<br />

theory Inbuilt = Types + Block:<br />

(* Don’t define structure / function - unnecessary for reasoning about size *)<br />

section {* Zip block *}<br />

consts<br />

defs<br />

zip_struct:: "int=>’a=>(’b)vector=>bool"<br />

zip_height:: "int=>’a=>(’b)vector=>int"<br />

zip_width:: "int=>’a=>(’b)vector=>int"<br />

zip:: "(int=>’a=>(’b)vector=>bool, int=>’a=>(’b)vector=>int)block"<br />

zip_height_def: "zip_height == % n x y. 0"<br />

zip_width_def: "zip_width == % n x y. 0"<br />

zip_def: "zip == (| Def = zip_struct, Height = zip_height, Width = zip_width<br />

|)"

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!