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

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

234<br />

val add_def = Define ‘add f1 f2 =<br />

abs_frac(nmr f1 * dnm f2 + nmr f2 * dnm f1, dnm f1 * dnm f2)‘;<br />

val mul_def = Define ‘mul f1 f2 =<br />

abs_frac(nmr f1 * nmr f2, dnm f1 * dnm f2)‘;<br />

val sub_def = Define ‘sub f1 f2 = add f1 (ainv f2)‘;<br />

val div_def = Define ‘div f1 f2 = mul f1 (minv f2)‘;<br />

Addition and multiplication are defined intuitively. Substraction and division<br />

use them and the inverse elements.<br />

Like in many other areas, good tools are the key to success. A well considered<br />

set of tactics and lemmas makes proofs much simpler.<br />

val FRAC_EQ_TAC:tactic = fn (asl,w) =><br />

let<br />

val (lhs,rhs) = dest_eq w<br />

in<br />

let<br />

val (lhc, lha) = dest_comb lhs;<br />

val (rhc, rha ) = dest_comb rhs;<br />

in<br />

let<br />

val [a1,b1] = strip_pair lha;<br />

val [a2,b2] = strip_pair rha;<br />

in<br />

let<br />

val sg1 = mk_eq(a1,a2);<br />

val sg2 = mk_eq(b1,b2);<br />

in<br />

(<br />

[(asl,sg1), (asl,sg2)],<br />

fn [thm1,thm2] => MP<br />

(SPEC b2 (SPEC a2 (SPEC b1 (SPEC a1 (<br />

prove(‘‘!a1 b1 a2 b2. (a1=a2) /\ (b1=b2) ==><br />

(abs_frac(a1,b1)=abs_frac(a2,b2))‘‘, ARW_TAC[])<br />

)))))<br />

(CONJ thm1 thm2)<br />

)<br />

end<br />

end<br />

end<br />

end<br />

handle HOL_ERR _ => raise ERR "FRAC_EQ_TAC" "";<br />

FRAC EQ TAC is a tactic which is used in almost every proof involving fractions:<br />

To show that two fractions are equal, it is sufficient to show that respectively<br />

their numerators and denominators are equal. In the first three let parts,<br />

the numerator and denominator of the two fractions are extracted. This is accomplished<br />

by successively applying the appropriate destructor functions. The<br />

strategy assumes a certain syntactical structure of the goal. If this is not given,<br />

the tactic will fail (i.e. the goal will remain unchanged).

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

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!