Statecharts - 04 Flashcards
What is the motivation behind statecharts?
Statecharts provide solutions beyond concurrency to consider hierarchy, modularization, information hiding, and communication. Specially good for large and complex systems.
What is a superstate?
Superstates:
* Similarly to Mealy and Moore machines, statecharts have states and transitions, which are activated by events.
* New are so-called superstates, which unify basic states.
* States are visualized by rounded boxes and transitions by arrows.
What different ways can an initial state be specified in a statechart?
There only exists one initial state for Mealy and Moore machines. Statecharts can define an initial state:
* on different hierarchy levels and
* across different hierarchy levels
What is the H symbol used for? What is the difference for the H^*?
Activation of Previously Active States:
One can choose the state that was active before leaving a superstate as the initial state:
* This is realized by the H symbol (for history).
* Initial entry: the H symbol is ignored, and the next transition is activated, or one starts with the initial state.
The H symbol activates the state most recently active within a hierarchy level. The H^* symbol activates the most recently active basic state.
What is the symbol C used for in statecharts?
Events and conditions can be combined using and, or, and not. AND connections can also be realized graphically.
Conditions belonging to the same event can be combined with C (for condition).
What is the difference regarding the generation of events between statecharts and FSA?
Difference to FSA:
* The generation of events in finite state automata is only used for outputs.
– Mealy machine: Outputs are generated by transitions.
– Moore machine: Outputs are generated by entering a state.
* Statecharts can additionally generate events that can trigger internal transitions (for simulating communication).
* Besides generating events through transitions or entering states (see Mealy and Moore machine), statecharts
can also generate events when exiting states.
Syntax:
* Transitions: notation /α next to a transition for the output event α (see Mealy machines).
* Entering/exiting a state: keywords entry and exit.
What is the difference regarding the generation of continuous signals between statecharts and SIPN?
Other than for finite state automata, signal-interpreted Petri nets generate output signals in continuous time. This is
also possible in statecharts.
Difference to signal-interpreted Petri nets:
* Signal-interpreted Petri nets only use continuous signals for outputs.
* In statecharts, continuous signals can also be used for conditions of transitions.
Syntax:
* Activation of a variable or setting its value while in a state: keyword throughout a state (e.g., throughout X ∶= 2;
throughout X).
* Activation of a variable X: keywords start(X) and stop(X).
Explain scheduled events and timeouts in statecharts.
Scheduled event: A scheduled event α can be generated by the command schedule(α, ts) at time ts.
Timeout: A special event timeout(α, td) is generated after the event α with a time delay of td.
What is a statechart configuration?
Given a root state R, a configuration (relative to R) is a set of states S obeying the following rules:
* R ∈ S
* If S contains an XOR state A, it must also contain exactly one of the substates of A
* If S contains an AND state B, it must also contain all substates of B
* The only states in S are those that are required by the above rules.
What is a full compound transition?
A full compound transition leads the system from one configuration via partial transitions
to another configuration.
What is the scope of a full compound transition?
The scope of a full compound transition is the lowest hierarchy level XOR state, which all initial and final states
have in common. When executing a full compound transition, all states within the scope before the transition is exited and all states within the scope after the transition are entered.
How to deal with conflicting transitions?
The transition with the largest scope that includes the scope of all other transitions is executed.