In the following, let m be the name of the message being specified, T be the sequence of messages sent to the object so far including m and S1 be the sequence just before m is sent.
@
'' operator - this specifies that the expression following
the ``@
'' should be evaluated using S1 as the sequence for
any operator(s) requiring a sequence.
Consider the following sequence of messages to a Queue object
Queue() Enqueue(10) Dequeue() Enqueue(5)
The value of the expression
<tex2htmlverbmark>37<tex2htmlverbmark>enabled(Dequeue) is false for this sequence, whereas the value of
enabled(Dequeue) is true.
An expression enabled(m) , where m is a message, evaluates to true at T iff
@
enabled(m) is true.
Consider the Queue example and the sequence
Queue() Enqueue(10) Dequeue() Enqueue(5)
Here,
enabled(Dequeue) is true, whereas
<tex2htmlverbmark>40<tex2htmlverbmark>enabled(Dequeue) is false.
#
'' operator - takes a message name. It counts the number of
messages in T with the given name that terminated normally.
Consider the following sequence of messages to a Queue
object.
Queue() Dequeue() Enqueue(10)
The value of the expression
#
(Dequeue) is 0 because the first Dequeue would
terminate abnormally.
On the other hand, consider the sequence
Queue() Dequeue() Enqueue(10) Dequeue()
Here #
(Dequeue) evaluates to 1 and so does
#
(Enqueue).
Consider the Queue example and the sequence
Queue() Dequeue() Enqueue(10) Enqueue(5)
At the end of the sequence, the expression
param(2, Enqueue, elem) evaluates to 5.
The sequence parameter in the above discussed
operators on sequences of messages is implicit. It is always either the
current sequence, or the subsequence excluding the last message (when using
the ``@
'' operator).