Skip to main content Accessibility help
×
Hostname: page-component-76fb5796d-dfsvx Total loading time: 0 Render date: 2024-04-26T09:15:56.769Z Has data issue: false hasContentIssue false

Appendix A - Language Guide

Published online by Cambridge University Press:  03 February 2010

John Fitzgerald
Affiliation:
University of Newcastle upon Tyne
Peter Gorm Larsen
Affiliation:
Engineering College of Århus, Denmark
Get access

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 Systems
Practical Tools and Techniques in Software Development
, pp. 235 - 262
Publisher: Cambridge University Press
Print publication year: 2009

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org 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.

  • Language Guide
  • John Fitzgerald, University of Newcastle upon Tyne, Peter Gorm Larsen, Engineering College of Århus, Denmark
  • Book: Modelling Systems
  • Online publication: 03 February 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626975.016
Available formats
×

Save book 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 Dropbox.

  • Language Guide
  • John Fitzgerald, University of Newcastle upon Tyne, Peter Gorm Larsen, Engineering College of Århus, Denmark
  • Book: Modelling Systems
  • Online publication: 03 February 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626975.016
Available formats
×

Save book to Google Drive

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.

  • Language Guide
  • John Fitzgerald, University of Newcastle upon Tyne, Peter Gorm Larsen, Engineering College of Århus, Denmark
  • Book: Modelling Systems
  • Online publication: 03 February 2010
  • Chapter DOI: https://doi.org/10.1017/CBO9780511626975.016
Available formats
×