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

/∗Transforms a list <strong>of</strong> value declarations.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

vdl: the list <strong>of</strong> value declarations<br />

Results:<br />

=====<br />

DResult: the result<br />

∗/<br />

TRValueDecl :<br />

ValueDef ∗ × TYPINGS × FUNC × TRANS → DResult<br />

TRValueDecl(vdl, typings, func, trans) ≡<br />

if CheckValueDefList(vdl, typings, func, trans)<br />

then<br />

/∗The value declaration list is transformable<br />

and is transformed.∗/<br />

Transformable(<br />

ValueDecl(TRValueDefList(vdl, func, trans)))<br />

else<br />

/∗The value declaration list is not transformable.<br />

∗/<br />

Not_transformable<br />

end,<br />

/∗Checks for transformability <strong>of</strong> a value definfition<br />

list.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

vdl: the list <strong>of</strong> value definitions<br />

Results:<br />

=====<br />

Bool: true if the list is transformable, false<br />

otherwise<br />

∗/<br />

CheckValueDefList :<br />

ValueDef ∗ × TYPINGS × FUNC × TRANS → Bool<br />

CheckValueDefList(vdl, typings, func, trans) ≡<br />

if vdl = 〈〉 then true<br />

else<br />

CheckValueDef(hd vdl, typings, func, trans) ∧<br />

CheckValueDefList(tl vdl, typings, func, trans)<br />

end,<br />

152

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

Saved successfully!

Ooh no, something went wrong!