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.

C.1. FORMAL SPECIFICATION OF THE TRANSFORMER<br />

Arguments:<br />

=======<br />

or: the optional restriction<br />

et: the expected type <strong>of</strong> the restriction<br />

Results:<br />

=====<br />

Bool: true if the optional restriction is transformable,<br />

false otherwise<br />

∗/<br />

CheckOptRestriction :<br />

OptionalRestriction × ExpType × TYPINGS × FUNC ×<br />

TRANS × ENV × TYPES →<br />

Bool × ENV × TYPES<br />

CheckOptRestriction(<br />

or, et, typings, func, trans, env, types) ≡<br />

case or <strong>of</strong><br />

Restriction(ve) →<br />

CheckValueExpr(<br />

ve, et, typings, func, trans, env, types),<br />

NoRestriction → (true, env, types)<br />

end,<br />

/∗Checks for transformability <strong>of</strong> an application<br />

expression.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

ve: the value expression<br />

vel: the arguments <strong>of</strong> the application expression<br />

et: the expected type <strong>of</strong> the application expression<br />

Results:<br />

=====<br />

Bool: true if the application expression is transformable,<br />

false otherwise<br />

∗/<br />

CheckApplicationExpr :<br />

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

FUNC × TRANS × ENV × TYPES →<br />

Bool × ENV × TYPES<br />

CheckApplicationExpr(<br />

ve, vel, et, typings, func, trans, env, types) ≡<br />

case ve <strong>of</strong><br />

Make_ValueOrVariableName(vn) →<br />

171

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

Saved successfully!

Ooh no, something went wrong!