26.09.2013 Views

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ...

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.

CHAPTER 2. GENERAL IDEA<br />

value<br />

increment : Unit → read t, s write t Unit<br />

increment() ≡ t := t + s<br />

end<br />

The problem occurs because it is necessary to distinguish between the<br />

type names <strong>of</strong> the types <strong>of</strong> interest and the actual types <strong>of</strong> the types <strong>of</strong><br />

interest. This means that the type inference <strong>of</strong> the value expressions changes<br />

accordingly. A value expressions with type <strong>of</strong> interest T = type_expr is<br />

treated as a value expression <strong>of</strong> type T and not <strong>of</strong> type type_expr as the<br />

static inference <strong>of</strong> RSL normally prescribes. The type <strong>of</strong> a value expression<br />

is solely determined based on the single typing <strong>of</strong> the function definition in<br />

which the value expression is incorporated.<br />

This makes new demands on the specification style. It is very important<br />

that the types <strong>of</strong> interest are used with care in the applicative specification.<br />

They shall only be used in contexts where they are actually wanted. When<br />

it is necessary that only some occurrences <strong>of</strong> a type <strong>of</strong> interest should be<br />

transformed as types <strong>of</strong> interest, it is necessary to establish other type names<br />

with the same type as the type <strong>of</strong> interest. Then these new type names<br />

should be used whenever an expression should not be transformed as a type<br />

<strong>of</strong> interest.<br />

The problem could be avoided by making an interactive transformer in<br />

which the user interactively could decide which occurrences <strong>of</strong> the types <strong>of</strong><br />

interest that should be transformed as such and which should be transformed<br />

as ordinary types. This solution is not implemented in this project.<br />

12

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

Saved successfully!

Ooh no, something went wrong!