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.

D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1<br />

end,<br />

tl cbl, func, trans, types))<br />

CheckValueExpr :<br />

ValueExpr × ExpType × TYPINGS × FUNC × TRANS ×<br />

ENV × TYPES →<br />

BOOL_ENV_TYPES<br />

CheckValueExpr(<br />

ve, et, typings, func, trans, env, types) ≡<br />

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

Make_ValueLiteral(vl) →<br />

mk_BOOL_ENV_TYPES(<br />

true, updateENV(env, et, trans), types),<br />

Make_ValueOrVariableName(vn) →<br />

if<br />

not(<br />

isinBinding(<br />

IdBinding(id(vn)), domainTYPES(types)))<br />

then<br />

mk_BOOL_ENV_TYPES(<br />

true, updateENV(env, et, trans), types)<br />

else<br />

if<br />

checkTRANS(<br />

getMapValueTYPES(types, IdBinding(id(vn))),<br />

domainTRANS(trans))<br />

then<br />

/∗The value expression is <strong>of</strong> the type <strong>of</strong> interest.<br />

∗/<br />

mk_BOOL_ENV_TYPES(<br />

isinBinding(<br />

IdBinding(id(vn)), rangeENV(env)),<br />

updateENV(env, et, trans), types)<br />

else<br />

/∗The value expression is not <strong>of</strong> the type <strong>of</strong> interest.<br />

∗/<br />

mk_BOOL_ENV_TYPES(<br />

true, updateENV(env, et, trans), types)<br />

end<br />

end,<br />

Make_BasicExpr(be) →<br />

mk_BOOL_ENV_TYPES(true, env, types),<br />

ProductExpr(vel) →<br />

CheckValueExprList(<br />

325

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

Saved successfully!

Ooh no, something went wrong!