Skip to content

Requirements

DEAL requirements are first-class definitions. A requirement def declares a verifiable system requirement, including its threshold attributes and accepted verification methods. A need def captures stakeholder needs that requirements are derived from.

package requirements.system;
import deal.std.units.{km};
requirement def REQ_SYS_001 {
public (
attribute text : String [1] = "The vehicle shall achieve a minimum range of 300 miles on a single full charge under EPA combined cycle conditions.";
attribute minRange : Length [1] = km(483);
attribute testCondition : String [1] = "EPA combined cycle";
)
verification {
accepts: [simulation, test];
rejects: [analysis, inspection];
threshold: minRange;
operator: ">=";
}
}

The verification {} block is the machine-readable verification contract:

FieldMeaning
acceptsMethods deal check --verify accepts for satisfaction
rejectsMethods explicitly disallowed
thresholdThe attribute that must pass the comparison
operatorComparison direction: ">=", "<=", or "=="
conditionsOptional structured preconditions (e.g., ambient temperature ranges)

deal check enforces that each [<satisfy>] block in a .dealx file uses a method listed in accepts. Using a method in rejects is a compile error.

A need def captures a stakeholder need before it is decomposed into requirements.

need def NEED_RANGE {
public (
attribute text : String [1] = "The vehicle shall travel at least 300 miles on a single charge.";
attribute source : String [1] = "CN-2026-001 Section 3.1";
)
}

Needs are traced to requirements via [<allocate>] blocks in a .dealx traceability composition — see Traceability.

A requirement may declare a range threshold using array literals:

package requirements.system;
import deal.std.units.{degC};
requirement def REQ_BAT_003 {
public (
attribute text : String [1] = "The battery shall operate within the temperature range of -30C to +55C.";
attribute minTemp : Temperature [1] = degC(-30);
attribute maxTemp : Temperature [1] = degC(55);
)
verification {
accepts: [test];
rejects: [analysis, simulation];
threshold: [minTemp, maxTemp];
operator: [">=", "<="];
}
}

When threshold and operator are arrays, they correspond by index: minTemp >= -30C and maxTemp <= 55C.

The conditions field adds structured preconditions to the verification contract:

package requirements.system;
import deal.std.units.{min, degC};
requirement def REQ_BAT_002 {
@concerns: "Thermal stress during fast charge degrades cell life"
public (
attribute text : String [1] = "The battery shall charge from 10% to 80% SOC in 30 minutes or less using a DC fast charger.";
attribute chargeTime : Duration [1] = min(30);
)
verification {
accepts: [test];
rejects: [analysis, simulation];
threshold: chargeTime;
operator: "<=";
conditions: {
ambient: [degC(25), degC(-10), degC(-30)]
}
}
}

Every requirement should carry a JSDoc doc comment describing it in natural language:

package requirements.system;
/** The vehicle shall achieve a minimum range on a single charge. */
requirement def REQ_SYS_001 {
public (
attribute text : String [1] = "The vehicle shall achieve a minimum range on a single charge.";
)
}

Doc comments (/** ... */) appear before the declaration. They are exported as text in the ReqIF output and shown in the VS Code hover tooltip.

Requirements in the EV platform showcase follow the pattern REQ_<SUBSYSTEM>_<NNN> and needs follow NEED_<KEYWORD>. This is a project convention, not a language rule.