Re: When do statemachine changes become effective



Re: When do statemachine changes become effective

From: Les Munday ^lt;baldrick@ureach.com>
Date: Thu 12 May 2005 - 17:48:56 BST
Message-Id: <200505121648.MAA12253@www20.ureach.com>
I have been using statecharts prior to UML and even before I'd
heard of Harel and i-Logix. My understanding is that all actions
on a transition, or actions upon entry to a state (depending on
whether using Mealy or Moore) are executed in parallel and it
cannot be determined which finishes first.
 
> 
> Yet, somehow I think that a property as fundamental as the
question when 
> changes become effective should be part of the core semantics
of UML 
> statemachines. It should not be left open to the action
language.
> 
> Let me refine my examples a bit:
> 
>       evt/x=y         y=x
>     -----------> O ---------->
> 
> I have split the compound action expression into two simple
ones and put 
> them on transition segments joined by a junction point. And,
to put in 
> yet another example, here's a situation where the transitions
are 
> supposed to fire in the same step (being in concurrent regions
of a 
> composite state):
> 
>       evt/x=y
>     ----------->
> - - - - - - - - -
>       evt/y=x
>     ----------->
> 
> In both cases, for a classical Harel statechart, the variables
would be 
> swapped when the transition(s) is/are executed, because any
changes 
> caused by the actions become effective in the next step only.
Harel's 
> old publications are very clear about this.
> 
> What's the situation for a UML statemachine, I wonder? As
mentioned in 
> the original post, my intuition says that for the first case
both 
> variables assume the former value of y. For the second case,
I'd say the 
> result is undefined, since you can't really foretell which
transition 
> fires first.

Exactly! In the second example it cannot be determined which
completes first, so when it comes to actual implementation it
should not matter in which sequence you code the actions.

I believe that some languages (Ada for example) will actually
allow you to express such a situation and only when the code is
compiled will the order be determined.

Les.

________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag
Received on Thu May 12 17:49:04 2005