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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6.4. TRANSFORMING EXPLICIT FUNCTION DEFINITIONS<br />

Example 6.10 – <strong>Transformation</strong> <strong>of</strong> a list application<br />

scheme A_SPEC =<br />

class<br />

type T = Int,<br />

LIST = Int ∗<br />

✄<br />

end<br />

value<br />

f : T × LIST → Int<br />

f(x, l) ≡ l(g1(x)),<br />

g1 : T → T<br />

g1(x) ≡ x + 1<br />

scheme I_SPEC =<br />

class<br />

type<br />

T = Int,<br />

LIST = Int ∗<br />

end<br />

variable<br />

t : T<br />

value<br />

f : LIST → read t write t Int<br />

f(l) ≡ l((g1() ; t)),<br />

g1 : Unit → read t write t Unit<br />

g1() ≡ t := t + 1<br />

Bracketed Expressions<br />

A bracketed expression has the following form:<br />

(value_expr)<br />

A bracketed expression is transformed by transforming the constituent<br />

value expression.<br />

45

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

Saved successfully!

Ooh no, something went wrong!