Formal specification to UML transformation demo
This technique is based on the work of Web Display Formal Specification in ZML, which defined an XML format for writting formal specifications, it needs prerequisite understanding of this XML format.
This formal specification to UML transformation technique can be applied to Object-Z and Timed Communicating Object Z (an integrated formal techniques combining Object-Z and Timed-CSP).
The aim to transform formal models to a visual notation--- UML model. Currently, only transformation of the static views to class diagrams is implemented. The formal specification is written in XML (instead of the usual way---LaTeX), while with the emergence of XMI (XML Metadata Interchange), it becomes possible to build up an interchange of UML with other standards. The UML tool Rational Rose partially supports XML file Inport/Export. (To add this feature to your Rational Rose 2000, you have to download and install the Add-in built by Unisys Corporation.)
Therefore,XSLT technology is chosen to realize our tranformation rules, tranforming XML (formal model) to XMI (UML).
In this demo, a TCOZ model for Light-Control system is used as an example. Because of the space limitation, in this page I only show you a small part of the specificaitons. To view the complete specification of the whole system, please click here.
![]() | ![]() | Light | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |
![]() | ![]() | dim: Percent actuator | ||||
![]() | ![]() | on: ℬ | ||||
![]() | ![]() | ![]() | ||||
![]() | TurningOn ≙ dim := 100; on := true | |||||
![]() | TurningOff ≙ dim := 0; on := false | |||||
![]() | ![]() |
|||||
![]() | ![]() | ControlledLight | ![]() | ![]() | ![]() | ![]() |
|---|---|---|---|---|---|---|
![]() | ![]() | Light | ||||
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |
![]() | ![]() | button, dimmer: chan | ||||
![]() | ![]() | ![]() | ||||
![]() | ButtonPushing ≙ button?1→([dim>0]∙ TurningOff ☐ [dim=0]∙ TurningOn ) | |||||
![]() | DimChange ≙ [n : Percent ]∙dimmer?n→([on]∙dim:=n ☐ [¬on]∙SKIP) | |||||
![]() | MAIN ≙ μN ∙ ( ButtonPushing ☐ DimChange ); N | |||||
![]() | ![]() |
|||||
Click here to view XML source for the small part above.
Click here
to view XML source for the complete model of the light control system.
Click here to view the generated XMI file for the example above.
Here is the result of transformation to UML class diagram
