.. _reference-diagnostics-label: Diagnostics ====================== A *diagnostic* is what the checker reports about a specification: a syntax error, or an *issue* found by one of its analyses. Each kind of issue has a *code* that does not change, a *severity* and a message. This page lists them all. For each one it gives an example specification that ``reqtool`` really reports, and how to fix it. Reading a report ********************** .. literalinclude:: diagnostics/E03010-unexpected-type.req :language: req .. literalinclude:: diagnostics/E03010-unexpected-type.out :language: none :caption: reqtool check * The position of the issue in the source, ``line:column``, both counted from zero. * The code, ``E03010``, and the message. * The source the issue is about, here the expression. ``reqtool check`` prints nothing when the specification has no diagnostic. The checker's messages call the entity a requirement constrains, the one after ``on``, its *restriction*, and the one after ``via``, its *allocation*. With ``--json``, ``reqtool check`` gives the same information in a machine-readable report, with the path of the entity the issue is about (here ``System::Speed_bound``) in addition, see :doc:`/agents`. The language server gives each diagnostic its code. Severities ********************** An issue has one of four severities, from the least to the most severe: ``light``, ``moderate``, ``severe`` and ``critical``. The language server shows them as hints, information, warnings and errors, in this order. A syntax error is always ``critical``, and ``reqtool`` reports it in the same list as the other diagnostics. Codes and kinds ********************** A code is ``E0``, a digit and three more digits, like ``E04010``. The digit is the *kind* of the issue, what it is about: .. list-table:: :header-rows: 1 :widths: 15 15 70 * - Kind - Codes - What the issue is about * - ``syntax`` - ``E00xxx`` - The source does not follow the grammar of the language. * - ``path`` - ``E01xxx`` - The name of an entity, which must be unique and well formed, and the root of the specification. * - ``reference`` - ``E02xxx`` - A reference that points at nothing. * - ``typing`` - ``E03xxx`` - The type of an expression. * - ``connection`` - ``E04xxx`` - Where an entity is, and how requirements are linked to the entities and to each other. The kind is also given by ``reqtool check --json`` and by the language server. A code is never changed or reused, even when its issue is no longer reported. The numbers go by steps of ten, so that an issue can be split in two and the new one take a number next to the old one. All the codes ~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 :widths: 15 55 15 15 * - Code - Title - Severity - Kind * - :ref:`E00010 ` - Syntax error - critical - syntax * - :ref:`E01010 ` - Duplicated entity - critical - path * - :ref:`E01020 ` - Invalid identifier - critical - path * - :ref:`E01030 ` - Invalid root - critical - path * - :ref:`E02010 ` - Unresolved reference - critical - reference * - :ref:`E03010 ` - Unexpected type - critical - typing * - :ref:`E03020 ` - Not a set - critical - typing * - :ref:`E03030 ` - Not evaluable - critical - typing * - :ref:`E03040 ` - Propagated type error - critical - typing * - :ref:`E04010 ` - Missing constraint - severe - connection * - :ref:`E04020 ` - Missing upward traceability - light - connection * - :ref:`E04030 ` - Missing downward traceability - light - connection * - :ref:`E04040 ` - Invalid requirement parent - critical - connection * - :ref:`E04050 ` - Invalid package parent - critical - connection * - :ref:`E04060 ` - Invalid attribute parent - critical - connection * - :ref:`E04070 ` - Unrestricted entity - moderate - connection * - :ref:`E04080 ` - Unused entity - light - connection * - :ref:`E04090 ` - Not a part or attribute - critical - connection * - :ref:`E04100 ` - Not a requirement - critical - connection * - :ref:`E04110 ` - Allocation of a bottom requirement - critical - connection * - :ref:`E04120 ` - Allocation without derivation - light - connection * - :ref:`E04130 ` - Duplicated traceability link - moderate - connection * - :ref:`E04140 ` - Conflicting traceability links - severe - connection * - :ref:`E04150 ` - Specialization mismatch - severe - connection * - :ref:`E04160 ` - Cyclic traceability - severe - connection * - :ref:`E04170 ` - Upward link of a top requirement - moderate - connection * - :ref:`E04180 ` - Downward link to a bottom requirement - moderate - connection * - :ref:`E04190 ` - Refinement mismatch - severe - connection * - :ref:`E04200 ` - Derivation of an unallocated requirement - moderate - connection * - :ref:`E04210 ` - Derivation mismatch - severe - connection * - :ref:`E04220 ` - Unrelated derivation - moderate - connection * - :ref:`E04230 ` - Constrained entity not used - moderate - connection * - :ref:`E04240 ` - Allocation and constraint on the same entity - moderate - connection Syntax ********************** The source does not follow the grammar of the language. .. _E00010: Syntax error ~~~~~~~~~~~~~~~~~~~~~~ :Code: E00010 :Severity: critical :Kind: syntax The source does not follow the grammar. The checker reports the token it could not go on with, here ``part``, which has no name. The entities around a syntax error may be incomplete, so the other diagnostics around it can be consequences of it: fix the syntax errors first. ``reqtool fmt`` does not format a source that has syntax errors. For now all the syntax errors have the same code and message: the checker tells where the parse stopped, not why. .. rubric:: Example A part needs a name. .. literalinclude:: diagnostics/E00010-syntax-error.req :language: req .. literalinclude:: diagnostics/E00010-syntax-error.out :language: none :caption: reqtool check .. rubric:: Fix Correct the source at the reported position: the error is the token the parser could not go on with. Path ********************** The name of an entity, which must be unique. .. _E01010: Duplicated entity ~~~~~~~~~~~~~~~~~~~~~~ :Code: E01010 :Severity: critical :Kind: path Two entities have the same path: the same identifier under the same parent. Both of them are reported. .. rubric:: Example Two requirements of the package ``System`` are named ``Wheel_size``. .. literalinclude:: diagnostics/E01010-duplicated-entity.req :language: req .. literalinclude:: diagnostics/E01010-duplicated-entity.out :language: none :caption: reqtool check .. rubric:: Fix Rename one of the two entities, or move it under another parent: the same identifier can be used under different parents. .. rubric:: Why Each entity is uniquely identified by its path, see :ref:`reference-reference-label`. .. _E01020: Invalid identifier ~~~~~~~~~~~~~~~~~~~~~~ :Code: E01020 :Severity: critical :Kind: path The identifier of an entity is not made of letters, digits and ``_``, or starts with a digit. Letters of any alphabet are accepted: ``température`` is an identifier. .. rubric:: Example ``1st_stage`` starts with a digit, and ``Booster-2`` has a dash. .. literalinclude:: diagnostics/E01020-invalid-identifier.req :language: req .. literalinclude:: diagnostics/E01020-invalid-identifier.out :language: none :caption: reqtool check .. rubric:: Fix Rename the entity: replace the other characters with ``_`` and start it with a letter, ``First_stage`` and ``Booster_2`` here. .. rubric:: Why An expression reads ``1st_stage`` as the number ``1`` followed by ``st_stage``, and ``Booster-2`` as a subtraction: it could never refer to these entities. See :ref:`reference-entities-label`. .. _E01030: Invalid root ~~~~~~~~~~~~~~~~~~~~~~ :Code: E01030 :Severity: critical :Kind: path The root of the specification, the entity that contains all the others, is not a package. .. rubric:: Example The specification starts with the part ``Machine``. No requirement can be written in a part, so nothing uses or constrains ``Machine``, which is reported as well, see :ref:`E04080 ` and :ref:`E04070 `. .. literalinclude:: diagnostics/E01030-invalid-root.req :language: req .. literalinclude:: diagnostics/E01030-invalid-root.out :language: none :caption: reqtool check .. rubric:: Fix Put the specification in a package: ``package Factory``, the part ``Machine``, then ``package``. .. rubric:: Why A specification starts with a package, the parent of all the other entities, see :ref:`reference-entities-label`. Reference ********************** A reference that points at nothing. .. _E02010: Unresolved reference ~~~~~~~~~~~~~~~~~~~~~~ :Code: E02010 :Severity: critical :Kind: reference A reference points to a path that is not in scope. A reference is the path written after ``on``, ``via``, ``refines``, ``derives`` or ``specializes``, between ``[[`` and ``]]`` in a text, or an identifier of an expression. The path is resolved with the rules of :ref:`reference-reference-label`. A reference that cannot be resolved connects nothing: a requirement whose ``on`` cannot be resolved is also reported as :ref:`E04010 `. An expression that contains an identifier that cannot be resolved has no type. The expressions around it are not reported for it, see :ref:`E03040 `. .. rubric:: Example ``Wheel::radius`` is referenced in the text, but ``Wheel`` has no attribute ``radius``. .. literalinclude:: diagnostics/E02010-unresolved-reference.req :language: req .. literalinclude:: diagnostics/E02010-unresolved-reference.out :language: none :caption: reqtool check .. rubric:: Example The expression compares the speed with ``Wheel::limit``, which does not exist. .. literalinclude:: diagnostics/E02010-unresolved-identifier.req :language: req .. literalinclude:: diagnostics/E02010-unresolved-identifier.out :language: none :caption: reqtool check .. rubric:: Fix Write the path of an entity that exists. Look for a typo or a missing prefix, or define the entity. Typing ********************** The type of an expression. .. _E03010: Unexpected type ~~~~~~~~~~~~~~~~~~~~~~ :Code: E03010 :Severity: critical :Kind: typing A sub-expression has a type other than the one its operator expects. The message gives the type expected, then the type found: ``Number``, ``Boolean`` or a ``Set``. For example, a comparison of a number with a Boolean, a set literal whose elements do not all have the same type, or a filter (``such that``) that is not Boolean. .. rubric:: Example ``false`` is a Boolean, and ``<`` compares numbers. .. literalinclude:: diagnostics/E03010-unexpected-type.req :language: req .. literalinclude:: diagnostics/E03010-unexpected-type.out :language: none :caption: reqtool check .. rubric:: Fix Use an operand of the type expected. Check the domain of the attributes and what the operator applies to, see the :ref:`type system ` of the expression language. .. _E03020: Not a set ~~~~~~~~~~~~~~~~~~~~~~ :Code: E03020 :Severity: critical :Kind: typing An expression needs a set and has another type. A set is expected as the right operand of ``in`` and ``includes``, as the domain of a comprehension, and as the domain of an attribute used in an expression. The message gives the type found. .. rubric:: Example ``in`` expects a set on its right, and ``3`` is a number. .. literalinclude:: diagnostics/E03020-not-a-set.req :language: req .. literalinclude:: diagnostics/E03020-not-a-set.out :language: none :caption: reqtool check .. rubric:: Fix Write a set, such as ``{1, 2}``, see :ref:`reference-type-set-label`. .. _E03030: Not evaluable ~~~~~~~~~~~~~~~~~~~~~~ :Code: E03030 :Severity: critical :Kind: typing An expression uses an entity that has no type. An entity gets its type from its expression, the domain of an attribute for instance. A part, a package or an informal requirement has none. .. rubric:: Example ``Wheel`` is a part: only its attributes have a type. .. literalinclude:: diagnostics/E03030-not-evaluable.req :language: req .. literalinclude:: diagnostics/E03030-not-evaluable.out :language: none :caption: reqtool check .. rubric:: Fix Name an attribute of the entity instead of the entity itself. .. _E03040: Propagated type error ~~~~~~~~~~~~~~~~~~~~~~ :Code: E03040 :Severity: critical :Kind: typing An expression depends on a sub-expression that already has an issue. The issue is marked on the expressions that contain it, so that one mistake is reported once, where it is. This code is reserved: it is never reported. It is listed so that its number is not reused. .. rubric:: Fix Fix the issue that is reported on the sub-expression. Connection ********************** Where an entity is, and how requirements are linked to the entities and to each other. .. _E04010: Missing constraint ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04010 :Severity: severe :Kind: connection A requirement does not name the entity it constrains: it has no ``on``, or the entity after ``on`` cannot be resolved (it is then reported as :ref:`E02010 `). The checker's messages call the constrained entity the *restriction* of the requirement. See :ref:`reference-requirement-constraint-label`. .. rubric:: Example ``Wheel_exists`` has no ``on``. As a consequence, nothing constrains ``Wheel``, which is reported as well, see :ref:`E04070 `. .. literalinclude:: diagnostics/E04010-missing-requirement-binding.req :language: req .. literalinclude:: diagnostics/E04010-missing-requirement-binding.out :language: none :caption: reqtool check .. rubric:: Fix Add ``on`` with the path of the part or attribute the requirement constrains. If the path is already there, fix the :ref:`unresolved reference `. .. _E04020: Missing upward traceability ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04020 :Severity: light :Kind: connection A requirement that is not ``top`` has no parent: no ``refines`` and no ``derives`` link to another requirement. A ``specializes`` link does not count. See :ref:`reference-requirement-inhibitor-label`. .. rubric:: Example ``Wheel_round`` is ``bottom`` but not ``top``, and it refines nothing. .. literalinclude:: diagnostics/E04020-missing-upward-trace.req :language: req .. literalinclude:: diagnostics/E04020-missing-upward-trace.out :language: none :caption: reqtool check .. rubric:: Fix Link the requirement to its parent with ``refines`` or ``derives``. If it has no parent, mark it ``top``. .. _E04030: Missing downward traceability ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04030 :Severity: light :Kind: connection A requirement that is not ``bottom`` has no children: no other requirement refines or derives it. A ``specializes`` link does not count. See :ref:`reference-requirement-inhibitor-label`. .. rubric:: Example ``Wheel_round`` is ``top`` but not ``bottom``, and no requirement refines it. .. literalinclude:: diagnostics/E04030-missing-downward-trace.req :language: req .. literalinclude:: diagnostics/E04030-missing-downward-trace.out :language: none :caption: reqtool check .. rubric:: Fix Add the requirements that refine or derive it. If it needs no refinement, mark it ``bottom``. .. _E04040: Invalid requirement parent ~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04040 :Severity: critical :Kind: connection A requirement is contained in an entity that is not a package, here a part. .. rubric:: Example ``Wheel_round`` is written inside the part ``Wheel``. .. literalinclude:: diagnostics/E04040-invalid-requirement-parent.req :language: req .. literalinclude:: diagnostics/E04040-invalid-requirement-parent.out :language: none :caption: reqtool check .. rubric:: Fix Move the requirement into a package. .. rubric:: Why A requirement belongs to one and only one package, see :ref:`reference-package-label`. .. _E04050: Invalid package parent ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04050 :Severity: critical :Kind: connection A package is contained in an entity that is not a package, here a part. .. rubric:: Example The package ``Details`` is written inside the part ``Wheel``. .. literalinclude:: diagnostics/E04050-invalid-package-parent.req :language: req .. literalinclude:: diagnostics/E04050-invalid-package-parent.out :language: none :caption: reqtool check .. rubric:: Fix Move the package into another package. .. rubric:: Why A package contains packages, parts, requirements and imports, and a part contains attributes, parts and imports, see :ref:`reference-package-label` and :ref:`reference-part-label`. .. _E04060: Invalid attribute parent ~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04060 :Severity: critical :Kind: connection An attribute is contained in an entity that is not a part, here a package. .. rubric:: Example The attribute ``speed`` is written directly in the package ``System``. .. literalinclude:: diagnostics/E04060-invalid-attribute-parent.req :language: req .. literalinclude:: diagnostics/E04060-invalid-attribute-parent.out :language: none :caption: reqtool check .. rubric:: Fix Move the attribute into a part. .. rubric:: Why A part is the container of attributes, see :ref:`reference-part-label`. .. _E04070: Unrestricted entity ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04070 :Severity: moderate :Kind: connection No requirement constrains this part or attribute: no requirement names it after ``on``. .. rubric:: Example ``Battery`` is mentioned in a text, but no requirement is ``on`` it. .. literalinclude:: diagnostics/E04070-unrestricted-subject.req :language: req .. literalinclude:: diagnostics/E04070-unrestricted-subject.out :language: none :caption: reqtool check .. rubric:: Fix Add a requirement that is ``on`` the entity, or remove the entity if the specification does not need it. .. _E04080: Unused entity ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04080 :Severity: light :Kind: connection No requirement uses this part or attribute. A requirement uses an entity when its text has a reference ``[[...]]`` to it, or when its expression has an identifier that points to it. Being the entity after ``on`` is not a use, see :ref:`E04230 `. .. rubric:: Example ``Wheel`` is not mentioned anywhere. It is not constrained either, which is reported as well, see :ref:`E04070 `. .. literalinclude:: diagnostics/E04080-unused-subject.req :language: req .. literalinclude:: diagnostics/E04080-unused-subject.out :language: none :caption: reqtool check .. rubric:: Fix Reference the entity in the requirement that is ``on`` it, or in another one, or remove the entity if the specification does not need it. .. _E04090: Not a part or attribute ~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04090 :Severity: critical :Kind: connection The path after ``on`` or ``via`` is the path of another kind of entity: only a part or an attribute can be constrained or allocated. .. rubric:: Example ``Wheel_smooth`` is ``on`` the requirement ``Wheel_round``. .. literalinclude:: diagnostics/E04090-not-a-part-or-attribute.req :language: req .. literalinclude:: diagnostics/E04090-not-a-part-or-attribute.out :language: none :caption: reqtool check .. rubric:: Fix Name the part or attribute the requirement is about. .. _E04100: Not a requirement ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04100 :Severity: critical :Kind: connection The path after ``refines``, ``derives`` or ``specializes`` is the path of another kind of entity: only a requirement can be traced. .. rubric:: Example ``Wheel_round`` refines the part ``Wheel``. .. literalinclude:: diagnostics/E04100-not-a-requirement.req :language: req .. literalinclude:: diagnostics/E04100-not-a-requirement.out :language: none :caption: reqtool check .. rubric:: Fix Name the requirement to trace. .. rubric:: Why See :ref:`reference-requirement-traceability-label`. .. _E04110: Allocation of a bottom requirement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04110 :Severity: critical :Kind: connection A requirement has a ``via`` and is ``bottom``. An allocated requirement is meant to be derived, and a ``bottom`` requirement has no children. .. rubric:: Example ``Wheel_stop`` is allocated to ``Brake`` and marked ``bottom``. Nothing derives it, which is reported as well, see :ref:`E04120 `. .. literalinclude:: diagnostics/E04110-inhibitor-forbid-derives.req :language: req .. literalinclude:: diagnostics/E04110-inhibitor-forbid-derives.out :language: none :caption: reqtool check .. rubric:: Fix Remove ``bottom`` so that the requirement can be derived, or remove ``via`` if it is not to be derived. .. rubric:: Why An allocated requirement is not ``bottom``, since it is meant to be derived, see :ref:`reference-requirement-allocation-label` and :ref:`reference-requirement-inhibitor-label`. .. _E04120: Allocation without derivation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04120 :Severity: light :Kind: connection A requirement is allocated with ``via``, and no requirement derives it while constraining the allocated entity. The issue is reported on the ``via``. .. rubric:: Example ``Wheel_stop`` is allocated to ``Brake``, and nothing derives it. It has no children either, which is reported as well, see :ref:`E04030 `. .. literalinclude:: diagnostics/E04120-missing-derivation.req :language: req .. literalinclude:: diagnostics/E04120-missing-derivation.out :language: none :caption: reqtool check .. rubric:: Fix Add a requirement that is ``on`` the allocated entity and ``derives`` the allocated requirement, or remove the ``via``. .. rubric:: Why An allocated requirement is expected to be answered by requirements that derive it and constrain the allocated entity, see :ref:`reference-requirement-allocation-label`. .. _E04130: Duplicated traceability link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04130 :Severity: moderate :Kind: connection A requirement has the same kind of link to the same requirement more than once. The issue is reported on the repeated link. .. rubric:: Example ``Speed_bound`` refines ``Wheel_stop`` twice. .. literalinclude:: diagnostics/E04130-duplicated-trace.req :language: req .. literalinclude:: diagnostics/E04130-duplicated-trace.out :language: none :caption: reqtool check .. rubric:: Fix Remove the repeated link. .. _E04140: Conflicting traceability links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04140 :Severity: severe :Kind: connection A requirement has links of different kinds to the same requirement, such as ``refines`` and ``specializes``. Each of the links is reported. .. rubric:: Example ``Wheel_stop_wet`` both refines and specializes ``Wheel_stop``. .. literalinclude:: diagnostics/E04140-conflicting-trace.req :language: req .. literalinclude:: diagnostics/E04140-conflicting-trace.out :language: none :caption: reqtool check .. rubric:: Fix Keep the one kind of link that says how the two requirements are related. .. rubric:: Why Each kind of link has its own meaning, see :ref:`reference-requirement-traceability-label`. .. _E04150: Specialization mismatch ~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04150 :Severity: severe :Kind: connection A requirement specializes a requirement that constrains another entity. The issue is reported on the ``specializes`` link. Nothing is reported when one of the two requirements has no constraint, see :ref:`E04010 `. .. rubric:: Example ``Brake_stop`` constrains ``Brake``, and specializes ``Wheel_stop``, which constrains ``Wheel``. .. literalinclude:: diagnostics/E04150-specialization-mismatch.req :language: req .. literalinclude:: diagnostics/E04150-specialization-mismatch.out :language: none :caption: reqtool check .. rubric:: Fix Constrain the same entity as the specialized requirement, or link the requirements with another kind of link. .. rubric:: Why A specialization applies to a subset of the situations of its parent: both requirements constrain the same entity, see :ref:`reference-requirement-traceability-label`. .. _E04160: Cyclic traceability ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04160 :Severity: severe :Kind: connection Following the traceability links leads back to the requirement they started from. Every link of the cycle is reported. .. rubric:: Example ``Wheel_round`` refines ``Wheel_smooth``, which refines ``Wheel_round``. .. literalinclude:: diagnostics/E04160-cyclic-trace.req :language: req .. literalinclude:: diagnostics/E04160-cyclic-trace.out :language: none :caption: reqtool check .. rubric:: Fix Remove one of the links of the cycle. .. rubric:: Why Each link goes from a child requirement to its parent, see :ref:`reference-requirement-traceability-label`: a requirement cannot be its own ancestor. .. _E04170: Upward link of a top requirement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04170 :Severity: moderate :Kind: connection A requirement marked ``top``, which has no parent, refines or derives another requirement. A ``specializes`` link is not concerned. See :ref:`reference-requirement-inhibitor-label`. .. rubric:: Example ``Speed_bound`` is ``top``, and refines ``Wheel_stop``. .. literalinclude:: diagnostics/E04170-forbidden-upward-trace.req :language: req .. literalinclude:: diagnostics/E04170-forbidden-upward-trace.out :language: none :caption: reqtool check .. rubric:: Fix Remove ``top`` if the requirement has a parent, or remove the link. .. _E04180: Downward link to a bottom requirement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04180 :Severity: moderate :Kind: connection A requirement refines or derives a requirement that is marked ``bottom``, which has no children. A ``specializes`` link is not concerned. See :ref:`reference-requirement-inhibitor-label`. .. rubric:: Example ``Wheel_stop`` is ``bottom``, and ``Speed_bound`` refines it. .. literalinclude:: diagnostics/E04180-forbidden-downward-trace.req :language: req .. literalinclude:: diagnostics/E04180-forbidden-downward-trace.out :language: none :caption: reqtool check .. rubric:: Fix Remove ``bottom`` from the traced requirement, or remove the link. .. _E04190: Refinement mismatch ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04190 :Severity: severe :Kind: connection A requirement refines a requirement that constrains an entity that does not contain the entity it constrains: the entity of the refined requirement is neither the entity of this one, nor one of its ancestors. The issue is reported on the ``refines`` link. Nothing is reported when one of the two requirements has no constraint, see :ref:`E04010 `. .. rubric:: Example ``Battery_voltage`` constrains an attribute of ``Battery``, and refines ``Wheel_deceleration``, which constrains ``Wheel``. .. literalinclude:: diagnostics/E04190-refinement-mismatch.req :language: req .. literalinclude:: diagnostics/E04190-refinement-mismatch.out :language: none :caption: reqtool check .. rubric:: Fix Refine a requirement that constrains the same entity, or an entity that contains the one you constrain. Otherwise link the requirements with another kind of link, or no link. .. rubric:: Why A refinement constrains the entity of its parent, or an entity nested inside it, see :ref:`reference-requirement-traceability-label`. .. _E04200: Derivation of an unallocated requirement ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04200 :Severity: moderate :Kind: connection A requirement derives a requirement that has no ``via``. The issue is reported on the ``derives`` link. .. rubric:: Example ``Brake_stops_wheel`` derives ``Wheel_stop``, which is not allocated. .. literalinclude:: diagnostics/E04200-no-derived-allocation.req :language: req .. literalinclude:: diagnostics/E04200-no-derived-allocation.out :language: none :caption: reqtool check .. rubric:: Fix Allocate the derived requirement to the entity the deriving requirement constrains, with ``via``. .. rubric:: Why A derived requirement expects its parent to be allocated, see :ref:`reference-requirement-traceability-label` and :ref:`reference-requirement-allocation-label`. .. _E04210: Derivation mismatch ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04210 :Severity: severe :Kind: connection A requirement derives a requirement that is allocated to another entity than the one it constrains. The issue is reported on the ``derives`` link. .. rubric:: Example ``Wheel_stop`` is allocated to ``Brake``, and the requirement that derives it constrains ``Battery``. The allocation has no derivation, which is reported as well, see :ref:`E04120 `. .. literalinclude:: diagnostics/E04210-derivation-mismatch.req :language: req .. literalinclude:: diagnostics/E04210-derivation-mismatch.out :language: none :caption: reqtool check .. rubric:: Fix Constrain the allocated entity in the deriving requirement, or allocate the derived requirement to the entity the deriving requirement constrains. .. rubric:: Why Every requirement that derives an allocated requirement constrains the allocated entity, see :ref:`reference-requirement-allocation-label`. .. _E04220: Unrelated derivation ~~~~~~~~~~~~~~~~~~~~~~ :Code: E04220 :Severity: moderate :Kind: connection A requirement derives a requirement, and does not use the entity this one constrains. A requirement uses an entity when its text has a reference ``[[...]]`` to it, or when its expression has an identifier that points to it. The issue is reported on the ``derives`` link. Nothing is reported when the derived requirement has no constraint, see :ref:`E04010 `. .. rubric:: Example ``Brake_stops_wheel`` derives ``Wheel_stop``, which constrains ``Wheel``, and its text does not mention ``Wheel``. .. literalinclude:: diagnostics/E04220-unrelated-derivation.req :language: req .. literalinclude:: diagnostics/E04220-unrelated-derivation.out :language: none :caption: reqtool check .. rubric:: Fix Use the entity of the derived requirement in the text or in the expression. .. _E04230: Constrained entity not used ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04230 :Severity: moderate :Kind: connection A requirement is ``on`` an entity that its text or its expression does not use. A requirement uses an entity when its text has a reference ``[[...]]`` to it, or when its expression has an identifier that points to it. .. rubric:: Example ``Wheel_round`` is ``on`` ``Wheel``, and its text says "the wheel" without a reference. As a consequence nothing uses ``Wheel``, which is reported as well, see :ref:`E04080 `. .. literalinclude:: diagnostics/E04230-unrelated-restriction.req :language: req .. literalinclude:: diagnostics/E04230-unrelated-restriction.out :language: none :caption: reqtool check .. rubric:: Fix Reference the entity in the text, or use it in the expression. .. _E04240: Allocation and constraint on the same entity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Code: E04240 :Severity: moderate :Kind: connection A requirement is ``on`` and ``via`` the same entity. Both references are reported. .. rubric:: Example ``Wheel_round`` is ``on Wheel`` and ``via Wheel``. It has no derivation and no children either, which is reported as well, see :ref:`E04120 ` and :ref:`E04030 `. .. literalinclude:: diagnostics/E04240-same-allocation-and-restriction.req :language: req .. literalinclude:: diagnostics/E04240-same-allocation-and-restriction.out :language: none :caption: reqtool check .. rubric:: Fix Allocate the requirement to another entity, or remove the ``via``. .. rubric:: Why The allocated entity differs from the entity the requirement constrains, see :ref:`reference-requirement-allocation-label`.