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

case et <strong>of</strong><br />

Known(te) →<br />

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

TypeExprMap(tem) →<br />

case tem <strong>of</strong><br />

FiniteMapTypeExpr(tedom, terange) →<br />

mk_MapType(Known(tedom), Known(terange)),<br />

FiniteMapTypeExpr(tedom, terange) →<br />

mk_MapType(Known(tedom), Known(terange))<br />

end,<br />

→ mk_MapType(Unknown, Unknown)<br />

end,<br />

→ mk_MapType(Unknown, Unknown)<br />

end,<br />

/∗Gets the expected type <strong>of</strong> a bracketed type.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

et: the expected type<br />

Results:<br />

=====<br />

ExpType: the expected type <strong>of</strong> the if bracketed,<br />

Unknown otherwise<br />

∗/<br />

getBracketedType : ExpType → ExpType<br />

getBracketedType(et) ≡<br />

case et <strong>of</strong><br />

Known(te) →<br />

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

BracketedTypeExpr(bte) → Known(bte),<br />

→ Unknown<br />

end,<br />

Unknown → Unknown<br />

end,<br />

/∗Gets the expected type <strong>of</strong> the list or map application<br />

expression arguments.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

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

234

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

Saved successfully!

Ooh no, something went wrong!