Design

Home
Team
Motivation
Requirements
Design
Implementation
Experiments
Conclusions
References
Presentation
Appendix

Design

  1. Jump to "Sequence Diagrams to Petri Nets" Section
  2. Jump to "State Charts to Petri Nets" Section
  3. Jump to "Merging" Section

Sequence Diagrams to Petri Nets

Recall that we will only be working with a subset of sequence diagrams. More specifically at this moment we do not handle alt, opt, ref and loop constructs that are part of UML 2.0 sequence diagrams.
We represent sending and receiving of a message(message exchange between objects) by two transitions and a place as shown in the example below.
We represent the state the object is in before and after receiving or sending a message via a place also shown in the example below.

Sequence diagram petri net
Transformation rule 1 and 2

Back to top


Transformation rule 3 Transformation rule 4 Transformation rule 4

Back to top


Transformation rule 5 Transformation rule 5 Transformation rule 5

Back to top


Transformation rule 6 Transformation rule 6

Back to top


Transformation rule 6 Transformation rule 6

Back to top


State Charts to Petri Nets

Recall that we will only be working with a subset of state charts. More specifically at this moment we do not handle broadcast explicitly nor do we handle history. We have decided to approach this transformation from a rules based perspective in the hopes of hinting at the possibility of automating this in the future using a graph grammar rewriting tool such as Atom3.

There are a couple of interesting points to take note of regarding this transformation. First we must ensure that when transforming we maintain the proper semantics of state charts.

What does this really mean?
Recall that state charts have a "must fire semantics" this means that if we are in a given state(A) and we receive an event(E) then we must transition to a state(B). There is no choice in the matter However petri nets, due to their non deterministic nature, have a "may fire semantics". This means that if a given transition(T1) is enabled there is no rule that says it must fire. This is a subtle point that we must address appropriately. When performing the transformation we must somehow explicitly add something to our petri net constructions that can enforce this "must fire semantics" of state charts. This is where the pre/post construction( shown in green comes in to play). By adding this "Special" construction we add this notion of a dual transition(s) to the transition that checks the occurrence or existence of an event.

What does this do?
It says then for every transition we give it a chance to fire if we can fire it we do so if not we fire its dual and as a result migrate a token from the pre-place to the post-place. This indicates that we have given this part a chance to fire. This is not the complete story of course. We still have the task of adding the construction that will actually populate the pre-place with tokens and act like a clock that initiates rounds. Each round has a set of phases. Phase I is populating all the pre-places with tokens. Phase II is enabled after all transitions that could fire do so resulting in token being put in post-places. When all the post-places have tokens in them we can initiate moving from Phase II to Phase III. Phase III which is the final phase will now ensure that we remove all tokens from event places that have tokens in them and then we loop back to the start to initiate Phase I all over again and start the next round.
Transformation rule 1 and 2

Back to top


Transformation rule 3

Back to top


Transformation rule 4

Back to top


Transformation rule 5

Back to top


Transformation rule 6

Back to top


Transformation rule 7-1 Transformation rule 7-2

Back to top


Superimpose(Merge) the transformed sequence diagram with the transformed State Chart

We do this be identifying the send and receive of a message in the sequence diagram with its corresponding place in the state chart and connect appropriately. This is best seen through an example which you can find under the experiments sub-section.


Back to top