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 195<br />

end<br />

B.7 Functions<br />

header {* Definition <strong>of</strong> Quartz expression functions: maxf, sum, etc *}<br />

theory Functions = IntAlgebra:<br />

section {* Useful logic *}<br />

theorem conj_imp: "(A --> B & C) = ((A --> B) & (A --> C))"<br />

by (auto)<br />

section {* maxf function to find the maximum point <strong>of</strong> a function <strong>with</strong>in in a range *}<br />

consts<br />

maxf :: "(int*int*(int=>int))=>int"<br />

recdef maxf "measure (%(b, t, f). nat(t+1-b))"<br />

"maxf (bot, top, fun) = (if (top < bot) then 0<br />

else (<br />

case (top = bot) <strong>of</strong> True =><br />

fun top<br />

| False => (<br />

let one = fun top in<br />

let two = maxf (bot, top - 1, fun) in<br />

max one two)<br />

))"<br />

theorem maxf_expand_if: "maxf(b,t,f) = (if (t < b) then 0 else (if t = b then f t<br />

else max (f t) (maxf(b,t - 1,f))))"<br />

by (simp add: Let_def)<br />

subsection {* Correctness pro<strong>of</strong> *}<br />

constdefs<br />

is_maxf :: "[int,int, int=>int,int]=>bool"<br />

"is_maxf == % bot top fun max.<br />

(EX y. bot C"<br />

by (auto)<br />

lemma logic_impand: "A & B = (A --> B) | ~A"<br />

by (blast)<br />

theorem maxf_nobigger: "!! b t f. [| b

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

Saved successfully!

Ooh no, something went wrong!