Published online by Cambridge University Press: 03 February 2010
A model written in VDM-SL is a collection of the following:
modular structuring mechanisms;
data type definitions;
function definitions;
operation definitions;
value (constant) definitions; and
a state definition.
Each collection of definitions is prefixed by a keyword (e.g. types). Individual definitions are separated by semicolons. Such definitions may be structured inside modules.
This appendix provides an overview of the constructs in the subset of VDM-SL treated in this book. Finally there is a BNF grammar for the subset of VDM-SL covered in this book.
Identifiers
The different kinds of definitions which can be made in VDM-SL are named using identifiers. The naming conventions used in this book are as follows:
Functions, operations and types begin with an upper-case letter for each word or abbreviation of which the name is composed.
Constant values begin with lower-case characters and use underscores between words or abbreviations of which these are composed.
Local identifiers are always sequences of lower-case characters and usually rather short names are used.
However, this is only a convention and is not mandatory.
Type definitions
As in traditional programming languages it is possible to define data types in VDM-SL and give them appropriate names. For example,
Amount = nat
Hereby we have defined a data type with the name “Amount” and stated that the values which belong to this type are natural numbers (nat is one of the basic types described below). One general point about the type system of VDM-SL which is worth mentioning at this point is that equality and inequality can be used between any values.
To save this book to your Kindle, first ensure [email protected] is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
Find out more about the Kindle Personal Document Service.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.
To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.