{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

The VDM++ Language Manual

The VDM++ Language Manual - VDMTools The VDM Language...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
CSK SYSTEMS CORPORATION VDMTools The VDM++ Language Manual ver.1.0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
How to contact CSK SYSTEMS CORPORATION: http://www.csk.com/systems Web @ [email protected] General information The VDM++ Language Manual 1.0 — Revised for VDMTools v8.2 c COPYRIGHT 2009 by CSK SYSTEMS CORPORATION The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. This document is subject to change without notice
Background image of page 2
The VDM++ Language Manual Contents 1 Introduction 1 1.1 Purpose of The Document . . . . . . . . . . . . . . . . . . . 1 1.2 History of The Language . . . . . . . . . . . . . . . . . . . . 1 1.3 Structure of the Document . . . . . . . . . . . . . . . . . . . 2 2 Conformance Issues 2 3 Concrete Syntax Notation 3 4 Data Type Definitions 4 4.1 Basic Data Types . . . . . . . . . . . . . . . . . . . . . . . . 5 4.1.1 The Boolean Type . . . . . . . . . . . . . . . . . . . . 5 4.1.2 The Numeric Types . . . . . . . . . . . . . . . . . . . . 8 4.1.3 The Character Type . . . . . . . . . . . . . . . . . . . 11 4.1.4 The Quote Type . . . . . . . . . . . . . . . . . . . . . 11 4.1.5 The Token Type . . . . . . . . . . . . . . . . . . . . . 12 4.2 Compound Types . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2.1 Set Types . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.2.2 Sequence Types . . . . . . . . . . . . . . . . . . . . . . 16 4.2.3 Map Types . . . . . . . . . . . . . . . . . . . . . . . . 19 4.2.4 Product Types . . . . . . . . . . . . . . . . . . . . . . 23 4.2.5 Composite Types . . . . . . . . . . . . . . . . . . . . . 23 4.2.6 Union and Optional Types . . . . . . . . . . . . . . . . 27 4.2.7 The Object Reference Type . . . . . . . . . . . . . . . 29 4.2.8 Function Types . . . . . . . . . . . . . . . . . . . . . . 30 4.3 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 5 Algorithm Definitions 33 6 Function Definitions 34 6.1 Polymorphic Functions . . . . . . . . . . . . . . . . . . . . . 38 6.2 Higher Order Functions . . . . . . . . . . . . . . . . . . . . . 39 7 Expressions 40 7.1 Let Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 40 7.2 The Define Expression . . . . . . . . . . . . . . . . . . . . . . 43 7.3 Unary and Binary Expressions . . . . . . . . . . . . . . . . . 45 7.4 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . 46 7.5 Quantified Expressions . . . . . . . . . . . . . . . . . . . . . 48 7.6 The Iota Expression . . . . . . . . . . . . . . . . . . . . . . . 50 i
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
The VDM++ Language Manual 7.7 Set Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.8 Sequence Expressions . . . . . . . . . . . . . . . . . . . . . . 53 7.9 Map Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 55 7.10 Tuple Constructor Expressions . . . . . . . . . . . . . . . . . 56 7.11 Record Expressions . . . . . . . . . . . . . . . . . . . . . . . 56 7.12 Apply Expressions . . . . . . . . . . . . . . . . . . . . . . . . 58 7.13 The New Expression . . . . . . . . . . . . . . . . . . . . . . . 59 7.14 The Self Expression . . . . . . . . . . . . . . . . . . . . . . . 60 7.15 The Threadid Expression . . . . . . . . . . . . . . . . . . . . 61 7.16 The Lambda Expression . . . . . . . . . . . . . . . . . . . . . 63 7.17 Is Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7.18 Base Class Membership . . . . . . . . . . . . . . . . . . . . . 65 7.19 Class Membership . . . . . . . . . . . . . . . . . . . . . . . . 65 7.20 Same Base Class Membership . . . . . . . . . . . . . . . . . . 66 7.21 Same Class Membership . . . . . . . . . . . . . . . . . . . . . 67 7.22 History Expressions . . . . . . . . . . . . . . . . . . . . . . . 67 7.23 Literals and Names . . . . . . . . . . . . . . . . . . . . . . . 69 7.24 The Undefined Expression . . . . . . . . . . . . . . . . . . . 71 7.25 The Precondition Expression . . . . . . . . . . . . . . . . . . 71 8 Patterns 72 9 Bindings 77 10 Value (Constant) Definitions 78 11 Instance Variables 79 12 Operation Definitions 81 12.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 13 Statements 85 13.1 Let Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 85 13.2 The Define Statement . . . . . . . . . . . . . . . . . . . . . . 87 13.3 The Block Statement . . . . . . . . . . . . . . . . . . . . . . 88 13.4 The Assignment Statement . . . . . . . . . . . . . . . . . . . 90 13.5 Conditional Statements . . . . . . . . . . . . . . . . . . . . . 93 13.6 For-Loop Statements . . . . . . . . . . . . . . . . . . . . . . 95 13.7 The While-Loop Statement . . . . . . . . . . . . . . . . . . . 97 13.8 The Nondeterministic Statement . . . . . . . . . . . . . . . . 98 13.9 The Call Statement . . . . . . . . . . . . . . . . . . . . . . . 100 13.10 The Return Statement . . . . . . . . . . . . . . . . . . . . . 102 ii
Background image of page 4
The VDM++ Language Manual 13.11 Exception Handling Statements . . . . . . . . . . . . . . . . 103 13.12 The Error Statement . . . . . . . . . . . . . . . . . . . . . . 106 13.13 The Identity Statement . . . . . . . . . . . . . . . . . . . . . 107 13.14 Start and Start List Statements . . . . . . . . . . . . . . . . 108 13.15 The Specification Statement . . . . . . . . . . . . . . . . . . 109 14 Top-level Specification 111 14.1 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 14.2 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 14.3 Interface and Availability of Class Members . . . . . . . . . . 116 15 Synchronization Constraints 120 15.1 Permission Predicates . . . . . . . . . . . . . . . . . . . . . . 121 15.1.1 History guards . . . . . . . . . . . . . . . . . . . . . . 123 15.1.2 The object state guard . . . . . . . . . . . . . . . . . . 124 15.1.3 Queue condition guards . . . . . . . . . . . . . . . . . 124 15.1.4 Evaluation of Guards . . . . . . . . . . . . . . . . . . . 125 15.2 Inheritance of Synchronization Constraints . . . . . . . . . . 126 15.2.1 Mutex constraints . . . . . . . . . . . . . . . . . . . . . 126 16 Threads 128 16.1 Periodic Thread Definitions . . . . . . . . . . . . . . . . . . . 128 16.2 Procedural Thread Definitions . . . . . . . . . . . . . . . . . 130 17 Trace Definitions 133 18 Differences between VDM++ and ISO /VDM-SL 135 19 Static Semantics 137 20 Scope Conflicts 138 A The VDM++ Syntax 141 A.1 Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 A.2 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 A.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141 A.3.1
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}