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.

APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />

Known(te) →<br />

case te <strong>of</strong><br />

TypeName(tn) →<br />

if tn ∈ dom trans<br />

then<br />

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

removeTOI(tl vel, tl etl, trans)<br />

else<br />

/∗Not type <strong>of</strong> interest.∗/<br />

〈hd vel〉 <br />

removeTOI(tl vel, tl etl, trans)<br />

end,<br />

→<br />

〈hd vel〉 <br />

removeTOI(tl vel, tl etl, trans)<br />

end,<br />

Unknown →<br />

〈hd vel〉 removeTOI(tl vel, tl etl, trans)<br />

end<br />

end,<br />

/∗Transforms a list or map application.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

ve: the value expression<br />

vel: the arguments <strong>of</strong> the list or map application<br />

et: the expected type <strong>of</strong> the list or map application<br />

Result:<br />

=======<br />

ValueExpr: the imperative version <strong>of</strong> the list<br />

or map application<br />

∗/<br />

TRListMapAppl :<br />

ValueExpr × ValueExpr ∗ × ExpType × FUNC ×<br />

TRANS × TYPES →<br />

ValueExpr × TYPES<br />

TRListMapAppl(ve, vel, et, func, trans, types) ≡<br />

let<br />

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

TRValueExprList(vel, et, func, trans, types),<br />

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

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

in<br />

210

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

Saved successfully!

Ooh no, something went wrong!