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.

8.4. SPECIFICATION OF THE TRANSFORMER IN RSL1<br />

vel, et, typings, func, trans, env, types),<br />

NoValueExprPairList →<br />

mk_BOOL_ENV_TYPES(true, env, types)<br />

end<br />

8.4.2 Let Expressions<br />

As let expressions are not a part <strong>of</strong> RSL1, all let expressions must be removed.<br />

This is done by inserting the actual value <strong>of</strong> the bindings in the<br />

value expression. In cases where the let bindings are products, the destructors<br />

<strong>of</strong> the short record definitions which were introduced in Section 8.4.1,<br />

are exploited in order to obtain the desired values. An example <strong>of</strong> such a<br />

change can be found in Example 8.3.<br />

Example 8.3 – Removing let expressions<br />

RSL specification:<br />

value<br />

TROptPreCondition :<br />

OptionalPreCondition × ExpType × FUNC × TRANS ×<br />

TYPES →<br />

OptionalPreCondition × TYPES<br />

TROptPreCondition(precond, et, func, trans, types) ≡<br />

case precond <strong>of</strong><br />

PreCondition(ve) →<br />

let<br />

(ve ′ , types ′ ) =<br />

TRValueExpr(ve, et, func, trans, types)<br />

in<br />

(PreCondition(ve ′ ), types ′ )<br />

end,<br />

NoPreCondition → (NoPreCondition, types)<br />

end<br />

RSL1 specification:<br />

type<br />

83

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

Saved successfully!

Ooh no, something went wrong!