3.3 Example of a Postcondition
Obtained From Substitutions
The body of the activate operation is used again and
the rules defined in (Abrial, 1996) are applied to find
the B postcondition. The variables primed in B ex-
press the value of the variable after realizing the sub-
stitutions. In OCL, the before value is expressed by
suffixing the variable with @pre.
prd(waiting := waiting - {qq}||
IF (active = ∅) THEN active := {qq}
ELSE ready := ready ∪{qq}
END)
⇔
prd(waiting := waiting - {qq}) ∧
prd(IF (active = ∅)
THEN active := {qq}
ELSE ready := ready ∪{qq}
END)
⇔
waiting’ = waiting - {qq}) ∧
prd((active = ∅ =⇒ active := {qq})
[] (¬ (active = ∅) =⇒ ready := ready ∪{qq})
)
⇔
waiting’ = waiting - {qq}) ∧
(prd(active = ∅ =⇒ active := {qq})
∨ prd(¬ (active = ∅) =⇒ ready := ready ∪{qq}
)
)
⇔
waiting’ = waiting - {qq}) ∧
((active = ∅ ∧ prd(active := {qq}))
∨ (¬ (active = ∅) ∧ prd(ready := ready ∪{qq}))
)
⇔
waiting’ = waiting - {qq}) ∧
((active = ∅ ∧ active’ = {qq}))
∨ (active = ∅ ∧ ready’ = ready ∪{qq}))
)
The constraint is deduced of this postcondition :
waiting = waiting@pre→excluding(qq) and
((active@pre→isEmpty() and active = Set{qq})
or (active@pre→notEmpty()
and ready = ready@pre→including(qq))
)
4 CONCLUSIONS AND
PROSPECTS
On the whole, the passage from a B specification to an
UML-OCL modeling has proved possible throughout
the sample of examples that we processed.
The OCL constraints generated seem readable and
understandable to us though less expressive and con-
cise than the predicates expressed in B. That is partly
due to the operators directly available in B.
The next stage of our work consists in assessing
the possibility to jump forth and back between B and
UML specifications.
REFERENCES
Abrial, J. (1996). The B-Book -Assigning Programs to
Meanings. Cambridge University. Press. ISBN 0-521-
49169-5.
Behm, P., Benoit, P., A.Faivre, and J-M.Meynadier (1999).
METEOR : A successul application of B in a large
project. In FM’99 : World Congress on Formal Meth-
ods, pages 369–387. LNCS 1709.
Casset, L. (2002). Development of an Embedded Verifier
for Java Card Byte Code Using Formal Methods. In
FME’02 : Formal Methods Europe. LNCS 2391.
Hammad, B., Tatibouet, A., Voisinet, J., and Wu, W. (2002).
From a B Specification to UML Statechart Diagrams.
In 4th International Conference on Formal Engineer-
ing Methods, ICFEM’2002, pages 511–522, Shangai,
China. LNCS 2495.
Jacques, I., Tatibouet, B., and Voisinet, J. (2005). Gener-
ation of OCL Constraints from B Abstract Machines.
In SERP’05, 2005 International Conference on Soft-
ware Engineering Research and Practice, Las Vegas,
Nevada, USA.
Laleau, R. and Mammar, A. (2000). An Overview of a
Method and its support Tool for Generating B Speci-
fications from UML Notations. In The 15th IEEE Int.
Conf. on Automated Software Engineering, Grenoble
(F).
Meyer, E. and Souquieres, J. (1999). A Systematic Ap-
proach to Transform OMT Diagrams to a B Spec-
ification. In FM’99, LNCS 1708, pages 875–895.
Springer-Verlag.
Sekerinski, E. (1998). Graphical design of reactive systems.
In B’98 : Recent Advances in the Development and
Use of the B-Method, LNCS 1393. Springer-Verlag.
Tatibouet, B., Hammad, A., and Voisinet, J. (2002). From
a B Specification to UML Class Diagrams. In 2nd
IEEE International Symposium on Signal Processing
and Information Technology, ISSPIT’2002, pages 5–
10, Marrakech, Morocco. IEEE.
ICEIS 2006 - INFORMATION SYSTEMS ANALYSIS AND SPECIFICATION
478