Establish Hierarchy in Requirements Table Blocks
When defining requirements and assumptions in a Requirements Table block, you may decide that some requirements or assumptions must relate to one another in a hierarchy. For example, you may have a requirement precondition that you want to check only if another precondition is valid. You can establish row hierarchy by using child rows. You can change row hierarchy by moving rows to a lower or higher hierarchy level. For more information on how to define requirements and assumptions, see Use a Requirements Table Block to Create Formal Requirements and Add Assumptions to Requirements.
Add Child Rows
Requirements and assumptions are organized in rows. You can organize the rows into a hierarchy by creating parent and child rows. Use child rows to determine evaluation hierarchy. For example, if a parent requirement precondition is valid, the block checks the preconditions of the child requirements. Otherwise, the block ignores the child preconditions.
To create child requirement rows, select the index of a requirement row and, in the Rows section of the Table tab, select Add Requirement > Add Child. To create child assumption rows, select the index of an assumption row and, in the Rows section of the Table tab, select Add Assumption > Add Child.
The index number of a child row is the index of the parent followed by the index of the child. You can have multiple child rows at each hierarchy level and multiple hierarchy levels. Rows in the same hierarchy level that have the same parent, or rows that do not have parent rows, are called siblings.
Modify Row Hierarchy
If you want to move a row to a higher or lower hierarchy level, click the index of the row you want to move. Then, in the Rows section of the Table tab, click the Make selected row a parent button or the Make selected row a child button .
You can delete child rows by right-clicking the index of a child row and clicking the Delete selected row button.
Use Child Rows in an Example Model
This example uses a Requirements Table block that has child requirements. The model tests a signal and outputs two values if the model behavior meets the parent and child requirements.
Open the Requirements Table block to see the parent and child requirements. If the input signal satisfies the precondition of the first requirement, the block executes the action and then tests the child requirements. In this example, the child requirements control the output data z
. The second requirement executes if the input signal does not satisfy the precondition of the first requirement.
Run the simulation and open the Scope block to observe the block output.
See Also
Blocks
Functions
Related Examples
- Control Requirement Execution by Using Temporal Logic
- Detect Data Changes by Using Requirements Table Blocks
- Add Assumptions to Requirements