Architecture Modeling - SPES 2020
Architecture Modeling - SPES 2020
Architecture Modeling - SPES 2020
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
4.2.3 Examples<br />
VIT Example for Functional Contracts<br />
<strong>Architecture</strong> <strong>Modeling</strong><br />
In the following, the application of VIT is discussed by a set of simple examples. We start with a<br />
example for VIT checking of functional specifications as depicted in Figure 4.5. It shows an air<br />
conditioning system providing tempered air. The AirTempSystem component has input ports<br />
for the currently selected and the current temperature, and an output port for the temperature<br />
of the provided air. The corresponding contract to AirTempSystem states that the difference<br />
between selected and current air temperature must be at most 0.5 ◦ C. The contract further states<br />
that whenever some temperature has been selected, it takes at most 60 seconds for the system to<br />
provide air of this temperature. The strong assumption of the contract has three parts. The first<br />
part states that the selected temperature is in the range of between 12 ◦ C and 35 ◦ C. The second<br />
part states that the sensor value actTemp for the actual temperature is updated each 20 ms.<br />
And the third assumption requires from the environment that the actually measured temperature<br />
must not differ more than 0.2 ◦ C from the provided air.<br />
C1<br />
C2<br />
C<br />
tempSelect<br />
actTemp<br />
12°C < tempSelect < 35°C<br />
actTemp occurs each 20ms<br />
always abs(actTemp –<br />
flowTemp) < 0.2°C<br />
AirTempSystem<br />
12°C < tempSelect < 35°C<br />
actTemp occurs each 20ms<br />
whenever chg(tempSelect) occurs nomTemp = tempSelect<br />
holds during [10ms, chg(tempSelect) [<br />
Whenever actTemp occurs control.act = actTemp &&<br />
control.nom = nomTemp occurs within [12ms, 14ms]<br />
tempSelectStore<br />
AirTempControl<br />
whenever chg(tempSelect) occurs abs(flowTemp – tempSelect) <<br />
0.5°C holds during [60s, chg(tempSelect) [<br />
nomTemp<br />
C3<br />
control occurs each 20ms<br />
with jitter 2ms<br />
control<br />
AirCondition<br />
Figure 4.5: VIT Example with Functional Contracts<br />
whenever control occurs abs(flowTemp - control.nom) <<br />
abs(control.act - control.nom) + epsilon holds during [10ms, control [<br />
flowTemp<br />
In order to perform VIT, we start with the VIT condition stating that the strong assumption<br />
of the component, together with all local contracts must imply all local strong assumptions.<br />
As Figure 4.6 shows, this is trivial to see for the local contracts C1 and C2. For C3 =<br />
(A3s,A3w,G3), we can employ existing results from real-time analysis allowing us to derive<br />
a periodical activation pattern for the occurrence of control events from contract C2. This<br />
concludes the strong VIT condition, requiring that all strong assumptions of the sub-components<br />
are satisfied if the strong assumptions of the parent component is (and if all local contracts are<br />
satisfied). Interestingly, the example shows that different aspects of a design are often closely<br />
entangled, in this case the functional and the real-time aspect.<br />
Showing satisfaction of the guarantee of C needs a little more effort. Firstly, we can derive a<br />
new guarantee from C1 and C2, and G3 that replaces in G3 occurrences of control.nom by<br />
56/ 156