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 id(vn) ∈ dom func<br />

then<br />

/∗The let definition is a function application.<br />

∗/<br />

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

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

let<br />

(b, env ′ , types ′ ) =<br />

CheckValueExpr(<br />

value_expr(ld),<br />

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

typings, func, trans, env,<br />

types),<br />

b1 =<br />

matchBindingTE(<br />

binding(ld), type_expr(res)),<br />

/∗ENV must be updated.∗/<br />

env ′′ =<br />

makeENV(<br />

binding(ld),<br />

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

types ′′ =<br />

makeTYPES(<br />

binding(ld),<br />

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

)<br />

in<br />

(b ∧ b1, env ′ † env ′′ ,<br />

types ′ † types ′′ )<br />

end<br />

end<br />

else<br />

/∗The let definition is a list ot map application.<br />

∗/<br />

CheckValueExpr(<br />

value_expr(ld), Unknown, typings,<br />

func, trans, env,<br />

types †<br />

makeTYPES(<br />

binding(ld), Unknown, trans))<br />

end,<br />

→<br />

CheckValueExpr(<br />

value_expr(ld), Unknown, typings,<br />

176

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

Saved successfully!

Ooh no, something went wrong!