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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 95<br />

primrec<br />

"width 0 R l t b r = 0"<br />

"width (Suc n) R l t b r =<br />

Width ((l, t) ;;;<br />

snd $ (converse $ (apr $ (int n))) ;;<br />

beside $ ((| Def = λb c. arbitrary, Height = λb c. arbitrary, Width = λ<br />

(l,t) (b, r). width n R l t b r |), R $ (int n + 1)) ;;<br />

fst $ (apr $ (int n))<br />

;;; (b, r)<br />

)"<br />

Figure 4.15: Isabelle definition <strong>of</strong> the irow width function<br />

theory to convert the integer parameter to a natural number. int2nat is similar to the inbuilt<br />

nat type converter except that it is only defined for values where n ≥ 0.<br />

Pro<strong>of</strong>s for recursive functions tend to follow a simple structure: induction and then some<br />

application <strong>of</strong> auto, possibly combined <strong>with</strong> other methods. In order to prove the validity<br />

theorems for irow it is necessary to massage the propositions [55], in order to move variables<br />

that must be encompassed by the induction onto the right-hand-side <strong>of</strong> the meta-implication.<br />

For example, the width validity theorem for irow is phrased as:<br />

theorem width ge0 int [rule format]: "<br />

Î(n::nat)<br />

(R::(( int⇒ (’t107∗’t108)⇒ (’t109∗’t107)⇒ bool,int⇒ (’t107∗’t108)⇒ (’t109∗’t107)⇒ int)block)).<br />

∀ (qs137::int) (qs138 ::(’ t107∗’t108)) (qs139 ::(’ t109∗’t107)).<br />

0 ≤ (Height (qs138 ;;; R $ qs137 ;;; qs139)) ;<br />

∀ (qs137::int) (qs138 ::(’ t107∗’t108)) (qs139 ::(’ t109∗’t107)).<br />

0 ≤ (Width (qs138 ;;; R $ qs137 ;;; qs139)) <br />

=⇒ ∀ l t b r. 0 ≤ (width n R l t b r)"<br />

This differs from the standard representation in that the signals l, t, b and r have been moved<br />

from being meta-quantified to being object-level quantified. The “rule format” tag instructs<br />

Isabelle to re-phrase the theorem using meta-quantification once it is proved.<br />

Pro<strong>of</strong> <strong>of</strong> this theorem involves applying induction to split it into two cases to prove:<br />

goal (theorem (width ge0 int), 2 subgoals):<br />

1.ÎnR. ∀ qs137 qs138 qs139. 0 ≤ Height (qs138 ;;; R $ qs137 ;;; qs139);<br />

∀ qs137 qs138 qs139. 0 ≤ Width (qs138 ;;; R $ qs137 ;;; qs139) <br />

=⇒ ∀ l t b r. 0 ≤ irow.width 0 R l t b r

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

Saved successfully!

Ooh no, something went wrong!