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.5 A Computational Semantics 251<br />

stuck and the execution <strong>of</strong> the assignment statement can not be finished. If it is terminal,<br />

then Ee is <strong>of</strong> the ¤ form ¤ where is either a primitive object or an identifier <strong>of</strong> a nonprimitive<br />

object. In this case axiom (2) applies and the actual assignment can be carried<br />

out. In the application <strong>of</strong> this axiom the ¢ owner <strong>of</strong> instance variable x, is retrieved.<br />

is the first component <strong>of</strong> the local variable environment located at the top <strong>of</strong> stack s<br />

¢<br />

(top(s))(1)) and is either a non-primitive data object or proc. In the latter case, x is<br />

(¢<br />

owned by a process object that is executing the assignment statement. If stack s is not<br />

(¡ empty ¡ ¡ s 0) ¢ and is ¤ retrieved, is assigned to instance variable x ¢ <strong>of</strong> in variables<br />

£<br />

(¡ ¡ ¡ ¡ (¢ ¡ state ) £<br />

x¦ © ¢¨¦ ). ¤ ©<br />

The last axioms and rules we will address in this paragraph concern the handling <strong>of</strong> a<br />

method call.<br />

(8) Method call<br />

<br />

if ¥¡ £¢<br />

m( ¤ 1 ¥¡ ¡ ¡ ¥ ¤ k )¥ ¡ ¥ s¥<br />

¡<br />

¤§¦©¨<br />

¥¤§¦<br />

¡<br />

¥ Sys £<br />

<br />

E¥ ¡ ¥ s¡ ¥<br />

¡<br />

¥ Sys<br />

¤§¦<br />

¡ ¡<br />

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡<br />

¡ (¡ ¥ ¡ ¡ m(u1¥¡ ¡ ¡ ¡ ¡<br />

1 , CDj data class C MD1 MD MDl ,<br />

C ) and MD uk) v1 vn E<br />

where s¡ push(e¥ s) , e <br />

(e) Method execution<br />

E e ¥ ¡ ¥ s¥<br />

<br />

E e ¥ ¡ ¥ s¥<br />

(9) Returning the result<br />

where s¡<br />

<br />

if ¡ s ¡ ¡ 0<br />

§¤ ¥ ¡ ¥ s¥<br />

pop(s)<br />

¡<br />

¡<br />

¥ Sys £<br />

¡<br />

¥ Sys £<br />

¥ Sys £<br />

Consider the configuration <br />

<br />

¡ ¥ ¤ , ¤ (ui) ¤ i and ¤ (vj) nil<br />

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

<br />

¤ ¥ ¡ ¥ s¡ ¥<br />

¡<br />

¥ Sys ¡<br />

¡<br />

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

¡<br />

¥ Sys<br />

¡ ¥ Sys<br />

m( 1 ¥¡ ¡ ¡ ¥ ¤ k )¥ ¡ ¡<br />

¥ s¥<br />

¡ ¤<br />

parameters ¡ ¡ ¤ 1 k is to be sent to non-primitive ¡ object . Stated otherwise, method<br />

¤<br />

m ¡ <strong>of</strong> object has to be called ¤ with ¡ ¡ ¤ parameters 1 k . To this end, first the method<br />

definition <strong>of</strong> m in Sys has to be retrieved. For this, the class name C ¡ <strong>of</strong> object is required.<br />

This name is stored in ¡ ¡ ¡<br />

at (¡ position (C ). Using C and m, the method definition<br />

¡ ¡ ¥ MD ¡ uk) ¡ ¡ v1 ¡ vn E <strong>of</strong> m is uniquely determined (if it exists). Upon<br />

<br />

m(u1¥¡ the<br />

call <strong>of</strong> m a new local variable environment e<br />

¥ Sys indicating that message m with<br />

stack (s¡ push(e¥ s s)). ¡ Here denotes the data object that has to execute method ¤ m.<br />

stores the values <strong>of</strong> the local variables and parameters <strong>of</strong> this object. ¤ In each <strong>of</strong> the<br />

¡ ¥ ¤ is created and pushed on top <strong>of</strong><br />

method parameters ui is bound to ¤ i (¤ (ui) ¤ i) and each <strong>of</strong> the local method variables<br />

(¤ vj is bound to nil (vj) nil). The resulting configuration is <br />

¡ ¡<br />

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

<br />

, where E<br />

is the body <strong>of</strong> method m. E indicates that expression E still remains to be evaluated as<br />

part <strong>of</strong> the execution <strong>of</strong> method m.

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

Saved successfully!

Ooh no, something went wrong!