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 />

Make_ValueOrVariableName(vn) →<br />

if id(vn) ∈ dom func<br />

then<br />

/∗Function application.∗/<br />

case type_expr(func(id(vn))) <strong>of</strong><br />

FunctionTypeExpr(arg, fa, res) →<br />

let<br />

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

TRValueExpr(<br />

value_expr(ld),<br />

Known(type_expr(res)), func,<br />

trans, types),<br />

/∗Updates TYPES.∗/<br />

types ′′ =<br />

makeTYPES(<br />

binding(ld),<br />

Known(type_expr(res)), trans)<br />

in<br />

if<br />

isGen(<br />

ve,<br />

Known(type_expr(func(id(vn)))),<br />

trans, func)<br />

then<br />

if<br />

∼ returnsNonTOI(<br />

ve,<br />

Known(<br />

type_expr(func(id(vn)))),<br />

trans, func)<br />

then<br />

(mk_LetDef(<br />

MakeBinding(<br />

IdBinding(mk_Id( ′′ dummy ′′ ))),<br />

ve ′ ), types ′ † types ′′ )<br />

else<br />

(mk_LetDef(<br />

TRLetBinding(<br />

binding(ld),<br />

type_expr(res), func,<br />

trans, types ′′ ), ve ′ ),<br />

types ′ † types ′′ )<br />

end<br />

else<br />

212

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

Saved successfully!

Ooh no, something went wrong!