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
| Format | Extension | Description |
|---|---|---|
| OMG ReqIF XML Document | .reqif, .xml | XML document defining specification types, spec-objects, hierarchical spec-relations, data types, and attribute definitions. |
| ReqIF Compressed Archive | .reqifz, .zip | Zip 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).
- Robust XML reader and serializer preserving internal identifiers (
- 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).
- Automatically parses mathematical constraints from natural language requirement text (e.g.
- Nelson-Oppen Mathematical Entailment Prover:
- Uses the SMT/Nelson-Oppen theory coordinator in
@modelscript/runtimeto prove whether child sub-requirements strictly entail parent system-level requirements: - Generates concrete numeric counterexamples when an entailment gap exists (e.g. child requirements permit a state that violates the parent requirement).
- Uses the SMT/Nelson-Oppen theory coordinator in
- Bidirectional Tabular Editor & 2D Traceability Matrix (
@modelscript/reqif/tabular):- Powered by
@modelscript/dsl's declarativeTabularConfig, ReqIF specifications project into 4 synchronized, bidirectional sheets:- 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, customSPEC-OBJECT-TYPEattributes, and live Nelson-Oppen SMT entailment badges (Certified,Gap,Leaf). - 2D Requirements Traceability Matrix (RTM): Interactive
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. - Spec Relations Table: Editable table of all
<SPEC-RELATION>links with inline source, target, and relation stereotype selectors. - Types & Schema Explorer: Inspects
<DATATYPES>, enumeration values, and<SPEC-TYPES>attribute definitions.
- Requirements Catalog Tree-Table: Hierarchical WBS (
- Powered by
- 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-RELATIONdependency arrows.
- Renders hierarchical requirement cards color-coded by ISO 26262 ASIL level, formal contract compartments, SMT entailment badges, parent-child decomposition edges, and typed
- Automated Verification Projections:
- OMG SysML v2: Translates spec-objects into formal
requirement defitems withdocannotations, attribute definitions, andsatisfylinks. - Modelica Verification Blocks: Generates acausal Modelica monitor blocks with assertions that trigger simulation failure when requirement bounds are breached.
- OMG SysML v2: Translates spec-objects into formal
- 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]| Action | Description | Key Options |
|---|---|---|
import | Parses a ReqIF 1.2 document and prints requirements, hierarchy, and relations. | --format table|json |
export | Exports SysML v2 requirements into ReqIF 1.2 XML. | --output, --title |
lint | Runs structural consistency checks, link validation, and safety contract analysis. | — |
verify | Runs Nelson-Oppen formal entailment proofs across requirement hierarchies. | — |
to-sysml | Projects ReqIF specifications into OMG SysML v2 requirement definitions. | --out=<file.sysml> |
to-modelica | Generates 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.moRequirements Linters & Diagnostic Rules
10 rules7 error3 warning Run with msx reqif lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M7001 | dangling-requirement-relation | error | Requirement relation '<relId>' references missing <role> requirement '<missingId>'. |
M7002 | type-attribute-mismatch | error | Attribute '<attrName>' expected type '<expectedType>', but got value '<actualValue>'. |
M7003 | circular-requirement-hierarchy | error | Circular requirement hierarchy detected at '<reqId>' along cycle path [<cyclePath>]. |
M7004 | unverified-leaf-requirement | warning | Leaf requirement '<reqId>' has no outgoing 'verifies' or 'satisfies' relation. |
M7005 | unbounded-formal-contract | warning | Requirement '<reqId>' is marked safety/functional but lacks a bounded mathematical contract. |
M7006 | duplicate-spec-object-id | error | Duplicate requirement identifier '<reqId>' declared in specification. |
M7007 | missing-mandatory-attribute | error | Requirement '<reqId>' is missing mandatory attribute '<attrName>'. |
M7008 | empty-specification | warning | Specification '<specId>' contains no requirement hierarchies. |
M7009 | unresolved-type-reference | error | Element '<elementId>' references undefined type '<typeRef>'. |
M7010 | invalid-contract-comparator | error | Requirement '<reqId>' specifies invalid contract comparator '<comp>'. |
Generated from languages/reqif/src/lints/rules.ts. All languages →

