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
5 - The Elements of a Formal Model
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
Aims
This chapter aims to introduce the reader to the most basic kinds of data value available to the modeller and to show how values can be manipulated through operators and functions. These are introduced using a traffic light kernel control example. On completing this chapter the reader should be able to recognise and use all the basic data types of VDM-SL.
Introduction
A functional model of a system is composed of definitions of types which represent the kinds of data values under consideration and definitions of functions which describe the computations performed on the data. In order to develop a formal model, we therefore require a means of defining types and values, and ways to construct logical expressions which state the properties of values. This chapter illustrates these features in VDM-SL and introduces the basic types available in VDM-SL using an example based on traffic light control. A data type (or simply type) in VDM-SL is a collection of values called the elements or members of the type. For example, the type of natural numbers consists of infinitely many elements, from zero upwards. To make use of a type, we will need
a symbol to represent the type, e.g. nat;
a way of writing down the type's elements, e.g. 3, “John”;
value operators to permit the construction of more sophisticated expressions that represent elements of the type, e.g. + to represent addition; and
comparison operators, e.g. <, to allow expressions of elements of the type to be compared.
- Type
- Chapter
- Information
- Modelling SystemsPractical Tools and Techniques in Software Development, pp. 77 - 98Publisher: Cambridge University PressPrint publication year: 2009