25.11.2014 Aufrufe

Verifikation reaktiver Systeme - Universität Kaiserslautern

Verifikation reaktiver Systeme - Universität Kaiserslautern

Verifikation reaktiver Systeme - Universität Kaiserslautern

MEHR ANZEIGEN
WENIGER ANZEIGEN

Erfolgreiche ePaper selbst erstellen

Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.

229<br />

in<br />

out<br />

0<br />

1<br />

1<br />

1 REG<br />

0<br />

REG<br />

1<br />

Fig. 3. Schematic diagram of the parity checker<br />

This is proved in two steps: At first, the PARITY LEMMA lemma shows how the<br />

output is calculated from the previous time step and the input, provided that<br />

inp and out are related as in the schematic diagram.<br />

g‘!inp out. PARITY_IMP(inp,out) ==><br />

(out 0 = T) /\ !t. out(SUC t) = if inp(SUC t) then ~(out t) else out t‘;<br />

e(PURE_REWRITE_TAC [PARITY_IMP_def, ONE_def, NOT_def, MUX_def, REG_def]);<br />

e(REPEAT STRIP_TAC);<br />

e(PROVE_TAC[]);<br />

e(PAT_ASSUM ‘‘!t. out t = X t‘‘ (fn th => REWRITE_TAC [SPEC ‘‘SUC t‘‘ th]));<br />

e(RW_TAC arith_ss []);<br />

val PARITY_LEMMA = top_thm();<br />

To prove this lemma, rewriting with definitions is used in the initial step,<br />

followed by decomposing the resulting goal by applying STRIP TAC. The first part<br />

can then be proven mechanically. For the second subgoal a specialised version<br />

of the assumption !t. out t = X f is used before the final simplification step.<br />

Having proven this lemma, it remains for the second part of the verification:<br />

g‘!inp out. (out 0 = T) /\ (!t. out (SUC t) =<br />

if inp (SUC t) then ~out t else out t) ==><br />

!t. out t = PARITY t inp‘;<br />

e(REPEAT GEN_TAC);<br />

e(STRIP_TAC);<br />

e(Induct);<br />

e(ASM_REWRITE_TAC[PARITY_def]);<br />

e(ASM_REWRITE_TAC[PARITY_def]);<br />

val UNIQUELESS_LEMMA = top_thm();<br />

This proof illustrates the use of induction in the HOL system: After the<br />

quantifiers and the left part of the implication have been removed from the<br />

goal, the right part is split up by an induction on t (which is the outermost<br />

universally quantified variable at that moment). The subgoals can be proved,<br />

simply by rewriting with the assumptions.

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!