25.07.2014 Views

VDM-10 Language Manual

VDM-10 Language Manual

VDM-10 Language Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Contents<br />

1 Introduction 1<br />

1.1 The <strong>VDM</strong> Specification <strong>Language</strong> (<strong>VDM</strong>-SL) . . . . . . . . . . . . . . . . . . . . 1<br />

1.2 The <strong>VDM</strong>++ <strong>Language</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1<br />

1.3 The <strong>VDM</strong> Real Time <strong>Language</strong> (<strong>VDM</strong>-RT) . . . . . . . . . . . . . . . . . . . . . 2<br />

1.4 Purpose of The Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />

1.5 Structure of the Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2<br />

2 Concrete Syntax Notation 3<br />

3 Data Type Definitions 5<br />

3.1 Basic Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5<br />

3.1.1 The Boolean Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6<br />

3.1.2 The Numeric Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8<br />

3.1.3 The Character Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />

3.1.4 The Quote Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11<br />

3.1.5 The Token Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />

3.2 Compound Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12<br />

3.2.1 Set Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13<br />

3.2.2 Sequence Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15<br />

3.2.3 Map Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18<br />

3.2.4 Product Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21<br />

3.2.5 Composite Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22<br />

3.2.6 Union and Optional Types . . . . . . . . . . . . . . . . . . . . . . . . . . 26<br />

3.2.7 The Object Reference Type (<strong>VDM</strong>++ and <strong>VDM</strong>-RT only) . . . . . . . . . 27<br />

3.2.8 Function Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28<br />

3.3 Invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30<br />

4 Algorithm Definitions 33<br />

5 Function Definitions 35<br />

5.1 Polymorphic Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39<br />

5.2 Higher Order Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40<br />

iii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!