Main Content

Add Assumptions to Requirements

Since R2022a

While specifying formal requirements with a Requirements Table block, you may have a model where physical or mathematical limitations prevent data from being certain values. You can constrain the values of the input data checked in your requirements by creating assumptions in the Assumptions tab.

The Requirements Table block evaluates assumptions before requirements. Assumptions include a Precondition and Postcondition column to define preconditions and postconditions. New Requirements Table blocks contain one empty assumption.

This shows the inside of a new Requirements Table block on the Assumptions tab. It contains one blank assumption.

If the precondition of an assumption is met, the postcondition enforces a constraint on data used in the requirements. If the precondition of an assumption is not met, the block ignores the constraint in the postcondition. Unlike postconditions in the Requirements tab, the postconditions in the Assumptions tab must be satisfied, otherwise the block returns an error. If you want to enforce an assumption regardless of input values, fill in the postcondition and leave the precondition blank.

In the table, you can use the context menu to do the same actions as in the Requirements tab, as well as add, modify, or delete assumptions.

  • Add assumptions by right-clicking a cell in the Index column and clicking Add Assumption After.

  • Delete assumptions by right-clicking the row index and selecting Delete Assumption.

  • Clear the assumptions by right-clicking the row index and selecting Clear Assumption.

You define assumptions by using the same syntax used for requirement preconditions and postconditions. See Create Expressions for Formal Requirements. Assumptions do not have column header cells, and each assumption has only one precondition and postcondition.

Use Assumptions in an Example Model

This example uses assumptions to evaluate the requirements for a simple car ignition system to establish the physical limitations of the model. By including assumptions, the block constrains the possible values of the data used in the requirements.

Open the Requirements Table block. The block captures the signals with three input ports, Throttle, Ignition, and Speed. The block confirms that the Speed signal satisfies conditions for a provided range of the Throttle and Ignition values by defining data with the same names.

Click the Assumptions tab. The table has two assumptions that constrain the input Throttle based on the physical limitations of the system:

  1. If the car ignition is off, then the throttle must also be off.

  2. The throttle cannot be negative.

The first assumption enforces the first limitation, and the second assumption enforces the second limitation.

See Also

Related Topics