Stateflow    

Temporal Logic Events

Stateflow treats the following notations as equivalent

where to is a temporal operator (after, before, at, every), E is the operator's base event, n is the operator's occurrence count, and C is any conditional expression. For example, the following expressions are functionally equivalent in Stateflow.

The first notation is referred to as the conditional notation for temporal logic operators and the second notation as the event notation.

Although temporal logic does not introduce any new events into a Stateflow model, it is useful to think of the change of value of a temporal logic condition as an event. For example, suppose that you want a transition to occur from state A exactly 10 clock cycles after activation of the state. One way to achieve this would be to define an event called ALARM and to broadcast this event 10 CLK events after state A is entered. You would then use ALARM as the event that triggers the transition out of state A.

An easier way to achieve the same behavior is to set a temporal logic condition on the CLK event that triggers the transition out of state A.

Note that this approach does not require creation of any new events. Nevertheless, conceptually it is useful to think of this expression as equivalent to creation of an implicit event that triggers the transition. Hence, Stateflow's support for the equivalent event notation.

Note that the event notation allows you to set additional constraints on the implicit temporal logic "event," for example,

This expression says, "Exit state A if the temperature is cold but no sooner than 10 clock cycles."


 Every Operator Semantics