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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C.1. FORMAL SPECIFICATION OF THE TRANSFORMER<br />

ValueExpr_list: the resulting value expression<br />

list<br />

∗/<br />

pairListToList : ValueExprPair ∗ → ValueExpr ∗<br />

pairListToList(vepl) ≡<br />

if vepl = 〈〉 then 〈〉<br />

else<br />

〈first(hd vepl), second(hd vepl)〉 <br />

pairListToList(tl vepl)<br />

end,<br />

/∗Turns a value expression pair list <strong>into</strong> an expected<br />

type list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

vepl: the value expression pair list<br />

et: the expected type <strong>of</strong> the value expression<br />

pair<br />

Result:<br />

=======<br />

ValueExpr_list: the resulting value expression<br />

list<br />

∗/<br />

pairListToTypeList :<br />

ValueExprPair ∗ × MapType → ExpType ∗<br />

pairListToTypeList(vepl, et) ≡<br />

if vepl = 〈〉 then 〈〉<br />

else<br />

〈tedom(et), terange(et)〉 <br />

pairListToTypeList(tl vepl, et)<br />

end,<br />

/∗Returns the constituent value expression <strong>of</strong><br />

an optional restriction if any.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

or: the optional restriction<br />

Result:<br />

=======<br />

ValueExpr_list: the resulting value expression<br />

list<br />

∗/<br />

257

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

Saved successfully!

Ooh no, something went wrong!