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 />

m1 ++ { |-> 8,<br />

|-><br />

4}<br />

merge{ { |-> 9,<br />

|-> 4}<br />

{ |-> 9,<br />

|-> 3,<br />

|-><br />

1}}<br />

≡ { |-> 8,<br />

|-> 4,<br />

|-> 2,<br />

|-> 1,<br />

|-> 4}<br />

≡ { |-> 9,<br />

|-> 3,<br />

|-> 4,<br />

|-> 1}<br />

Europe 9,<br />

|-> 4}<br />

Europe 2,<br />

|-> 1}<br />

m1 :> {2,...,<strong>10</strong>} ≡ { |-> 9,<br />

|-> 4,<br />

|-> 2}<br />

m1 :-> {2,...,<strong>10</strong>} ≡ { |-> 1}<br />

m1 comp ({"France" |-> }) ≡ {"France" |-> 9}<br />

m2 ** 3 ≡ {1 |-> 4, 2 |-> 1,<br />

3 |-> 2, 4 |-> 3 }<br />

inverse m2 ≡ {2 |-> 1, 3 |-> 2,<br />

4 |-> 3, 1 |-> 4 }<br />

m2 comp (inverse m2) ≡ {1 |-> 1, 2 |-> 2,<br />

3 |-> 3, 4 |-> 4 }<br />

3.2.4 Product Types<br />

The values of a product type are called tuples. A tuple is a fixed length list where the i’th element<br />

of the tuple must belong to the i’th element of the product type.<br />

Syntax:<br />

type = product type<br />

21

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

Saved successfully!

Ooh no, something went wrong!