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.

APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />

end,<br />

→ 〈Known(te)〉<br />

end,<br />

/∗Makes a list <strong>of</strong> expected types from a type expression<br />

list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

tel: the type expression list<br />

Results:<br />

=====<br />

ExpType_list: the list <strong>of</strong> expected types<br />

∗/<br />

typeExprListToExpTypeList :<br />

TypeExpr ∗ → ExpType ∗<br />

typeExprListToExpTypeList(tel) ≡<br />

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

else<br />

〈Known(hd tel)〉 <br />

typeExprListToExpTypeList(tl tel)<br />

end,<br />

/∗Returns the expected type <strong>of</strong> the components<br />

<strong>of</strong> a set expression.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

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

Results:<br />

=====<br />

ExpType: the expected type <strong>of</strong> the componenets<br />

<strong>of</strong> the set expression<br />

∗/<br />

getSetType : ExpType → ExpType<br />

getSetType(et) ≡<br />

case et <strong>of</strong><br />

Known(te) →<br />

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

TypeExprSet(tes) →<br />

case tes <strong>of</strong><br />

FiniteSetTypeExpr(fse) → Known(fse),<br />

InfiniteSetTypeExpr(ise) → Known(ise)<br />

end,<br />

232

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

Saved successfully!

Ooh no, something went wrong!