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

if vdl = 〈〉 then func<br />

else<br />

makeFuncMap(<br />

tl vdl, func † getMapEntrance(hd vdl, trans),<br />

trans)<br />

end,<br />

/∗Estalishes an entrance in the FUNC map based<br />

on a value definition.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

vd: the value definition<br />

∗/<br />

getMapEntrance : ValueDef × TRANS → FUNC<br />

getMapEntrance(vd, trans) ≡<br />

case vd <strong>of</strong><br />

ExplicitValueDef(st, ve) →<br />

if<br />

includesTRANSName(<br />

Known(type_expr(st)), dom trans)<br />

then<br />

case binding(st) <strong>of</strong><br />

IdBinding(id) →<br />

[ id ↦→<br />

mk_FuncSpec(<br />

FunctionTypeExpr(<br />

TypeLiteral(UNIT),<br />

TOTAL_FUNCTION_ARROW,<br />

mk_ResultDesc(<br />

NoReadAccessMode,<br />

NoWriteAccessMode, type_expr(st))<br />

), ve, 〈〉, 〈〉) ],<br />

Make_ProductBinding(pb) → [ ]<br />

end<br />

else [ ]<br />

end,<br />

ExplicitFunctionDef(st, ffa, ve, precond) →<br />

case binding(st) <strong>of</strong><br />

IdBinding(id) →<br />

[ id ↦→<br />

mk_FuncSpec(type_expr(st), ve, 〈〉, 〈〉) ]<br />

end<br />

end,<br />

290

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

Saved successfully!

Ooh no, something went wrong!