23.08.2013 Views

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

Specification of Reactive Hardware/Software Systems - Electronic ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

264 Process Part <strong>of</strong> POOSL<br />

We define<br />

CName pc = CName p ¦ CName c C pc ¥¡ ¡ ¡<br />

Var = IVar ¦ LVar p¥¡ ¡ ¡<br />

Next we define the set Stat p <strong>of</strong> process statements. These statements are used to specify<br />

the behaviour <strong>of</strong> process objects.<br />

S p :: S<br />

ch!m(E1 ¥¡ ¡ ¡ ¥ En) ¡<br />

ch?m(p1 ¥¡ ¡ ¡ ¥ pm ¡ E) ¡<br />

m(E1 ¥¡ ¡ ¡ ¥ En)(p1 ¥¡ ¡ ¡ ¥ pm)<br />

¡<br />

S ¡ p<br />

; Sp<br />

1<br />

S ¡ p<br />

1<br />

2<br />

or Sp<br />

2<br />

§ E S ¡ p<br />

if E then S ¡ p<br />

1 else S p<br />

2 fi<br />

1 abort S p<br />

¡<br />

2<br />

S p<br />

1 interrupt S p<br />

2<br />

do E then S ¡ p od<br />

S ¡ p<br />

The first type <strong>of</strong> process statement is a data statement defined in the language <strong>of</strong> data<br />

objects <strong>of</strong> the previous chapter. These statements are used to model internal data<br />

computations <strong>of</strong> a process.<br />

The next two statements are the message-send and message-receive statements. A messagesend<br />

statement ch!m(E1 ¥¡ ¡ ¡ ¥ En) indicates that a process is willing to send message m<br />

together with parameters E1 ¥¡ ¡ ¡ ¥ En, which refer to data objects, on channel ch. A<br />

message-receive statement ch?m(p1¥¡ ¡ ¡ ¥ pn ¡ E) indicates that a process is willing to<br />

receive message m with parameters p1 ¥¡ ¡ ¡ ¥ pm from channel ch under reception condition<br />

E. E is a boolean expression which may depend on the input parameters p1 ¥¡ ¡ ¡ ¥ pm. It<br />

may, however, also depend on instance variables or on other local variables.<br />

For a message to be transferred, exactly two process objects are needed. One <strong>of</strong> the<br />

objects should be executing a message-send statement, and the other a message-receive<br />

statement. These statements must refer to the same channel and the same message.<br />

Further, the number <strong>of</strong> parameters has to be equal. Finally, the reception condition <strong>of</strong><br />

the receiving object should allow message reception.<br />

When two process objects communicate, they perform a so-called rendezvous. A rendezvous<br />

procedure is performed in the following way: First, the message parameters<br />

E1 ¥¡ ¡ ¡ ¥ En <strong>of</strong> the message-send statement are evaluated from left to right. Then deep-<br />

Copies <strong>of</strong> these parameters are bound to the input parameters p1 ¥¡ ¡ ¡ ¥ pm <strong>of</strong> the messagereceive<br />

statement. After that, reception condition E is evaluated at the receiving process.<br />

If the expression evaluates to true or bunk, the rendezvous is successfully terminated.<br />

In all other cases, the states <strong>of</strong> both processes are restored to the states just before the<br />

rendezvous procedure started and no message is passed. This basically implies that the<br />

check whether a message may be passed is performed transparently for both processes.

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

Saved successfully!

Ooh no, something went wrong!