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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.7 Example: Complex Numbers 257<br />

is defined by<br />

F<br />

£<br />

(a1¥<br />

then we represent F as<br />

£<br />

(b1 ¥ c1)¥ (b2 ¥ c1)¥ (b3 ¥ c2)¦ )¥ (a2 ¥<br />

£<br />

(b2 ¥ c3)¥ (b4¥ c1)¦ )¥ (a3 ¥ ¤ )¦<br />

£<br />

F a1 £ b1 ¥ c1 a1 £ b2 ¥ c1 a1 £ b3 ¥ c2 a2 £ b2 ¥ c3 a2 £ b4 ¥ c1 £ ¤ ¦ a3<br />

For the first step <strong>of</strong> the derivation we have to find a configuration, say conf , such that<br />

<br />

( init(3¥ new (Complex) 4)) add( init(8¥ 9))¥ ¤ ¥ ¥ ¤ ¥ Sys £ new (Complex) conf<br />

Since ( init(3¥ new (Complex) 4)) add( init(8¥ new (Complex) 9)) is <strong>of</strong> the form<br />

Ee m(Ee 1 ¥¡ ¡ ¡ ¥ Een) (choose Ee init(3¥ new (Complex) 4), m add, n 1, and<br />

Ee init(8¥ 1 new (Complex) 9)), we can apply rule (a) and deduce<br />

if<br />

conf<br />

E e ¡ add( new (Complex) init(8¥ 9))¥ ¡ ¡ ¥ s¡ ¥<br />

¡<br />

¡ ¥ Sys<br />

<br />

init(3¥ 4)¥ ¤ ¥ ¥ ¤ ¥ Sys £ e new ¡ ¥ ¡ ¡ ¥ s¡ ¥ ¡ ¥ Sys<br />

(Complex) E<br />

So, to calculate conf , we first have to calculate the latter transition. By applying rule (a)<br />

again we see that<br />

if<br />

E e ¡ ¥ ¡ ¥ s¡ ¥<br />

¡<br />

¡ ¥ Sys<br />

<br />

E e ¡ ¡ init(3¥ 4)¥ ¡ ¡ ¡ ¥ s¡ ¡ ¥<br />

<br />

(Complex)¥ ¤ ¥ ¥ ¤ ¥ Sys £<br />

new<br />

We can now use axiom (1) to deduce<br />

E e ¡ ¡ ¥ ¡ ¡ ¡ ¥ s¡ ¡ ¥<br />

This implies that<br />

and thus<br />

E e ¡ ¥ ¡ ¥ s¡ ¥<br />

conf<br />

¡<br />

¡<br />

¡ ¡ ¥ Sys<br />

¡ ¥ Sys<br />

<br />

¢ 1¥<br />

£ ¢ 1 re £ nil¥<br />

¢ 1 init(3¥ 4)¥<br />

¡<br />

¡ ¡ ¥ Sys<br />

E e ¡ ¡ ¥ ¡ ¡ ¡ ¥ s¡ ¡ ¥<br />

¢ 1 im £ nil¦ ¥<br />

£ ¢ 1 re £ nil¥<br />

¡<br />

¡ ¡ ¥ Sys<br />

¢<br />

init(8¥ init(3¥ 9))¥<br />

£ ¢ ¢ <br />

£ nil¦ £ ¥<br />

nil¥<br />

( 1 4)) add( new (Complex)<br />

1 re 1 im<br />

¥<br />

<br />

¥<br />

¡<br />

£ ¢ 1 £ Complex¦ ¥ Sys<br />

¢ £ ¢<br />

¥ ¥ £ Complex¦ £ ¥ Sys<br />

nil¦ 1 im 1<br />

£ ¢ 1 £ Complex¦ ¥ Sys<br />

The other transition steps <strong>of</strong> the derivation sequence are deduced in a similar way. The<br />

result <strong>of</strong> a partial derivation is as follows:<br />

£<br />

£<br />

( new (Complex) init(3¥ 4)) add( new (Complex) init(8¥ 9))¥ ¤ ¥<br />

By rules (a),(a) and axiom (1). ¦<br />

<br />

¥ ¤ ¥ Sys <br />

£ ¢ ¢ ¢<br />

init(3¥ init(8¥ nil¥ nil¦ 9))¥<br />

¥<br />

£ £ ¢ £<br />

<br />

£ ¥ Complex¦ Sys<br />

( 1 4)) add( new (Complex) 1 re 1 im<br />

1<br />

¥

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

Saved successfully!

Ooh no, something went wrong!