Rule 043I

Forum for discussing and asking questions about the MISRA document MISRA AC SLSF "Modelling design and style guidelines for the application of Simulink and Stateflow"

Moderators: david ward, GeoffFrost

Post Reply
Ale_mm
Posts: 4
Joined: Wed May 04, 2011 6:18 am
Company: Magneti Marelli S.p.A.
Location: Milano - Italy

Rule 043I

Post by Ale_mm » Wed Jul 13, 2011 7:50 am

Hello,

I've a doubt regarding the rule 043I of SLSF set. The rule tells: "In all flow-charts and graphical functions, exactly one unconditional transition must begin at every junction (except for the last junction). Every decision point (junction) must have a default path."
The problem is about the bounds of this rules, because it'd delimited only for flow-charts. Since a flowchart contains none or one state, the rule is not applied in case that I have a junction, without a default path, between two state.
Therefore my question is, why this rule (and as far as I know, no others) does not check default paths in junctions between states? Or else, why this rule is only flowcharts circumscribed and not statecharts as well?


Many thanks in advance,
any feedback will be really appreciated,

Alessandro

MISRA Reply
Posts: 52
Joined: Mon Dec 06, 2004 12:24 pm

Re: Rule 043I

Post by MISRA Reply » Thu Jul 28, 2011 5:32 pm

The case of default path application for junctions residing on transitions between two states is effectively covered by rule 043H.

Rule 043I is most concerned with ensuring there is always a clearly defined path from the start point through to the single end point in a flowchart. On transitions between states there is not the same need to ensure a path through to a single end point and as a result it is not the case that a default transition from a junction is required in all circumstances on state transition paths.

See for instance Example 3 in Rule 043H where the junction does not have or require a default transition. If we were to follow the spirit of Rule 043I here and take a default transition from the mid-point junction back to state A then the statechart will exhibit different execution properties; in the original form if ‘a > C1’ and ‘b <= C2’ then Stateflow semantics retain A as the current state but for the same conditions and with a default path from the mid-point back to state A then Stateflow semantics will cause us to exit state A, run any exit conditions as a result, and then re-enter state A and run any entry conditions of state A. This may well be undesired and unintended behaviour, which 043H aims to protect against.

Ale_mm
Posts: 4
Joined: Wed May 04, 2011 6:18 am
Company: Magneti Marelli S.p.A.
Location: Milano - Italy

Re: Rule 043I

Post by Ale_mm » Tue Aug 02, 2011 8:06 am

I've clearly understood the main point and the reason/behaviour of the rule 43. Mainly I didn't think about the side-effect of exit and re-enter in a current state.
Many thanks for the reply.

Best Regards,
Alessandro

Post Reply

Return to “MISRA AC SLSF discussions”