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.

Chapter 3. Data Type Definitions<br />

(a div e) * e ≡ 6<br />

3.1.3 The Character Type<br />

The character type contains all the single character elements of the <strong>VDM</strong> character set (see Table<br />

B.1 on page 200).<br />

Name: Char<br />

Symbol: char<br />

Values: ’a’, ’b’, . . . , ’1’, ’2’, . . . ’+’, ’-’ . . .<br />

Operators: Assume that c1 and c2 in the following denote arbitrary characters:<br />

Examples:<br />

Operator Name Type<br />

c1 = c2 Equal char * char → bool<br />

c1 c2 Not equal char * char → bool<br />

’a’ = ’b’ ≡ false<br />

’1’ = ’c’ ≡ false<br />

’d’ ’7’ ≡ true<br />

’e’ = ’e’ ≡ true<br />

3.1.4 The Quote Type<br />

The quote type corresponds to enumerated types in a programming language like Pascal. However,<br />

instead of writing the different quote literals between curly brackets in <strong>VDM</strong> it is done by letting a<br />

quote type consist of a single quote literal and then let them be a part of a union type.<br />

Name: Quote<br />

Symbol: e.g. <br />

Values: , , , . . .<br />

Operators: Assume that q and r in the following denote arbitrary quote values belonging to an<br />

enumerated type T:<br />

Operator Name Type<br />

q = r Equal T * T → bool<br />

q r Not equal T * T → bool<br />

11

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

Saved successfully!

Ooh no, something went wrong!