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.

9.6 Example: A Simple Handshake Protocol 289<br />

conf p<br />

conf p<br />

start) Receiver)<br />

£<br />

<br />

¥ )¥ y¦ ¥ ¥ Sys<br />

x¥ ) p envS( envR( Sys<br />

14 ( <br />

start) ¢ (§ § ) start = (y?ack; Sender start £<br />

start)<br />

)¥ ¥ ¥ ) Sys<br />

(y!ack; Receiver)<br />

p envS( envR( Sys<br />

y¦ x¥ ¥<br />

<br />

(start) ¢ § (§ 15( ) start = Sender start (start) £ <br />

¥ )¥ ¥ Sys )<br />

Receiver)<br />

p envS( envR( Sys<br />

conf p<br />

16( ) = <br />

conf p<br />

x¥ y¦ ¥<br />

§ start start) ¢<br />

§<br />

(in?receive(dS); x!transfer(dS); y?ack; Sender start (start) Receiver)<br />

£ <br />

¥ envS(nil)¥ Sys ) ¥<br />

p envR( Sys<br />

y¦ x¥ ¥<br />

17 ( <br />

(start) ¢ (§ § ) start = Sender start (x?transfer(dR); out!deliver(dR); y!ack;<br />

£ <br />

)¥ envR(nil) ¥ envS( Sysp Sys ¥<br />

conf p<br />

18( S ¥ R) = <br />

start) Receiver)<br />

x¥ y¦ ¥<br />

§ start (x!transfer(dS); start) y?ack; ¢ § Sender start Receiver)<br />

£<br />

(start)<br />

<br />

¥ x¥ S)¥ R) y¦ ¥ envS( envR( Sysp ¥ Sys<br />

Here, envS and envS( ) denote environments <strong>of</strong> the Sender process. In envS no local<br />

variables are allocated on the stack (the stack is empty), whereas in envS( ) variable dS<br />

is allocated and bound to primitive object . Environments envR and envR( ) have a<br />

similar meaning for the Receiver process. The environments are defined as<br />

<br />

£<br />

¦ ¥ ¥ ¤ <br />

envS £<br />

<br />

proc £ ¤<br />

¦ ¥ ¥ ¤ <br />

envR <br />

proc £<br />

£ £ ¤<br />

¤ ¦ ¥ proc¥<br />

envS( £ ¦ ¥ ¤ <br />

)<br />

<br />

proc £<br />

<br />

dS £<br />

£<br />

¤ ¦ ¥ proc¥<br />

envR( £ ¦ ¥ ¤ <br />

) proc dR £<br />

We mentioned that the protocol externally behaves as a 1-place buffer (see Figure 9.3).<br />

We will show this by giving an explicit specification <strong>of</strong> such a buffer and by proving that<br />

in Buffer<br />

out<br />

Figure 9.3: A 1-place Buffer<br />

this specification is transformation equivalent to the protocol.<br />

The 1-place buffer is specified as<br />

Buffer¥<br />

where Sys = <br />

<br />

¥ Sys p ¡ ¥ Sys<br />

and where Sys p ¡<br />

process class Buffer<br />

instance variables<br />

communication channels in out<br />

message interface in?receive(dB) out!deliver(dB)

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

Saved successfully!

Ooh no, something went wrong!