Professional Documents
Culture Documents
VDM-SL
System Specification
The initial part in determining the behavior of the system
through “Requirements Analysis”
1. Types
2. Values
3. State:
A. Attributes
B. Invariant statement
C. Initialization statement
4. Functions
5. operations
Incubator Monitor System Specification
• The incubator’s temperature needs to be carefully controlled and monitored in order to provide the
correct conditions for a particular biological experiment to be undertaken.
•As mentioned in Lecture(1), there is “Incubator Monitor” that basically increases or decreases the
temperature by 1 as long as the temperature is between the range of the safety requirements ( -10<= temp
<=10) and retrieves the current temperature. Moreover, it assumes that the initial temperature is 5 degree
Celsius.
•The attributes and the operation for this example are:
• Temp: Is the attribute that holds the value for the Incubator’s temperature.
• Increment(): Is the operation that increases the temperature by one.
• Decrement(): Is the operation that decreases the temperature by one.
• getTemp(): Is the operation that returns the current temperature value.
Converting the UML to VDM-SL
Incubator Monitor Implicit VDM-SL
Specification
Types
•The first thing to be determined in the system are “types” which are user-defined data
similar to classes and enumerations.
•Types have various structures depending on the data type that should be created whether
it’s a simple “data type” or “enum” or a “composite object”.
•They have the following structure:
o For simple data types : VariableName= data type;
o Enum : EnumName=<choice.1>|<choice.2>|<choice.n>;It is named as quote in VDM
Values
•Values are considered constants in VDM-SL , they are used to further enhance the
readability of the system.
•They have the following structure :
values
ConstantName : DataType = Value;
State of the System
• Holds permeant data that needs to be
stored by the system. The data is
accessed by functions and operations.
•It holds both the system invariant and
initialization statements.
•The initial structure of the state is in the
form is as follows :
state <Module Name> of
end;
State of the System (Attributes)
•All the variables to be used in the system should be present in the state .
•They have the structure of : Variable Name : Data type
State of the System (Invariant)
•The state invariant is a function that sets a global constraint to the whole system.