Requirement block
Requirements.Verify.Requirement
ยท source
Check requirement defined by Property input property (property shall be Property.Satisfied)
Extends Requirements.Interfaces.PartialRequirement
This block is used to verify a requirement. The input signal "property" can have the four values Violated, Undecided, Satisfied or Undefined (= elements of enumeration Property). A requirement is violated, if property = Violated at any instant; it is untested, if property was Undecided (applicable, not decided) or Undefined (not applicable) all the time; and it is satisfied otherwise. The number of attempts (phases in which the property was not Undefined) is logged beside the verdict. If a required property is naturally defined as Boolean, use block BooleanRequirement instead.
With parameter text a textual description of the required property should be defined in natural language. This description is, for example, shown when a requirement is violated at the end of a simulation.
In the top level of a model, block PrintViolations has to be dragged. This block prints an information message at the end of a simulation, whether a Requirement has been violated, untested, or satisfied in the current simulation run (the amount of output can be configured). Furthermore, all Requirement instances store information about the Requirement in a log file (the default name is "<root-name>_log.txt"; this name can be changed via parameter logFile in the instance of PrintViolations. Exactly one line is printed in the log file with the status for every instance of a Requirement block.
This block is demonstrated with the following example:
results in
![]() | |
| simulation result |
Violation statistics. With computeStatistics = true (tab Statistics) the block also counts
how often the property was violated, for how long in total and at most, and, with useMargin = true
and its margin input connected to the check block's margin, the worst margin and when.
The statistics are those of
ViolationStatistics, which the block then
contains as statistics. They are logged as a Statistics line beside the verdict and
printed in the summary of PrintViolations. Example:
Examples.Elementary.ViolationStatistics.RequirementLog.
In a textual definition, the Requirements block can be used as shown in this example:
import Requirements.LogicalFunctions.*; import Requirements.Types.Property; Requirement R_Violated (property = PropertyToBoolean(check)); Requirement R_Undecided(property = Property.Undecided); Requirement R_Satisfied(property = during(check, check));
Components and variables
| Name | Type | Description |
|---|---|---|
property | Requirements.Interfaces.PropertyInput | Property that shall be Satisfied |

