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.

APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />

Arguments:<br />

=======<br />

lb: the let binding<br />

te: the type expression <strong>of</strong> the function result<br />

Result:<br />

=======<br />

LetBinding: the imperative version <strong>of</strong> the let<br />

binding<br />

∗/<br />

TRLetBinding :<br />

LetBinding × TypeExpr × FUNC × TRANS × TYPES →<br />

LetBinding<br />

TRLetBinding(lb, te, func, trans, types) ≡<br />

case lb <strong>of</strong><br />

MakeBinding(b) →<br />

MakeBinding(makeBinding(TRBinding(b, te, trans))),<br />

MakeRecordPattern(vn, pl) →<br />

let<br />

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

TRPatternList(pl, func, trans, types)<br />

in<br />

MakeRecordPattern(vn, pl ′ )<br />

end,<br />

MakeListPatternLet(lp) →<br />

let<br />

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

TRListPattern(lp, func, trans, types)<br />

in<br />

MakeListPatternLet(lp ′ )<br />

end<br />

end,<br />

/∗Transforms a binding.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

b: the binding<br />

te: the type expression <strong>of</strong> the binding<br />

Result:<br />

=======<br />

Binding_list: the imperative version <strong>of</strong> the let<br />

binding in list form. The occurrences <strong>of</strong> bindings<br />

<strong>of</strong> the type <strong>of</strong> interest is removed<br />

∗/<br />

214

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

Saved successfully!

Ooh no, something went wrong!