Book contents
- Frontmatter
- Contents
- Foreword
- Preface
- 1 Introduction
- 2 Constructing a Model
- 3 VDMTools Lite
- 4 Describing System Properties Using Logical Expressions
- 5 The Elements of a Formal Model
- 6 Sets
- 7 Sequences
- 8 Mappings
- 9 Recursive Structures
- 10 Validating Models
- 11 State-Based Modelling
- 12 Large-Scale Modelling
- 13 Using VDM in Practice
- Appendix A Language Guide
- Appendix B Solutions to Exercises
- Bibliography
- Subject Index
- Definitions Index
Appendix A - Language Guide
Published online by Cambridge University Press: 03 February 2010
- Frontmatter
- Contents
- Foreword
- Preface
- 1 Introduction
- 2 Constructing a Model
- 3 VDMTools Lite
- 4 Describing System Properties Using Logical Expressions
- 5 The Elements of a Formal Model
- 6 Sets
- 7 Sequences
- 8 Mappings
- 9 Recursive Structures
- 10 Validating Models
- 11 State-Based Modelling
- 12 Large-Scale Modelling
- 13 Using VDM in Practice
- Appendix A Language Guide
- Appendix B Solutions to Exercises
- Bibliography
- Subject Index
- Definitions Index
Summary
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.
- Type
- Chapter
- Information
- Modelling SystemsPractical Tools and Techniques in Software Development, pp. 235 - 262Publisher: Cambridge University PressPrint publication year: 2009