The VDM-SL Language Manual

The VDM-SL Language Manual - VDMTools The VDM-SL Language...

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

View Full Document Right Arrow Icon
CSK SYSTEMS CORPORATION VDMTools The VDM-SL Language Manual ver.1.0
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-SL 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
Image of page 2
The VDM-SL Language Manual Contents 1 Introduction 1 2 Conformance Issues 2 3 Concrete Syntax Notation 3 4 Data Type Definitions 3 4.1 Basic Data Types . . . . . . . . . . . . . . . . . . . . . . . . 4 4.1.1 The Boolean Type . . . . . . . . . . . . . . . . . . . . 5 4.1.2 The Numeric Types . . . . . . . . . . . . . . . . . . . . 7 4.1.3 The Character Type . . . . . . . . . . . . . . . . . . . 10 4.1.4 The Quote Type . . . . . . . . . . . . . . . . . . . . . 10 4.1.5 The Token Type . . . . . . . . . . . . . . . . . . . . . 11 4.2 Compound Types . . . . . . . . . . . . . . . . . . . . . . . . 12 4.2.1 Set Types . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.2.2 Sequence Types . . . . . . . . . . . . . . . . . . . . . . 15 4.2.3 Map Types . . . . . . . . . . . . . . . . . . . . . . . . 18 4.2.4 Product Types . . . . . . . . . . . . . . . . . . . . . . 22 4.2.5 Composite Types . . . . . . . . . . . . . . . . . . . . . 22 4.2.6 Union and Optional Types . . . . . . . . . . . . . . . . 26 4.2.7 Function Types . . . . . . . . . . . . . . . . . . . . . . 28 4.3 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5 Algorithm Definitions 31 6 Function Definitions 32 6.1 Polymorphic Functions . . . . . . . . . . . . . . . . . . . . . 36 6.2 Higher Order Functions . . . . . . . . . . . . . . . . . . . . . 37 7 Expressions 38 7.1 Let Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 38 7.2 The Define Expression . . . . . . . . . . . . . . . . . . . . . . 41 7.3 Unary and Binary Expressions . . . . . . . . . . . . . . . . . 42 7.4 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . 43 7.5 Quantified Expressions . . . . . . . . . . . . . . . . . . . . . 46 7.6 The Iota Expression . . . . . . . . . . . . . . . . . . . . . . . 48 7.7 Set Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 49 7.8 Sequence Expressions . . . . . . . . . . . . . . . . . . . . . . 50 7.9 Map Expressions . . . . . . . . . . . . . . . . . . . . . . . . . 52 7.10 Tuple Constructor Expressions . . . . . . . . . . . . . . . . . 53 i
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-SL Language Manual 7.11 Record Expressions . . . . . . . . . . . . . . . . . . . . . . . 54 7.12 Apply Expressions . . . . . . . . . . . . . . . . . . . . . . . . 55 7.13 The Lambda Expression . . . . . . . . . . . . . . . . . . . . . 57 7.14 Is Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 58 7.15 Literals and Names . . . . . . . . . . . . . . . . . . . . . . . 59 7.16 The Undefined Expression . . . . . . . . . . . . . . . . . . . 61 7.17 The Precondition Expression . . . . . . . . . . . . . . . . . . 62 8 Patterns 63 9 Bindings 67 10 Value (Constant) Definitions 68 11 The State Definition 69 12 Operation Definitions 71 13 Statements 77 13.1 Let Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 77 13.2 The Define Statement . . . . . . . . . . . . . . . . . . . . . . 79 13.3 The Block Statement . . . . . . . . . . . . . . . . . . . . . . 81 13.4 The Assignment Statement . . . . . . . . . . . . . . . . . . . 82 13.5 Conditional Statements . . . . . . . . . . . . . . . . . . . . . 84 13.6 For-Loop Statements . . . . . . . . . . . . . . . . . . . . . . 86 13.7 The While-Loop Statement . . . . . . . . . . . . . . . . . . . 89 13.8 The Nondeterministic Statement . . . . . . . . . . . . . . . . 90 13.9 The Call Statement . . . . . . . . . . . . . . . . . . . . . . . 92 13.10 The Return Statement . . . . . . . . . . . . . . . . . . . . . 93 13.11 Exception Handling Statements . . . . . . . . . . . . . . . . 93 13.12 The Error Statement . . . . . . . . . . . . . . . . . . . . . . 97 13.13 The Identity Statement . . . . . . . . . . . . . . . . . . . . . 97 13.14 The Specification Statement . . . . . . . . . . . . . . . . . . 98 14 Top-level Specification 100 14.1 A Flat Specification . . . . . . . . . . . . . . . . . . . . . . . 100 14.2 A Structured Specification . . . . . . . . . . . . . . . . . . . 101 14.2.1 The Layout of a Module . . . . . . . . . . . . . . . . . 102 14.2.2 The Exports Section . . . . . . . . . . . . . . . . . . . 103 14.2.3 The Imports Section . . . . . . . . . . . . . . . . . . . 107 15 Dynamic Link Modules 109 ii
Image of page 4
The VDM-SL Language Manual 16 Differences between VDM-SL and ISO/VDM-SL 113 17 Static Semantics 115 A The VDM-SL Syntax 117 A.1 Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 A.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 A.3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 A.3.1 Type Definitions . . . . . . . . . . . . . . . . . . . . . 120 A.3.2 The State Definition . . . . . . . . . . . . . . . . . . . 122 A.3.3 Value Definitions . . . . . . . . . . . . . . . . . . . . . 123 A.3.4 Function Definitions . . . . . . . . . . . . . . . . . . . 123 A.3.5 Operation Definitions . . . . . . . . . . . . . . . . . . . 124 A.4 Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 A.4.1 Bracketed Expressions . . . . . . . . . . . . . . . . . . 126 A.4.2 Local Binding Expressions . . . . . . . . . . . . . . . . 127 A.4.3 Conditional Expressions . . . . . . . . . . . . . . . . . 127 A.4.4 Unary Expressions . . . . . . . . . . . . . . . . . . . . 128 A.4.5 Binary Expressions . . . . . . . . . . . . . . . . . . . . 129 A.4.6 Quantified Expressions . . . . . . . . . . . . . . . . . . 132 A.4.7 The Iota Expression . . . . . . . . . . . . . . . . . . . 133 A.4.8 Set Expressions . . . . . . . . . . . . . . . . . . . . . . 133 A.4.9 Sequence Expressions . . . . . . . . . . . . . . . . . . . 133 A.4.10 Map Expressions . . . . . . . . . . . . . . . . . . . . . 133 A.4.11 The Tuple Constructor Expression . . . . . . . . . . . 134 A.4.12 Record Expressions . . . . . . . . . . . . . . . . . . . . 134 A.4.13 Apply Expressions . . . . . . . . . . . . . . . . . . . . 134 A.4.14 The Lambda Expression . . . . . . . . . . . . . . . . . 134 A.4.15 The Is Expression . . . . . . . . . . . . . . . . . . . . . 134 A.4.16 The Undefined Expression . . . . . . . . . . . . . . . . 135 A.4.17 The Precondition Expression . . . . . . . . . . . . . . . 135 A.4.18 Names . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 A.5
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern