Simple Table Specification
back to Table Specification
Create a Simple Table Specification
For a basic component, we can add a simple table to it just drag and drop the corresponding item from the Model Elements view:
When adding a simple table specification to a component, a State Transition Table is created:
This table contains has two sorts of columns: the ''input'' columns and the ''output'' columns.
As shows the above figure, there is one input column per input port and one output column per output port.
Operations on Transition Table
State Transition Table and Mode Transition Table not only have the similar structure, but also have similar operations on tables.Each state transition table can change its table structure by table structure configuration. However, the mode transition table has no such feature. Each mode transition table is designed to own "Source" column (source mode) and "Target" column (target mode).
To define the transition rules of the State (Mode) Transition Table, the correct type of the input is required. All of cells of table in the Transition Rule Editor should be the right data type required.
Some operations on tables has been introduced in simple table specification.
The structure of a table is flexible: one can delete a column by clicking on the "-" to the right of its header.
This simply means that the corresponding column has no impact on the result.
One can also modify a column header simply by clicking on it, and add a column by clicking on the rightmost "+" in the inputs column. One new condition column will be created after the type of the expression. Only the expression with supported date type will be accepted, such as a boolean, an integer or a double-valued expression.
We can add rows to the table by clicking the left "+" next to "Click to add a new rule...":
The default row contains NoVal everywhere, but we can modify this value by clicking on the corresponding cells:
The cell value must have the same type as the corresponding port.
If the port has an enumerated type, the cell allows to select a value among the values of the list.
For instance in the following figure, we assume that Input1 has the type int and Output has the type boolean:
This row means that if Input1 receives the value 0 and Input2 receives no value, then Output is set to true.
A table row can be removed by clicking the "-" left to it.
In addition to the usual values, we can also use a star "*" in a condition column, to denote "any value":
The second row specifies that the result should be false if Input1 does not receive any message,
whatever is the value of Input2.
As many rows as required can be added, for instance:
As this figure shows, the output column can contain complex expressions instead of constants:
here the fifth row sets the output to Input1-Input2.
If many rows can apply, only the first one will be executed, and if some situation corresponds to no row then nothing happens.
Checking whether a table is deterministic or complete can be achieved automatically using the dedicated analysis tools.
- Step 1 - Open an state transition table in Transition Table Editor.
- Step 2 - Choose "Table Mode Editor" tab to open Table ModeEditor.
- To Add a new table state, please press the "Add" button on the right side.
- To remove a table state from the table, please choose the table state at first, then click the "Remove" button on the right side.
- To set a table state as initial state, please double click on this table state. If
shown before the table state, then this table state is initial.
The table specification can be simulated in the AF3 Simulator. If a row is picked for execution, the row will be highlighted.
- Step 1 - Open the "Tabular Specification Analyses" view by clicking on the button
from the toolbar and choose the "Nondeterminism Analyses" tab.
- Step 2 - Open a (State/Mode) Transition Table in the editor and press the "Check non-determinism" button.
- Step 3 - In case when potential non-deterministic transitions are found, they will be displayed in the table on the left side. On the right-side an evidence about the non-determinism will be shown.
- Step 1 - Open the "Tabular Specification Analyses" view by clicking on the button
from the toolbar and choose the "Completeness Analyses" tab.
- Step 2 - Open a State Transition Table in the editor and press the "Check completeness" button.
- Step 3 - In case when potential missing condition are found, they will be displayed in the table on the left side. When one of the missing conditions is chosen, on the right-side an example about the incompleteness will be shown in "Evidence" table.