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.

<strong>VDM</strong>-<strong>10</strong> <strong>Language</strong> <strong>Manual</strong><br />

✞<br />

types<br />

✡✝<br />

ExpertId = token;<br />

Expert :: expertid : ExpertId<br />

quali : set of Qualification<br />

inv ex == ex.quali {};<br />

Qualification = | | | <br />

functions<br />

QualificationOK: set of Expert * Qualification -> bool<br />

QualificationOK(exs,reqquali) ==<br />

exists ex in set exs & reqquali in set ex.quali<br />

✆<br />

The function min gives us an example of a universal quantification:<br />

✞<br />

✡✝<br />

min(s: set of nat) x: nat<br />

pre s {}<br />

post x in set s and<br />

forall y in set s \ {x} & y < x<br />

✆<br />

We can use unique existential quantification to state the functional property satisfied by all<br />

maps m:<br />

✞<br />

✡✝<br />

forall d in set dom m &<br />

exists1 r in set rng m & m(d) = r<br />

✆<br />

6.6 The Iota Expression<br />

Syntax: expression = . . .<br />

| iota expression<br />

| . . . ;<br />

iota expression = ‘iota’, bind, ‘&’, expression ;<br />

Semantics: An iota expression has the form:<br />

✞<br />

iota bd & e<br />

✡✝<br />

✆<br />

50

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

Saved successfully!

Ooh no, something went wrong!