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.

APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />

/∗Returns a list <strong>of</strong> type expressions from a type<br />

expression.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

te: the type expression<br />

Result:<br />

=======<br />

TypeExpr_list: the corresponding list<br />

∗/<br />

typeExprToList : TypeExpr → TypeExpr ∗<br />

typeExprToList(te) ≡<br />

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

TypeExprProduct(tep) → tep,<br />

→ 〈te〉<br />

end,<br />

/∗Returns the number <strong>of</strong> type expressions in a<br />

type expression.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

te: the type expression<br />

Results:<br />

=====<br />

Int: the number <strong>of</strong> type expressions<br />

∗/<br />

getLengthTE : TypeExpr → Int<br />

getLengthTE(te) ≡<br />

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

TypeExprProduct(tep) → getLengthTEL(tep),<br />

BracketedTypeExpr(bte) → getLengthTE(bte),<br />

→ 1<br />

end,<br />

/∗Returns the number <strong>of</strong> type expressions in a<br />

type expression list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

tel: the type expression list<br />

Results:<br />

=====<br />

222

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

Saved successfully!

Ooh no, something went wrong!