Iter1: VERIF ([Obj1,Obj2, . Obj n], I 1) = Result1;
Calcul(VerfiTime1);/// save the verification time
///save the objects with their verifications in a data structure
SAVE (Result1, VerifTime1);
///check the objects added in the next instance (checks the
constraints on the newly added objects)
Iter2: VERIF ([Obj n+1,Obj n+2, . Obj m], I next) =
Result next;
CALCUL (VerfiTime1+VerfiTime next);
///update the data structure to store the new results
SAVE (Result next, VerifTime next);
///repeat the process to the last instance
INCREMENT (next); UNTIL I next =
/
0
Service 2: Minimize Properties Number. To minimize
the number of properties to be verified, we should:
///validate, in a first instance, the constraints on a set of
objects after that we save the number of verified properties
Iter1: VERIF ([Obj1, Obj2,, Obj n], I 1) = Result1;
///check the objects added in the next instance, we verify,
after that, the constraints on the newly added objects
VERIF ([Obj n+1,, Obj m], I 2) = Result2;
VERIF ([Obj m+1,, Obj fin], I fin) = Result fin;
Iter2: CALCUL (VerfiTime1,, VerfiTime Fin); /// updates
the number of verified properties CALCUL (NbProp);
Service 3: Factorize Properties. To define a global
property for all implementations, we should:
///validate, in a first instance, the constraints on a set of
objects
Iter1: VERIF ( [Obj1, Obj2, ., Obj n], I 1) = Result1;
////check if we have a similar objects in the set of instances
Iter2: IF (SIMILAR (Obj i IN I j ) ) == TRUE;
////verify only the similar object and write only one global
property for all implementations
VERIF (Obj i IN [ I 2, I 3, , I j ] )
WRITE (Prop (Obj i) )
CALCUL (NbProp);
Service 4: Composite Properties. In order to write
two or more properties in the same time we add a set of
operations: AND, OR and XOR.
///validate, in a first instance, the constraints on a set of
objects
Iter1: VERIF ([Obj1, Obj2, ., Obj n], I 1) = Result1;
///write a property associated to the first instance
WRITE ( {Prop j} , I 1);
///look for similar objects in the next instances
Iter2: IF (SIMILAR (Obj k IN I i ) ) == TRUE;
///write the constraints according to the used operator
WRITE (AND ({Prop j}, {Prop m}) , I i)); or
WRITE (OR ({Prop j}, {Prop m}) , I i)); or
WRITE (XOR ({Prop j}, {Prop m}) , I i)); or
CALCUL (VerfiTime j) xor CALCUL (VerfiTime m);
Service 5: Configure Properties. In order to optimize the
expression of constraints, we write a setting of properties.
We write a parameterized expressions (write only one prop-
erty and change its parameter depending on the instance)
///validate, in a first instance, the constraints on a set of
objects
Iter1: VERIF ([Obj1, Obj2, ., Obj n], I 1) = Result1;
///look for similar objects in the next instances
Iter2: IF (SIMILAR (Obj k IN I i ) ) == TRUE
///assign to each instance a parameter
AddPARAM (Pj TO Prop j);
///write a property with the according parameters
WRITE ( Prop j , [ I i , Pj] ); or
IF (Pj OR Pm ∈ OJECT ) == TRUE
///add another properties depending on the parameters type
/// If parameters type=classes
WRITE ( Prop j , [ I i , (Pj ,, Pm)] );
ELSE /// If parameters type=attribute
WRITE ( Prop j , [ I i , (Pj , Pm)] ); END IF
4.3 ROCL: Benefits in RWSN
With ROCL, we write a lesser number of constraints
compared to OCL language. For the verification time:
(i) the first instance (Inst1), we have 24 objects to ver-
ify for that we have 24 time units, (ii) the second in-
stance (Inst2), we have 19 objects.
Table 1: Comparison of Validation times between Inst1 and
Inst2.
Instance OCL Validation Time ROCL Valid Time
Inst1 24 24
Inst2 19 1
With OCL the total verification time is 43 units of
time, but with ROCL, the validation time is the sum
of the validation times of objects for the first instance
plus the validation times of new items added to the
next instances. We have no interest to check items
already checked before, just we should save the last
result: the total verification time is 1 time unit (for the
first instance), the second instance does not present
a new object to be checked. We observe a decrease
in the verification time: this is a benefit of the ROCL
language.
5 CONCLUSIONS AND
PERSPECTIVES
The OCL is a language used to verify constraints in
embedded control systems, but if we deal with flex-
ible and reconfigurable ones, this language presents
some limits, such as the validation time of objects
(increases after each instance) and the expression of
constraints (can present duplications in the use of ob-
jects). This paper proposes an extension of OCL,
named Reconfigurable OCL, in order to optimize the
specification and validation of constraints related to
different execution scenarios of a flexible system. We
propose a formal syntax and semantics of the new
ROCL:NewExtensionstoOCLforUsefulVerificationofFlexibleSoftwareSystems
51