Formal Specifi cations—1 Model Oriented 569
20.2.7 The Set Type
In VDM, a set is a data structure composed of a collection of distinct instances of some base type T . Each of
these instances is called an element (or sometimes member) of the set. For instance, taking the base type to
be N, then some example sets written using VDM syntax are as follows:
{1, 4, 9, 16, 25, 36, 49, 64, 81}
{1, 3, 5, 7, 9, 11}
{ } (called the empty set)
Note that when a set is written, the ordering of elements makes no difference. For example,
{1, 4, 9, 16, 25, 36, 49, 64, 81},
{9, 4, 1, 16, 25, 36, 49, 64, 81},
{36, 49, 64, 81, 1, 4, 9, 16, 25}
all represent the same set. As with the integer type, sets have well-defi ned primitive functions and predicates.
Some of them are: ...