Truth Tables : Defining a Truth Table

Defining a Truth Table

In Statemate, you can define truth tables in the Properties window for the following elements:

Action

Any work done as a result of:

Making a transition in a statechart.

Executing a static reaction within a state.

Executing a mini-spec within an activity.

Making an assignment

Generating an event

Invoking a defined (named) action

Several special types of expressions (starting/stopping/ suspending activities, clearing history, and so on.)

Activity

The primary graphical object in activity charts that represent a function in the functional view of the system. An activity represents something that transforms inputs into outputs.

There are three types of activities:

Activities can be allocated to modules (structure) and can contain statecharts. You can specify the behavior of an activity by connecting it to a subroutine.

Procedure-like activities can be connected to procedures within any of the languages supported.
Internal primitive activities (reactive-controlled and reactive-self) can be connected to tasks (no mini-specs or decomposition is allowed).
Procedure

A subroutine that has no return value but can have multiple parameters. Each parameter can be INPUT, OUTPUT, or INPUT/OUTPUT.

To define a truth table:

1.
From the Search window or a chart, access the Property window for the element for which you want to define a truth table.

The following figure shows the Property window for an action element, accessed from the Search tab.
2.
Select Truth Table from the Selected Implementation pull-down menu.
3.
Click Edit to start the truth-table editor, as shown in the following figure.
4.
Using the Worksheet option in the toolbar, you can perform the following tasks:

Insert Row - adds one row above the selected row.

Insert Column - adds one column to the left of the selected column.

Redefine Table - displays the Redefine Table dialog box. Allows you to change the number of inputs or outputs or the number of rows, or adds or removes the action section.

Remove Selected - removes the selected rows or columns.

Add Default Row - adds a default row. (Because a truth table can only include one default row, this option is not available if the table already has a default row.) Note that the Input columns in the default row are read-only, but you can edit both the output and action columns.

Join Cells - joins two adjacent cells within the same column.

Split Cells - splits a previously united cell back into two separate cells.

Local Variables - This option is available only for truth tables attached to subroutines. When you select this option, a dialog box opens. In this dialog box, you can define the name and data type for the local variables.

5.
Select File > Save, then File > Exit to confirm your selections and exit the editor.