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

getCardnumber : atmc -> seq1 of digit<br />

getCardnumber (atmc) ==<br />

atmc.cardnumber<br />

end ATMCard<br />

✡✝<br />

✆<br />

Here the invariant on the type atmc states that expiry dates must represent valid dates, and<br />

card numbers must be at least 8 digits long. Note that since digit is not exported with<br />

the struct keyword from the module BankAccount, we cannot access the invariant<br />

for digit in module ATMCard. However this notwithstanding, all values of type digit<br />

manipulated in ATMCard must satisfy the invariant.<br />

160

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

Saved successfully!

Ooh no, something went wrong!