Often while programming in Stateflow, I split a superstate's default transition using a junction. Downstream of the junction, I guard each possible path with different transition conditions, so that when the superstate is entered, the activated substate changes according to other factors (such as external inputs to the state machine). I find this is a very useful construct.
However, not leaving at least one "unconditional" pathway trips a diagnostic warning when the model is built. ("Warning - No unconditional default path to a substate"). This warning occurs even when there is no possible way that indeterminate logic exists within the transition tree. For example, consider the case where default transition splits into two paths at a junction; one transition is guarded by the condition [my_boolean] and the other is guarded by [~my_boolean]. One or the other path has to be taken, so there is a valid default transition to some substate in all cases. But the warning is still triggered.
One option is of course to disable the diagnostic. And I realize that there are other ways to program such logic to prevent the diagnostic from appearing -- for instance in my example above, one of the two possible transitions out of the junction can be left unguarded & that transition can be set lower in the execution order. However in general I prefer to explicitly guard transitions with conditions where possible, rather then rely implicitly on execution ordering. I feel that this makes for more clearly understandable state machines & offers less chance for inadvertently affecting the behavior of the program when future changes are made.
Therefore I was wondering if there is a way for the stateflow diagnostic to be made smarter? So that when such a split default transition is detected, the parser first checks whether indeterminate behavior is possible before flagging the construct as faulty?
(I am currently using Matlab 2014b, apologies if this has already been addressed in newer versions)