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.

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

The first two expressions are instance variables and local variables 1 . The value <strong>of</strong> such a<br />

variable expression is (a reference to) the object currently stored in that variable. The<br />

next type <strong>of</strong> expression is the new expression. This expression indicates that a new<br />

object (<strong>of</strong> class C) has to be created. The expression yields the newly created object.<br />

Expression self refers to the object which is currently evaluating this expression.<br />

The sixth type <strong>of</strong> expression is a message-send expression. Here E refers to the object to<br />

which message m has to be sent and E1 ¥¡ ¡ ¡ ¥ En are the parameters <strong>of</strong> the message. When<br />

a message-send expression is evaluated, first the destination expression is evaluated,<br />

then the parameters are evaluated from left to right, and finally the message is sent to<br />

the destination object. This latter object initialises its method parameters to the objects<br />

in the message and initialises its local method variables to nil. Next, the receiving object<br />

starts evaluating its method expression. The result <strong>of</strong> this evaluation is the result <strong>of</strong> the<br />

send expression which is returned to the sending object.<br />

Next, we have constant expressions ¥¡ ¡ ¡ , which refer to the above defined primitive<br />

objects. stands for the direct naming (textual representation) <strong>of</strong> primitive object . An<br />

expression can be composed from a statement and another expression. When such a<br />

composite expression is evaluated, first the statement is executed and then the succeeding<br />

expression is evaluated. The value <strong>of</strong> this latter expression will be the value <strong>of</strong> the<br />

composite expression.<br />

Next, we define the set Stat <strong>of</strong> data statements. We let S, ¡ ¡ range over Stat which is<br />

defined as<br />

S :: E<br />

¡<br />

¡<br />

¡<br />

x : E<br />

u : E<br />

S1; S2<br />

if E then S1 else S2 fi ¡<br />

do E then S od ¡<br />

The first type <strong>of</strong> statement is a data expression. Executing such a statement means that<br />

the expression is evaluated and the result is discarded. The effect <strong>of</strong> the execution is the<br />

side-effect <strong>of</strong> the expression evaluation.<br />

Next, we have two assignment statements: the first to an instance variable and the<br />

second to a local variable. Upon execution <strong>of</strong> an assignment statement, the expression is<br />

evaluated and the result, a primitive object or a reference to an object <strong>of</strong> a non-primitive<br />

data class, is assigned to the variable.<br />

Sequential composition, the if-statement, and the do-statement have their usual meaning. If<br />

expression E <strong>of</strong> the if-statement or the do-statement evaluates to bunk, a non-deterministic<br />

choice is taken whether the value should be interpreted as true or as false.<br />

1 Note that we consider a parameter to be a local variable too.

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

Saved successfully!

Ooh no, something went wrong!