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

end,<br />

end<br />

/∗Checks for transformability <strong>of</strong> a optional inner<br />

pattern.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

oip: optional inner pattern<br />

Results:<br />

=======<br />

Bool: true if the optional inner pattern can<br />

be transformed, false otherwise<br />

∗/<br />

CheckOptInnerPattern :<br />

OptionalInnerPattern × FUNC × TRANS × ENV × TYPES →<br />

Bool × ENV × TYPES<br />

CheckOptInnerPattern(oip, func, trans, env, types) ≡<br />

case oip <strong>of</strong><br />

InnerPatternList(pl) →<br />

CheckPatternList(pl, func, trans, env, types),<br />

NoInnerPattern → (true, env, types)<br />

end,<br />

/∗Match a type expression against a let binding.<br />

∗/<br />

/∗<br />

Arguments:<br />

=======<br />

lb: the let binding<br />

te: the type expression<br />

Results:<br />

=======<br />

Bool: true if the let binding an the type expression<br />

can be matched, false otherwise<br />

∗/<br />

matchBindingTE : LetBinding × TypeExpr → Bool<br />

matchBindingTE(lb, te) ≡<br />

getLengthLetBinding(lb) ≥ getLengthTE(te),<br />

/∗Transforms a value definition list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

183

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

Saved successfully!

Ooh no, something went wrong!