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

in<br />

(RecordPattern(vn, pl ′ ), types ′ )<br />

end,<br />

MakeListPattern(lp) →<br />

let<br />

(lp ′ , types ′ ) =<br />

TRListPattern(lp, func, trans, types)<br />

in<br />

(MakeListPattern(lp ′ ), types ′ )<br />

end<br />

end,<br />

/∗Transforms a pattern list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

pl: the pattern list<br />

Results:<br />

=======<br />

Pattern_list: the imperative version <strong>of</strong> the pattern<br />

list<br />

∗/<br />

TRPatternList :<br />

Pattern ∗ × FUNC × TRANS × TYPES →<br />

Pattern ∗ × TYPES<br />

TRPatternList(pl, func, trans, types) ≡<br />

if pl = 〈〉 then (〈〉, types)<br />

else<br />

let<br />

(p1, types1) =<br />

TRPattern(hd pl, func, trans, types),<br />

(pl ′ , types2) =<br />

TRPatternList(tl pl, func, trans, types1)<br />

in<br />

(〈p1〉 pl ′ , types2)<br />

end<br />

end,<br />

/∗Transforms a list pattern.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

lp: the list pattern<br />

Results:<br />

219

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

Saved successfully!

Ooh no, something went wrong!