Verifikation reaktiver Systeme - Universität Kaiserslautern
Verifikation reaktiver Systeme - Universität Kaiserslautern
Verifikation reaktiver Systeme - Universität Kaiserslautern
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
232<br />
val SHIFT_def = Define ‘SHIFT(inp:num->num, out:num->num) =<br />
!t. out t = (inp t) DIV 2‘;<br />
val SUB_def = Define ‘SUB(in1:num->num,in2:num->num,out:num->num) =<br />
!t. out t = (in1 t - in2 t)‘;<br />
val LESS_def = Define ‘LESS(in1:num->num,in2:num->num,out:num->bool) =<br />
!t. out t = (in1 t < in2 t)‘;<br />
val LSB_def = Define ‘LSB(inp:num->num,out:num->bool) =<br />
!t. out t = ((inp t) MOD 2 = 1)‘;<br />
Then, the composition is described by:<br />
val BGCD_IMP_def = Define<br />
‘BGCD_IMP(initX:num, initY:num,<br />
regX:num->num, regY:num->num, regK:num->num) =<br />
? inX, inY, regXshift, regYshift, oddX, oddY,<br />
regXcor, regYcor, evenX, evenY, evenXY,<br />
oddXY, oddXYy, oddXYx, subX, subY, subXY, subYX.<br />
REG(inX,regX,initX) /\ REG(inY,regY,initY) /\<br />
SHIFT(regX,regXshift) /\ SHIFT(regY,regYshift) /\<br />
LSB(regX,oddX) /\ LSB(regY,oddY) /\<br />
MUX(oddX,regX,regXshift,regXcor) /\<br />
MUX(oddY,regY,regYshift,regYcor) /\<br />
NOT(oddX,evenX) /\ NOT(oddY,evenY) /\<br />
AND(evenX,evenY,evenXY)/\<br />
COUNTER(evenXY,regK)/\<br />
AND(oddX, oddY, oddXY) /\<br />
LESS(regXcor,regYcor,oddXYx) /\ LESS(regYcor,regXcor,oddXYy) /\<br />
AND(oddXY,oddXYx,subX) /\ AND(oddXY,oddXYy,subY) /\<br />
SUB(regXcor,regYcor,subXY) /\ SUB(regYcor,regXcor,subYX) /\<br />
MUX(subX,regXcor,subXY,inX) /\ MUX(subY,regYcor,subYX,inY)‘;<br />
Now, it is possible to prove the invariant and the correctness of the component.<br />
The proof for this can be found in A.1. Considering this example, the<br />
benefit from the theorem proving method becomes obvious: The number of possible<br />
states and the complexity of the components is big. But this does not affect<br />
the theorem proving approach, which abstracts from the size of the registers and<br />
make it even possible to prove the correctness for arbitrary sizes.<br />
3.3 Rational Numbers<br />
This section shows are more comprehensive example introducing the type of<br />
rational numbers Q. This theory can be used to verify hardware that is based on<br />
rational arithmetic operations. Applications of this can be found in areas that<br />
need precise calculations of basic arithmetics, e.g. linear geometry primitives<br />
used in safety-critical environments.<br />
The rational numbers are defined in two steps. First, fractions consisting of a<br />
pair of integers are introduced. Subsequently, rational numbers are constructed<br />
as equivalence classes of them using the quotient theory.