Entity#
An entity is a specification object that structures the specification. In a document interpretation, entities are analogous to sections and subsections. In a model interpretation, entities are model elements that either constrain or define the SOI or its environment.
Structure#
A .req specification starts with a Package, which is called the root and is the parent of all other entities in the specification. The specification forms a tree from the root down to leaf entities.
Note
It is common to place the constraint section — Package and Requirement — and the definition section — Part, Attribute and Type — as direct children of the root.
Attention
Multi-file specifications are not yet supported. All entities referenced in a specification must be defined in the same source file.
Identification#
Identifier#
Each entity has an identifier that can only be composed of:
letters
digits
the underscore symbol
_
An identifier cannot start with a digit.
Note
Naming conventions are introduced for each entity type in the sections below.
Path#
A path is the concatenation of identifiers separated by ::, e.g. Specification::System::Wheel.
Each entity has an absolute path that lists each identifier from the root to the entity itself.
Note
Each entity is uniquely identified by its path. Two entities cannot share the same path.
Reference#
A reference is a mention of a path present in the specification.
Note
References are commonly used in Markup and Expression.
The scope is the set of all entities that can be referenced. Each entity in scope is identified by a unique path — no duplication is allowed.
When resolving a reference, the following rules are evaluated in order:
The reference matches an identifier of a direct child of the parent entity
The reference is a full path from root to entity
The reference is the suffix of an imported path
Imports#
A Package or Part may have imports that allow references to be shortened. Adding an import brings a prefix into scope that is merged with references at resolution time — see Reference.
import PATH
Imports are written right after the identifier of the package or part.
Meta-information#
Each entity is provided with meta-information that is meant to provide additional context on the entity.
Comment#
A comment is additional information about a given entity. Any entity can be provided with a comment; the comment may be interpreted differently depending on the kind of entity.
package Display
part Screen
part
@@
# Rationale
After the client meeting, this format fits the desired application best.
@@
requirement Significant_digits top bottom
on Screen
is
@@
The [[Screen]] shall use decimal format with 2 significant digits.
@@
requirement
package
The comment is written using the Markup syntax.
Note
A common practice is to always provide Part and Attribute with a comment that acts as a definition. Requirement comments can be used as rationale.
Requirement#
A requirement is an expectation or an assumption about the SOI or its environment. An implementation satisfies a specification if and only if all requirements are met in the assumed environment.
requirement IDENTIFIER
<top | bottom | on PATH | via PATH | refines PATH | derives PATH | specializes PATH>*
is
<MARKUP|EXPRESSION>
requirement
The clauses between the identifier and is can be written in any order.
Requirements can either be formal by using a Boolean Expression,
or informal by using the Markup syntax. In the example below, Comfort is informal and
Maximum_temperature is formal:
package Building
part Room
let temperature in real \ C \
part
requirement Comfort top
on Room
is
@@
The [[Room]] shall stay comfortable for its occupants.
@@
requirement
requirement Maximum_temperature bottom
on Room::temperature
refines Comfort
is
Room::temperature < 30
requirement
package
Constraint#
Each requirement constrains either a Part or an Attribute, named after on,
and uses it: with a [[...]] reference in its text, or an identifier in its expression.
Traceability#
Traceability is a directed link between requirements. Unlike free-form trace links, each traceability keyword in req carries a defined semantic that constrains how requirements may be related:
Refinement (
refines) — the child requirement adds detail or stronger conditions to what the parent requires. The parent’s intent still holds; the child narrows it. The child constrains the entity of the parent, or an entity nested inside it.Specialization (
specializes) — the child requirement applies to a specific subset of situations covered by the parent. The situations are meant to be selected via configuration management. Both requirements constrain the same entity.Derivation (
derives) — the child requirement was produced from the parent through a design or allocation decision. No constraint compatibility is implied; the constrained entities may differ. A derived requirement expects its parent to be allocated, see Allocation.
Inhibitors#
A requirement is expected to take part in the hierarchy of requirements: to have a parent, a requirement above it, and children, requirements below it.
The hierarchy is made of refines and derives links, specializes links are not part of it, see Traceability.
The inhibitors top and bottom state that one of these expectations does not apply:
top— the requirement has no parent. It does not refine nor derive another requirement.bottom— the requirement has no children. No requirement refines or derives it, and it is not allocated, since an allocation is meant to be derived, see Allocation.
A requirement that is both top and bottom stands alone.
package Vehicle
part Wheel
let speed in real \ m/s \
part
requirement Wheel_size top bottom
on Wheel
is
@@
The [[Wheel]] shall be below 30 cm.
@@
requirement
requirement Wheel_stop top
on Wheel
is
@@
The [[Wheel]] shall stop.
@@
requirement
requirement Speed_bound bottom
on Wheel::speed
refines Wheel_stop
is
Wheel::speed < 3
requirement
package
Allocation#
An allocation (via) names the part or attribute that is intended to derive a requirement, typically the sub-system to which a system delegates a function, as a client would to a contractor.
It is declared on the delegated requirement, not on the requirements that answer it.
An allocated requirement is expected to be answered by requirements that derive it and constrain the allocated entity:
at least one requirement derives it, and every requirement deriving it constrains the allocated entity;
it is not
bottom, since it is meant to be derived;the allocated entity differs from the entity it constrains.
package Kitchen
part Kettle
part
part Mains
let max_power in real \ W \
part
requirement Boil_fast top
on Kettle
via Mains
is
@@
The [[Kettle]] shall boil one liter of water in less than 3 minutes.
@@
requirement
requirement Power_supply
on Mains
derives Boil_fast
is
@@
The [[Mains]] shall supply the power the [[Kettle]] needs to boil one liter of water.
@@
requirement
requirement Supply_limit bottom
on Mains::max_power
refines Power_supply
is
Mains::max_power >= 2000
requirement
package
Package#
A package is a container element that provides a namespace for requirements. Packages can be nested to provide a hierarchy between concern areas.
package IDENTIFIER
IMPORT*
<PACKAGE|PART|TYPE|REQUIREMENT>*
package
Packages are used to provide a thematic breakdown of requirements.
package Room_Control
part Room
let temperature in real \ C \
let humidity in real \ % \
part
requirement Comfort top
on Room
is
@@
The [[Room]] shall stay comfortable for its occupants.
@@
requirement
package Temperature_Control
import Room_Control
requirement Maximum_temperature bottom
on Room::temperature
refines Comfort
is
Room::temperature < 26
requirement
package
package Humidity_Control
import Room_Control
requirement Maximum_humidity bottom
on Room::humidity
refines Comfort
is
Room::humidity < 60
requirement
package
package
The import lets the nested packages write Room::temperature instead of Room_Control::Room::temperature.
A Requirement belongs to one and only one package. Packages form a requirements partitioning of the system:
Function, activity or operational breakdown of requirements
Non-functional requirements, included either as function sub-packages or a separate package
Level of detail: business, system, equipment, …
Note
A package can contain Part, common use case is the root package that contain a root part.
Attribute#
An attribute is a named quantity of the specification that can be assigned a value.
let IDENTIFIER in DOMAIN (\ UNIT \)?
Every attribute has a domain.
An attribute can represent several aspects of a system:
A state variable of the specification that can evolve over time
A constant parameter or external input
An event relevant to the specification
part Airplane
let current_speed in real \ m/s \
let wingspan in real \ m \
let has_landed in boolean
part
An attribute has semantic type, inferred by the compiler from its domain and the expressions in which it appears. The type determines which operations are applicable to the attribute.
Domain#
A domain, is the mathematical set of the allowed values of an attribute. It is defined first via an expression having the type Set in the attribute definition,
such as real, [0, 1] or an enumeration type.
Formal requirements (see Requirement) constrain attributes. All constraints on an attribute must be satisfiable for the specification to be consistent. More precisely, each constraint narrows the domain of the attribute; if the domain becomes empty the specification is unsatisfiable.
Note
As the number of constraints on an attribute grows, their intersection narrows. An empty intersection means the constraints are contradictory and the specification is unsatisfiable.
Unit#
A physical unit can be provided to numerical attributes
Attention
For now, units are freeform labels and are not validated by the compiler.
Part#
A part is a container element that provides a namespace for attributes and nested parts. Parts can be nested to represent a physical or conceptual decomposition of the SOI and its environment. This hierarchical structure is called an ontology.
part IDENTIFIER
IMPORT*
<ATTRIBUTE|PART|TYPE>*
part
Parts are typically used to partition a system in the following ways:
Physical decomposition — the system is broken down into sub-systems or sub-equipment.
Conceptual decomposition — B is a functional or logical aspect of A, without implying physical separation.
part Airplane
let current_speed in real \ m/s \
let has_overspeed in boolean
part Wings
let wingspan in real \ m \
part
part
Unlike Package, it is common to use a part with no children to introduce a concept relevant to the specification. A part, even with no children, allows for a concept to be named and referenced in requirements before its attributes are defined.
Informal requirements (see Requirement) on parts serve as high-level constraints that can be progressively formalized as the specification matures.
Note
In a more general sense, a part represents an aspect of the system under consideration — either a grouping of physical characteristics (geometry, mass, speed) or functional characteristics (behavior, capability, mode).
Type#
A type defines an enumeration: a finite set of named values, its members.
type IDENTIFIER has MEMBER (| MEMBER)* type
A type is used as the domain of an attribute. In an expression, a member is
written with the path of its type, Door_state::closed. A reference to a member, [[Door_state::closed]],
points to its type.
package Doors
type Door_state has closed | opening | open | closing type
part Door
let state in Doors::Door_state
part
requirement Door_cycle top
on Door
is
@@
The [[Door]] shall be closed when the train departs.
@@
requirement
requirement Initially_closed bottom
on Door::state
refines Door_cycle
is
Door::state °= Door_state::closed
requirement
package