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

bl: the binding list<br />

tel: the corresponding type expression list<br />

∗/<br />

makeENVBindingList :<br />

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

makeENVBindingList(bl, tel, trans) ≡<br />

if bl = 〈〉 then ([ ])<br />

else<br />

makeENVBinding(hd bl, hd tel, trans) †<br />

makeENVBindingList(tl bl, tl tel, trans)<br />

end,<br />

/∗**** ENV end ****∗/<br />

/∗**** TYPES ****∗/<br />

/∗Updates TYPES according to the let binding.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

lb: the let binding<br />

et: the expected type <strong>of</strong> the let binding<br />

∗/<br />

makeTYPES : LetBinding × ExpType × TRANS → TYPES<br />

makeTYPES(lb, et, trans) ≡<br />

case lb <strong>of</strong><br />

MakeBinding(b) → makeTYPESBinding(b, et, trans),<br />

→ ([ ])<br />

end,<br />

/∗Makes the appropriate TYPES binding.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

b: the binding<br />

et: the corresponding expected type<br />

∗/<br />

makeTYPESBinding :<br />

Binding × ExpType × TRANS → TYPES<br />

makeTYPESBinding(b, et, trans) ≡<br />

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

295

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

Saved successfully!

Ooh no, something went wrong!