VDM10_lang_man - Overture Technical Report Series No TR-001...

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

Overture Technical Report Series No. TR-001 November 2014 VDM-10 Language Manual by Peter Gorm Larsen Kenneth Lausdahl Nick Battle John Fitzgerald Sune Wolff Shin Sahara Marcel Verhoef Peter Jørgensen Tomohiro Oda Overture – Open-source Tools for Formal Modelling
Image of page 1

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

VDM-10 Language Manual Document history Month Year Version Version of Overture.exe Comment April 2010 0.2 May 2010 1 0.2 February 2011 2 1.0.0 July 2012 3 1.2.2 April 2013 4 2.0.0 March 2014 5 2.0.4 Includes RMs #16, #17, #18, #20 November 2014 6 2.1.2 Includes RMs #25, #26, #29 ii
Image of page 2
Contents 1 Introduction 1 1.1 The VDM Specification Language (VDM-SL) . . . . . . . . . . . . . . . . . . . . 1 1.2 The VDM++ Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.3 The VDM Real Time Language (VDM-RT) . . . . . . . . . . . . . . . . . . . . . 2 1.4 Purpose of The Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.5 Structure of the Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 2 Concrete Syntax Notation 3 3 Data Type Definitions 5 3.1 Basic Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3.1.1 The Boolean Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 3.1.2 The Numeric Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.1.3 The Character Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.4 The Quote Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.5 The Token Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2 Compound Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2.1 Set Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.2 Sequence Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2.3 Map Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.2.4 Product Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.2.5 Composite Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.6 Union and Optional Types . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.2.7 The Object Reference Type (VDM++ and VDM-RT) . . . . . . . . . . . . 27 3.2.8 Function Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 3.3 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4 Algorithm Definitions 33 5 Function Definitions 35 5.1 Polymorphic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 5.2 Higher Order Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 iii
Image of page 3

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

VDM-10 Language Manual 6 Expressions 43 6.1 Let Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.2 The Define Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 6.3 Unary and Binary Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 6.4 Conditional Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 6.5 Quantified Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 6.6 The Iota Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 6.7 Set Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 6.8 Sequence Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 6.9 Map Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 6.10 Tuple Constructor Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.11 Record Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 6.12 Apply Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 6.13 The New Expression (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . 61 6.14 The Self Expression (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . 62 6.15 The Threadid Expression (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . 63 6.16 The Lambda Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 6.17 Narrow Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 6.18 Is Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 6.19 Base Class Membership (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . 68 6.20 Class Membership . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 6.21 Same Base Class Membership (VDM++ and VDM-RT) . . . . . . . . . . . . . . . 69 6.22 Same Class Membership (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . 70 6.23 History Expressions (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . 70 6.24 The Time Expression (VDM-RT) . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.25 Literals and Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 6.26 The Undefined Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 6.27 The Precondition Expression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 7 Patterns 77 7.1 Object Pattern (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . . . . 82 8 Bindings 85 9 Value (Constant) Definitions 87 10 Declaration of Modifiable State Components 89 10.1 Instance Variables (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . . 89 10.2 The State Definition (VDM-SL) . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 11 Operation Definitions 93 11.1 Constructors (VDM++ and VDM-RT) . . . . . . . . . . . . . . . . . . . . . . . . 99 iv
Image of page 4
CONTENTS 12 Statements 101 12.1 Let Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 12.2 The Define Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 12.3 The Block Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 12.4 The Assignment Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 12.5 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 12.6 For-Loop Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 12.7 The While-Loop Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 12.8 The Nondeterministic Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 12.9 The Call Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 12.10The Return Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 12.11Exception Handling Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 12.12The Error Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 12.13The Identity Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 12.14Start and Start List Statements (VDM++ and VDM-RT) . . . . . . . . . . . . . . . 124 12.15Stop and Stop List Statements (VDM++ and VDM-RT) . . . . . . . . . . . . . . . 125 12.16The Specification Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 12.17The Duration Statement (VDM-RT) . . . . . . . . . . . . . . . . . . . . . . . . . 127 12.18The Cycles Statement (VDM-RT) . . . . . . . . . . . . . . . . . . . . . . . . . . 128 13 Top-level Specification in VDM 131 13.1 Top-level Specification in VDM-SL . . . . . . . . . . . . . . . . . . . . . . . . . 131 13.1.1 A Flat Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 13.1.2 A Structured Specification . . . . . . . . . . . . . . . . . . . . . . . . . . 133 13.2 Top-level Specification in VDM++ and VDM-RT
Image of page 5

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

Image of page 6
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '15
  • william
  • Type system, Type theory, VDM, VDM-10 Language

{[ 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