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

Semantics: The function sameclass when applied to object references expression1 and<br />

expression2 yields the boolean value true if and only if the objects denoted by expression1<br />

and expression2 are instances of the same class, and false otherwise.<br />

Examples: Assuming the classes Tree, BinarySearchTree, Queue, and identifiers t, b, q<br />

from section 6.18, and assuming b’ is another instance of BinarySearchTree we have:<br />

sameclass(b,t) ≡ false<br />

sameclass(b,b’) ≡ true<br />

sameclass(q,t) ≡ false<br />

6.22 History Expressions (<strong>VDM</strong>++ and <strong>VDM</strong>-RT)<br />

Syntax: expression = . . .<br />

| act expression<br />

| fin expression<br />

| active expression<br />

| req expression<br />

| waiting expression<br />

| . . . ;<br />

act expression = ‘#act’, ‘(’, name, ‘)’<br />

| ‘#act’, ‘(’, name list, ‘)’ ;<br />

fin expression = ‘#fin’, ‘(’, name, ‘)’<br />

| ‘#fin’, ‘(’, name list, ‘)’ ;<br />

active expression = ‘#active’, ‘(’, name, ‘)’<br />

| ‘#active’, ‘(’, name list, ‘)’ ;<br />

req expression = ‘#req’, ‘(’, name, ‘)’<br />

| ‘#req’, ‘(’, name list, ‘)’ ;<br />

waiting expression = ‘#waiting’, ‘(’, name, ‘)’<br />

| ‘#waiting’, ‘(’, name list, ‘)’ ;<br />

Semantics: History expressions can only be used in permission predicates (see section 15.1).<br />

History expressions may contain one or more of the following expressions:<br />

• #act(operation name). The number of times that operation name operation has been<br />

activated.<br />

• #fin(operation name). The number of times that the operation name operation has<br />

been completed.<br />

66

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

Saved successfully!

Ooh no, something went wrong!