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

ve: the value expression<br />

Result:<br />

=======<br />

Bool: true if the value expression is a generator,<br />

false otherwise<br />

∗/<br />

isTGen : ValueExpr × TRANS × FUNC → Bool<br />

isTGen(ve, trans, func) ≡<br />

case ve <strong>of</strong><br />

ApplicationExpr(vea, vel) →<br />

case vea <strong>of</strong><br />

Make_ValueOrVariableName(vn) →<br />

if id(vn) ∈ dom func<br />

then<br />

case type_expr(func(id(vn))) <strong>of</strong><br />

FunctionTypeExpr(arg, fa, res) →<br />

case type_expr(res) <strong>of</strong><br />

TypeName(tn) → tn ∈ dom trans,<br />

BracketedTypeExpr(bte) →<br />

case bte <strong>of</strong><br />

TypeName(tn) →<br />

tn ∈ dom trans,<br />

→ false<br />

end,<br />

→ false<br />

end,<br />

→ false<br />

end<br />

else false<br />

end,<br />

→ false<br />

end,<br />

→ false<br />

end,<br />

/∗Checks if a value expression list only consists<br />

<strong>of</strong> type names <strong>of</strong> the types <strong>of</strong> interest.∗/<br />

/∗<br />

Arguments:<br />

=======<br />

vel: the value expression list<br />

Result:<br />

=======<br />

Bool: true if the value expression only consists<br />

240

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

Saved successfully!

Ooh no, something went wrong!