Verification of Parameterised FPGA Circuit Descriptions with Layout ...

Verification of Parameterised FPGA Circuit Descriptions with Layout ... Verification of Parameterised FPGA Circuit Descriptions with Layout ...

24.04.2013 Views

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 90 Overall our tacticals prove good at proving intersection theorems and are mostly effective at proving validity and containment theorems. 4.6.2 Improved Proof Scripts Following our experiments with tactical-based proofs of the Prelude library, we attempt the same proofs using Isabelle’s standard auto proof method. This method interleaves invocations of the simplifier and classical reasoner and can be supplied with sets of simplification rules and theorems to use. All our decompositional theorems are proved in the style of introduction rules and are supplied to auto as such. This method proves effective for validity and containment theorems however its results on intersection theorems are far from impressive. Isabelle’s automatic tools consistently select the wrong parts of the disjunctions to attempt to prove and leave proof states that are not just unproven but actually unprovable. We therefore design a new set of rules for generating proof scripts that combines the best of these methods. auto-based proofs are generated for validity and containment theorems while custom tacticals are generated for intersection theorems. The intersection tacticals include an invocation to auto as a last resort when the other options in the tactical fail to prove the goal, thus handling the rare circumstances when the classical reasoner can prove a goal but our custom tactical can not. Returning to our map example, the complete height function validity theorem and proof is generated as: theorem height ge0 int: "Î(n::int) (R::((’t395⇒ ’t396⇒ bool,’t395⇒ ’t396⇒ int)block)) (i::(’ t395)vector) (o ::(’t396)vector). ∀ (qs691 ::’ t395) (qs692 ::’ t396). 0 ≤ (Height (qs691 ;;; R ;;; qs692)) =⇒ 0 ≤ (height (n, R) i o )" apply (auto intro: sum ge0 maxf ge0 sum ge0 frange maxf ge0 frange z aleq bc simp add: done Let def max def) The containment theorem is similarly proved using an appropriately parameterised auto. The

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 91 compiler procedure that generates these scripts also supplies the height ge0 and width ge0 theorems for all blocks used in the description as introduction rules (none in this case, since map only instantiates the supplied R block). This allows validity proofs to build upon one another. The intersection theorem for map (page 87) is proved by the generated tactical: apply (simp, rule impI, simp)? apply (( done (rule allI )+, (case tac "0 ≤ n"), rule impdisj 12of4, (rule loop sum overlap|rule loop sum overlap’), (simp add: overlap0’’)+) | ((rule allI )+, (case tac "0 ≤ n"), rule impdisj 34of4, rule loop sum overlap2, (simp add: overlap0’’)+) | auto intro: sum ge0 maxf ge0 sum nsub1 plusf maxf encloses) The loop sum overlap theorems are proved in the Structures theory. This theory contains theorems that match common layout structures, such as the layout of components in a loop. loop sum overlap is given as: Î(n::int) (j :: int) (j ’:: int). m ≤ n ;Îy. 0 ≤ f y =⇒ ((m ≤ j) ∧ (j ≤ (n − 1)) ∧ (m ≤ j’) ∧ (j’ ≤ (n − 1)) ∧ (j’ = j)) −→ ((sum (m, j − 1, f) + f j) ≤ sum (m, j’ − 1, f) | (sum (m, j’ − 1, f) + f j ’) ≤ sum (m, j − 1, f)) Its proof involves a number of steps and is given in Appendix B.8. The other loop sum overlap theorems are similar. Table 4.1 gives statistics on the proofs for some of the blocks in the Prelude library and details for all of those where proofs required manual intervention. Overall of nearly 40 blocks in the Prelude library, only 5 required manual intervention in their proofs. Using the auto method

CHAPTER 4. VERIFYING CIRCUIT LAYOUTS 90<br />

Overall our tacticals prove good at proving intersection theorems and are mostly effective at<br />

proving validity and containment theorems.<br />

4.6.2 Improved Pro<strong>of</strong> Scripts<br />

Following our experiments <strong>with</strong> tactical-based pro<strong>of</strong>s <strong>of</strong> the Prelude library, we attempt the<br />

same pro<strong>of</strong>s using Isabelle’s standard auto pro<strong>of</strong> method. This method interleaves invocations<br />

<strong>of</strong> the simplifier and classical reasoner and can be supplied <strong>with</strong> sets <strong>of</strong> simplification rules<br />

and theorems to use. All our decompositional theorems are proved in the style <strong>of</strong> introduction<br />

rules and are supplied to auto as such.<br />

This method proves effective for validity and containment theorems however its results on<br />

intersection theorems are far from impressive. Isabelle’s automatic tools consistently select<br />

the wrong parts <strong>of</strong> the disjunctions to attempt to prove and leave pro<strong>of</strong> states that are not<br />

just unproven but actually unprovable.<br />

We therefore design a new set <strong>of</strong> rules for generating pro<strong>of</strong> scripts that combines the best <strong>of</strong><br />

these methods. auto-based pro<strong>of</strong>s are generated for validity and containment theorems while<br />

custom tacticals are generated for intersection theorems. The intersection tacticals include<br />

an invocation to auto as a last resort when the other options in the tactical fail to prove the<br />

goal, thus handling the rare circumstances when the classical reasoner can prove a goal but<br />

our custom tactical can not.<br />

Returning to our map example, the complete height function validity theorem and pro<strong>of</strong> is<br />

generated as:<br />

theorem height ge0 int: "Î(n::int) (R::((’t395⇒ ’t396⇒ bool,’t395⇒ ’t396⇒ int)block)) (i::(’<br />

t395)vector) (o ::(’t396)vector).<br />

∀ (qs691 ::’ t395) (qs692 ::’ t396). 0 ≤ (Height (qs691 ;;; R ;;; qs692)) =⇒<br />

0 ≤ (height (n, R) i o )"<br />

apply (auto intro: sum ge0 maxf ge0 sum ge0 frange maxf ge0 frange z aleq bc simp add:<br />

done<br />

Let def max def)<br />

The containment theorem is similarly proved using an appropriately parameterised auto. The

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

Saved successfully!

Ooh no, something went wrong!