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

makeTYPESMap(tl bl, te)<br />

/∗Alters TYPES when a let def list is established.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

ldl: the let def list<br />

∗/<br />

alterTYPESMap : TYPES × LetDef ∗ → TYPES<br />

alterTYPESMap(types, ldl) ≡<br />

if ldl = 〈〉 then types<br />

else<br />

case binding(hd ldl) <strong>of</strong><br />

MakeBinding(b) →<br />

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

IdBinding(id) →<br />

alterTYPESMap(<br />

types † [ b ↦→ Unknown ], tl ldl),<br />

Make_ProductBinding(bl) →<br />

alterTYPESMap(<br />

alterTYPESMapList(<br />

types, binding_list(bl)), tl ldl)<br />

end<br />

end<br />

end,<br />

/∗Alters TYPES from a binding list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

bl: the binding list<br />

∗/<br />

alterTYPESMapList : TYPES × Binding ∗ → TYPES<br />

alterTYPESMapList(types, bl) ≡<br />

if bl = 〈〉 then types<br />

else<br />

case hd bl <strong>of</strong><br />

IdBinding(id) →<br />

alterTYPESMapList(<br />

types † [ hd bl ↦→ Unknown ], tl bl),<br />

Make_ProductBinding(bil) →<br />

297

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

Saved successfully!

Ooh no, something went wrong!