Skip to content
Stable.reqif@modelscript/reqif 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena AST Only
Simulation Co-sim / Export
Projections SysML v2, Modelica
Live ExampleBrakeByWireSafety.reqif

ISO 26262 ASIL-D Brake-by-Wire Requirements Specification

OMG ReqIF specification objects and traceability links connecting vehicle deceleration hazards to actuator response latency budgets.

Playground
Source (39 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd">
3  <THE-HEADER>
4    <REQ-IF-HEADER IDENTIFIER="HDR-BBW-2026">
5      <TITLE>ISO 26262 Brake-by-Wire Safety Specification</TITLE>
6    </REQ-IF-HEADER>
7  </THE-HEADER>
8  <CORE-CONTENT>
9    <REQ-IF-CONTENT>
10      <SPEC-OBJECTS>
11        <SPEC-OBJECT IDENTIFIER="REQ-SYS-001" LONG-NAME="Stopping Distance Limit">
12          <VALUES>
13            <ATTRIBUTE-VALUE-STRING THE-VALUE="Vehicle shall decelerate at >= 9.5 m/s2 from 100 km/h on dry asphalt." />
14          </VALUES>
15        </SPEC-OBJECT>
16        <SPEC-OBJECT IDENTIFIER="REQ-SW-002" LONG-NAME="Brake Command Latency">
17          <VALUES>
18            <ATTRIBUTE-VALUE-STRING THE-VALUE="End-to-end pedal sensor to caliper force loop shall execute within 5.0 ms." />
19          </VALUES>
20        </SPEC-OBJECT>
21        <SPEC-OBJECT IDENTIFIER="REQ-HW-003" LONG-NAME="Dual-Channel Power Redundancy">
22          <VALUES>
23            <ATTRIBUTE-VALUE-STRING THE-VALUE="Independent 48V buses shall supply front and rear electro-mechanical calipers." />
24          </VALUES>
25        </SPEC-OBJECT>
26      </SPEC-OBJECTS>
27      <SPEC-RELATIONS>
28        <SPEC-RELATION IDENTIFIER="REL-01">
29          <SOURCE><SPEC-OBJECT-REF>REQ-SW-002</SPEC-OBJECT-REF></SOURCE>
30          <TARGET><SPEC-OBJECT-REF>REQ-SYS-001</SPEC-OBJECT-REF></TARGET>
31        </SPEC-RELATION>
32        <SPEC-RELATION IDENTIFIER="REL-02">
33          <SOURCE><SPEC-OBJECT-REF>REQ-HW-003</SPEC-OBJECT-REF></SOURCE>
34          <TARGET><SPEC-OBJECT-REF>REQ-SYS-001</SPEC-OBJECT-REF></TARGET>
35        </SPEC-RELATION>
36      </SPEC-RELATIONS>
37    </REQ-IF-CONTENT>
38  </CORE-CONTENT>
39</REQ-IF>
Requirement Traceability & Entailment Graph
«deriveReqt» «deriveReqt» «requirement» Stopping Distance Limit «req-sys-001» Vehicle shall decelerate at >= 9.5 m/s… «requirement» Brake Command Latency «req-sw-002» End-to-end pedal sensor to caliper for… «requirement» Dual-Channel Power Redundancy «req-hw-003» Independent 48V buses shall supply fro…
Drag to pan · Click % to reset

ReqIF Requirements Engineering & Formal Verification ​

ModelScript delivers first-class support for ReqIF (Requirements Interchange Format, OMG ReqIF 1.0/1.2), the global standard for exchanging structured requirements across aerospace, automotive (ISO 26262), and medical device systems. ModelScript elevates requirements from dead documentation into computable digital contracts verifiable against physics simulations and architectural constraints.


Capabilities & Supported Formats ​

FormatExtensionDescription
OMG ReqIF XML Document.reqif, .xmlXML document defining specification types, spec-objects, hierarchical spec-relations, data types, and attribute definitions.
ReqIF Compressed Archive.reqifz, .zipZip archive packaging .reqif manifests alongside embedded media, diagrams, and attachments.

Key Architectural Features ​

  • Full OMG ReqIF 1.2 Ingestion & Roundtrip:
    • Robust XML reader and serializer preserving internal identifiers (IDENTIFIER), specification hierarchies, multi-level parent-child relations, and custom attribute types (String, Integer, Real, Boolean, Date, Enumeration).
  • Formal Contract Extraction:
    • Automatically parses mathematical constraints from natural language requirement text (e.g. latency <= 50 ms, pressure >= 15 bar, temp in [20, 80] C).
  • Nelson-Oppen Mathematical Entailment Prover:
    • Uses the SMT/Nelson-Oppen theory coordinator in @modelscript/runtime to prove whether child sub-requirements strictly entail parent system-level requirements:⋀iSubReqi⊨ParentReq
    • Generates concrete numeric counterexamples when an entailment gap exists (e.g. child requirements permit a state that violates the parent requirement).
  • Bidirectional Tabular Editor & 2D Traceability Matrix (@modelscript/reqif/tabular):
    • Powered by @modelscript/dsl's declarative TabularConfig, ReqIF specifications project into 4 synchronized, bidirectional sheets:
      1. Requirements Catalog Tree-Table: Hierarchical WBS (SPEC-HIERARCHY) with collapsible sections, inline cell editing for titles, specification text, formal mathematical contracts (<= 2.5 %), ISO 26262 ASIL levels, lifecycle status, custom SPEC-OBJECT-TYPE attributes, and live Nelson-Oppen SMT entailment badges (Certified, Gap, Leaf).
      2. 2D Requirements Traceability Matrix (RTM): Interactive N×M cross-reference matrix where clicking any cell cycles <SPEC-RELATION> links (satisfies, verifies, refines, allocates, derives, conflicts) and writes back losslessly to the ReqIF XML.
      3. Spec Relations Table: Editable table of all <SPEC-RELATION> links with inline source, target, and relation stereotype selectors.
      4. Types & Schema Explorer: Inspects <DATATYPES>, enumeration values, and <SPEC-TYPES> attribute definitions.
  • 2D Requirement Architecture Diagram (@modelscript/reqif/diagram):
    • Renders hierarchical requirement cards color-coded by ISO 26262 ASIL level, formal contract compartments, SMT entailment badges, parent-child decomposition edges, and typed SPEC-RELATION dependency arrows.
  • Automated Verification Projections:
    • OMG SysML v2: Translates spec-objects into formal requirement def items with doc annotations, attribute definitions, and satisfy links.
    • Modelica Verification Blocks: Generates acausal Modelica monitor blocks with assertions that trigger simulation failure when requirement bounds are breached.
  • Requirements Linters (M7001–M7008):
    • Detects dangling requirement relations, circular requirement hierarchies, unbounded safety contracts on ASIL requirements, and missing mandatory attributes.

Command Line Interface (msx reqif) ​

bash
msx reqif <action> [files...] [options]
ActionDescriptionKey Options
importParses a ReqIF 1.2 document and prints requirements, hierarchy, and relations.--format table|json
exportExports SysML v2 requirements into ReqIF 1.2 XML.--output, --title
lintRuns structural consistency checks, link validation, and safety contract analysis.—
verifyRuns Nelson-Oppen formal entailment proofs across requirement hierarchies.—
to-sysmlProjects ReqIF specifications into OMG SysML v2 requirement definitions.--out=<file.sysml>
to-modelicaGenerates Modelica assertion blocks for in-simulation verification.--out=<file.mo>

Examples ​

bash
# Import requirement specifications and hierarchies
msx reqif import SystemRequirements.reqif

# Run pre-flight linting on ASIL safety requirements
msx reqif lint BrakeSafetyRequirements.reqif

# Formally prove requirement hierarchy entailment with SMT counterexample generation
msx reqif verify PowertrainContracts.reqif

# Project requirements to SysML v2 definitions
msx reqif to-sysml AvionicsRequirements.reqif --out=AvionicsRequirements.sysml

# Synthesize executable Modelica verification blocks
msx reqif to-modelica ThermalLimits.reqif --out=ThermalMonitors.mo

Requirements Linters & Diagnostic Rules ​

10 rules7 error3 warning Run with msx reqif lint

CodeRuleSeverityMessage
M7001dangling-requirement-relationerrorRequirement relation '<relId>' references missing <role> requirement '<missingId>'.
M7002type-attribute-mismatcherrorAttribute '<attrName>' expected type '<expectedType>', but got value '<actualValue>'.
M7003circular-requirement-hierarchyerrorCircular requirement hierarchy detected at '<reqId>' along cycle path [<cyclePath>].
M7004unverified-leaf-requirementwarningLeaf requirement '<reqId>' has no outgoing 'verifies' or 'satisfies' relation.
M7005unbounded-formal-contractwarningRequirement '<reqId>' is marked safety/functional but lacks a bounded mathematical contract.
M7006duplicate-spec-object-iderrorDuplicate requirement identifier '<reqId>' declared in specification.
M7007missing-mandatory-attributeerrorRequirement '<reqId>' is missing mandatory attribute '<attrName>'.
M7008empty-specificationwarningSpecification '<specId>' contains no requirement hierarchies.
M7009unresolved-type-referenceerrorElement '<elementId>' references undefined type '<typeRef>'.
M7010invalid-contract-comparatorerrorRequirement '<reqId>' specifies invalid contract comparator '<comp>'.

Generated from languages/reqif/src/lints/rules.ts. All languages →

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Trademark Policy