Newer
Older
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- Documentation of Creating a Hierarchical State Automaton. -->
<link rel="stylesheet" type="text/css" href="../layout/stylesheet.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Creating a Hierarchical State Automaton using AutoFOCUS3 (AF3)</title>
</head>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<div class="header">
<div class="box">
<div class="navbar">
<!--a href="https://www.fortiss.org/" align="left">
<img src="fortiss-logo.png" width="90px" height="20px" align="left">
</a-->
<div class="dropdown">
<button class="btn" id="hamburger">
<label for="hamburger" class="hamburger">
<span class="hamburgerLine"></span>
<span class="hamburgerLine"></span>
<span class="hamburgerLine"></span>
</label>
</button>
<div class="dropdown-content">
<a href="../getting_started.html"> Main Page</a>
<a href="../requirements/MIRA.requirements.html">Requirements Engineering</a>
<a href="#">Deployment and Code Generation</a>
<a href="#">Design Space Exploration (DSE)</a>
<a href="#">Assurance Case Modeling</a>
<a href="#">Further Resources</a>
</div>
</div>
<div class="dropdown">
<button class="dropbtn">Modeling and Simulation <i class="triangle"></i></button>
<div class="dropdown-content">
<a href="model_element_attributes.html">Introduction to Graphical Modeling Interface</a>
<a href="component_architecture.html">Component Architecture Modeling</a>
<a href="data_dictionary.html">Data Dictionary: Types and Functions</a>
<a href="code_specification.html">Behavior Modeling -> Code Specifications</a>
<a href="state_automaton.html">Behavior Modeling -> State Automata</a>
<a href="mode_automaton.html">Behavior Modeling -> Mode Automata</a>
<a href="simulation_with_af3.html">Simulation -> Simulation</a>
<a href="operatorpanels.html">Simulation -> Operator Panels</a>
<a href="operatorpanels_advanced.html">Simulation -> Advanced interface</a>
<a href="cosimulation_with_af3.html">Simulation -> Co-Simulation and FMI Support</a>
<a href="refactoring.html">Refactoring</a>
<a href="model_markers_view.html">On-the-fly Checks</a>
</div>
</div>
<div class="topnav-right">
<a href="mailto:af_user@lists.fortiss.org?subject=Reporting 'state_automaton.html' Documentation Problem!&body= Dear Af3 team, I am reporting an issue related to 'modelling and simulation'.
{Please specify the problem precisely here.}.">Report a Problem?</a>
</div>
</div>
</head>
</div>
</div>
<div class="box">
<button onclick="topFunction()" id="upBtn" title="Go to top">Top</button>
<h2>Creating a Hierarchical State Automaton</h2>
<p><i>Hierarchical State Automatons</i> ("HSA") are an extension of <a href="state_automaton.html"><i>State Automatons</i></a> whose states can themselves contain state automatons.</p>
<p>
Note that HSAs are experimental, thus not all features of state automata are supported.
In particular, the support for verification is limited (e.g., reachability analysis is not supported).
The simulation of HSAs is possible.</p>
<h4>When to use HSAs?</h4>
<p>HSAs are useful when a usual state automaton becomes too big to be handled conveniently.
In this case, one can often decompose the state automaton into a HSA.
Note that <i>HSAs are not more powerful than state automata</i>, i.e., one cannot use a HSA to model a behavior which
cannot be modeled by a state automaton.</p>
<h4>Create a Hierarchical State Automaton</h4>
<p>To create a HSA, simply model the top state automaton like any other automaton:</p>
<img width=900px src="./pictures/HSA.Base.Automaton.png">
<p>Then simply drag&drop a state from the Model Elements View to <i>some existing state</i> of your diagram:</p>
<img width=900px src="./pictures/HSA.Drag.Drop.png">
<p>This will create a state automaton inside the existing state:</p>
<img width=900px src="./pictures/HSA.Built.png">
<p>You can then double click the state to open this inner automaton:</p>
<img width=900px src="./pictures/HSA.Inside.png">
<p>And start building the inside automaton as any <a href="state_automaton.html">state automaton</a>:</p>
<img width=900px src="./pictures/HSA.Inner.Built.png">
<p>When modeling the inner automaton, one can notice that some ports are automatically added, disconnected from any state.
See, e.g., Input, Input1, and Output below:</p>
<img width=900px src="./pictures/HSA.Inside.Ports.png">
<p>Just as any other port, these ports can be connected to the states, thus allowing to make a connection between the behavior
of the inner state automaton and the outer state automaton.</p>
<h4>Semantics and Behavior of the Inner Automaton</h4>
<p>The inner automaton is connected to the outer one through the ports of the outer state.
The semantics of the HSA are as follows:
assume a transition followed in the outer state automaton goes to a hierarchical state through some port "Input":</p>
<img width=900px src="./pictures/HSA.Base.Automaton.Behavior.png">
<p>Then the focus switches to the inside automaton by following any suitable transition from "Input":</p>
<img width=900px src="./pictures/HSA.Inner.Automaton.Behavior.png">
<p>Once inside this automaton, the usual behavior of state automaton applies.
Note that, meanwhile, the outer automaton is "frozen" in its current state.
This is until an output port is reached in the inner automaton:</p>
<img width=900px src="./pictures/HSA.Inner.Automaton.Out.png">
<p>In that case the focus gets back to the outer automaton, which follows the appropriate transition:</p>
<img width=900px src="./pictures/HSA.Base.Automaton.Out.png">
<script src="../layout/jsscript/topBtn.js">
</script>
</html>