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.

250 Data Part <strong>of</strong> POOSL<br />

is defined by 22 axioms (1) ¡ ¡ (22) and 7 rules (a) ¡ ¡ (g). The complete collection <strong>of</strong><br />

axioms and rules is given in Section A.1. In this subsection we will select a number <strong>of</strong><br />

axioms and rules and we will explain them informally. In Subsection 8.5.4 axioms (21)<br />

and (22), both dealing with primitive deepCopy messages, are explained in detail.<br />

(1) Object creation<br />

new (C)¥ ¡ ¥ s¥<br />

if Sys<br />

¡<br />

¥ Sys £<br />

¢ n¥ ¡ ¡ ¥ s¥<br />

CD1 ¡ ¡ CDj ¡ ¡ CDl and<br />

¡<br />

¡ ¥ Sys<br />

CDj data class C instance variables x1 ¡ ¡ xp instance methods ¡ ¡<br />

£ ¢<br />

£ © n¦ Dom(£ ¡ ¡<br />

MaxId(¡<br />

where , )<br />

n ) 1 and ¡<br />

£<br />

¡ ¥ ¦ £ ¡ £ x1¥¡<br />

©<br />

xp , (xi) nil ,<br />

C<br />

¢ ¡<br />

n¦<br />

Axiom (1) describes the behaviour <strong>of</strong> the new(C) expression. The condition <strong>of</strong> the axiom<br />

states that the expression can only be evaluated if there exists a data class, named C,<br />

in Sys. Here we have used symbol to denote syntactic identity. Upon creation <strong>of</strong> an<br />

instance <strong>of</strong> class C a new object identifier ¢ n is calculated. n equals the greatest object<br />

identifier number contained ¡ in plus (MaxId(¡ one ) 1). Further a new £ environment ,<br />

storing the values <strong>of</strong> the instance variables ¥¡ ¡ ¡ ¥ x1 xp, is created. Each <strong>of</strong> these instance<br />

¡<br />

¡<br />

variables is initialised to nil. Environment £ is then assigned to object identifier ¢ n in<br />

variables ¡ state to ¡ ¡ (¡ ¡ ¡<br />

obtain<br />

type ¡<br />

to yield ¡<br />

¡ ( ¡<br />

£<br />

object identifier ¢ n.<br />

(2) Assignment to instance variables<br />

x : ¤ ¥ ¡ ¥ s¥<br />

if ¡ s ¡ ¡ 0<br />

¡<br />

¡<br />

¡<br />

C©<br />

£<br />

£ ©<br />

¢ n¦ ). Further class name C is assigned to ¢ n in<br />

¢ n¦ ). The result <strong>of</strong> the new(C) expression is the newly created<br />

¥ Sys £<br />

<br />

¤ ¥ ¡ ¡ ¥ s¥<br />

¡<br />

¥ Sys<br />

£<br />

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

¦ © ¢¨¦ and ¢ (top(s))(1)<br />

¤ ©¢¡<br />

(c) Assignment to instance variables<br />

E e ¥ ¡ ¥ s¥<br />

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

¡<br />

¥ Sys £<br />

¡<br />

¥ Sys £<br />

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

¡<br />

¡ ¥ Sys<br />

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

¡<br />

¡ ¥ Sys<br />

Both axiom (2) and rule (c) concern the assignment to instance variables. Consider<br />

configuration x : Ee ¡<br />

¥ s¥ ¥ Sys ¥ ¡ . If the evaluation <strong>of</strong> extended expression Ee is not<br />

finished yet, then rule (c) can possibly be applied to carry out a next evaluation step.<br />

Rule (c) states that if the one-step evaluation <strong>of</strong> Ee ¡<br />

¥ s¥ ¥ Sys ¥ ¡ leads to Ee ¡ ¡<br />

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

then the one-step execution <strong>of</strong> x : Ee ¡<br />

¥ s¥ ¥ Sys ¥ ¡ leads to x : Ee ¡ ¡<br />

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

¡<br />

. Notice<br />

that state , stack s and type ¡ may change as a result <strong>of</strong> this step.<br />

If rule (c) cannot be applied to x : Ee ¡<br />

¥ s¥ ¥ Sys ¥ ¡ , then configuration Ee ¡<br />

¥ s¥ ¥ Sys<br />

¥ ¡<br />

is either stuck or terminal. If it is stuck then configuration x : Ee ¥ s¥ ¥ Sys ¥ ¡ is also<br />

¡

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

Saved successfully!

Ooh no, something went wrong!