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.3 Formal Syntax 243<br />

runk, and cunk. nil can be considered to be element <strong>of</strong> every class. Besides an equality<br />

(==) message, this object does not recognise any message and the execution aborts when<br />

another message is sent to it. bunk, iunk, runk, and cunk represent the unknown data<br />

objects <strong>of</strong> classes Boolean, Integer, Real, and Char. An unknown object recognises the same<br />

messages as the other objects <strong>of</strong> its class. The calculated results follow rules such as<br />

bunk or true true, iunk<br />

6 bunk, and 1 567 runk runk. Unknown objects<br />

are introduced to allow the specification <strong>of</strong> non-deterministic, yet executable, behaviour.<br />

Non-determinism is a very powerful tool to achieve abstraction in specifications.<br />

Every object (primitive as well as non-primitive) recognises a special message called<br />

equality (==). Through the equality message it is decided whether or not two expressions<br />

refer to the same object.<br />

8.3 Formal Syntax<br />

In this section an (abstract) syntax <strong>of</strong> the language <strong>of</strong> data objects is given in BNF<br />

notation. The syntax resembles the syntax <strong>of</strong> Smalltalk defined in [GR89] and is based<br />

on the abstract syntax <strong>of</strong> POOL [ABKR86]. We assume that the following sets <strong>of</strong> syntactic<br />

elements are given:<br />

IVar instance variables x¥ y¥¡ ¡ ¡<br />

LVar local variables (parameters included) u¥ v¥ w¥¡ ¡ ¡<br />

CName data class names C¥¡ ¡ ¡<br />

MName method and message names m¥¡ ¡ ¡<br />

First, we define the set PDObj <strong>of</strong> primitive data objects with typical elements ¥¡ ¡ ¡ . This set<br />

contains boolean objects ( ), integer objects (¡ ), real objects (¢ ), character objects (Char)<br />

and nil. The unknown objects bunk, iunk, runk, and cunk are assumed to be elements <strong>of</strong><br />

sets , ¡ , ¢ and Char respectively.<br />

£<br />

PDObj nil¦<br />

¦£¡£¦£¢¢¦ Char ¦<br />

¢ ¡<br />

(+,-,=,¡ ¡ ¡<br />

1¥ 0¥ 1¥ 2¥¡ ¡ ¡ ¡ ¡ 2¥¥¤ ¡ ¥¥¤<br />

¡<br />

¦¦¡£¦£¢¢¦ ¡£<br />

The theories <strong>of</strong> sets , , and Char together with their usual operators and relators<br />

, , ) are assumed to be parameters <strong>of</strong> our semantics. We further assume that<br />

true and false are elements <strong>of</strong> set , that<br />

that nil for all Char.<br />

are elements <strong>of</strong> set and<br />

We define the set Exp <strong>of</strong> data expressions , with typical elements E, ¡ ¡ , as follows:<br />

E :: x<br />

u ¡<br />

new (C) ¡<br />

self ¡<br />

¡ E m(E1 ¥¡ ¡ ¡ ¥ En)<br />

¡<br />

¡ S;E

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

Saved successfully!

Ooh no, something went wrong!