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

end<br />

end,<br />

trans, env, types, prlet),<br />

(b1, ffpl ′′ , env ′′ , types ′′ , prlet ′′ ) =<br />

TRFFPProduct(<br />

mk_FormalFunctionParameter(<br />

tl binding_list(ffpl)), tl tel,<br />

trans, env ′ , types ′ , prlet ′ )<br />

in<br />

(b ∧ b1,<br />

mk_FormalFunctionParameter(<br />

binding_list(ffpl ′ ) <br />

binding_list(ffpl ′′ )), env ′′ , types ′′ ,<br />

prlet ′′ )<br />

end<br />

/∗Checks if it is necessary to establish a let<br />

expression.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

te: the type <strong>of</strong> the binding<br />

b: the actual binding<br />

prlet: the original value <strong>of</strong> the LetDef_list<br />

Result:<br />

=======<br />

LetDef_list: the resulting value <strong>of</strong> the LetDef_<br />

list<br />

∗/<br />

makeProductLet :<br />

TypeExpr × Binding × LetDef ∗ × TRANS →<br />

LetDef ∗<br />

makeProductLet(te, b, prlet, trans) ≡<br />

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

TypeName(tn) →<br />

case b <strong>of</strong><br />

Make_ProductBinding(pb) →<br />

prlet <br />

〈mk_LetDef(<br />

MakeBinding(b),<br />

Make_ValueOrVariableName(<br />

mk_ValueOrVariableName(trans(tn))))〉,<br />

→ prlet<br />

end<br />

193

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

Saved successfully!

Ooh no, something went wrong!