Transformation of Applicative Specifications into Imperative ...

Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...

26.09.2013 Views

APPENDIX D. SPECIFICATION OF TRANSFORMER IN RSL1 vel, expTypeToExpTypeList( removeBrackets(et), lengthVE(vel)), typings, func, trans, env, types), Make_SetExpr(setExpr) → if containsTRANSName( getSetType(et), typings, domainTRANS(trans)) then mk_BOOL_ENV_TYPES(false, env, types) else CheckSetExpr( setExpr, getSetType(et), typings, func, trans, env, types) end, Make_ListExpr(listExpr) → if containsTRANSName( getListType(et), typings, domainTRANS(trans)) then mk_BOOL_ENV_TYPES(false, env, types) else CheckListExpr( listExpr, getListType(et), typings, func, trans, env, types) end, Make_MapExpr(mapExpr) → if or(containsTRANSName( tedom(getMapType(et)), typings, domainTRANS(trans)), containsTRANSName( terange(getMapType(et)), typings, domainTRANS(trans))) then mk_BOOL_ENV_TYPES(false, env, types) else CheckMapExpr( mapExpr, getMapType(et), typings, func, trans, env, types) end, ApplicationExpr(ave, vl) → CheckApplicationExpr( ave, vl, et, typings, func, trans, env, types), BracketedExpr(bve) → mk_BOOL_ENV_TYPES( 326

D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 bool( CheckValueExpr( bve, Unknown, typings, func, trans, env, types)), updateENV( envMap( CheckValueExpr( bve, Unknown, typings, func, trans, env, types)), et, trans), typesMap( CheckValueExpr( bve, Unknown, typings, func, trans, env, types))), ValueInfixExpr(first, op, second) → mk_BOOL_ENV_TYPES( bool( CheckValueExprList( 〈first, second〉, 〈Unknown, Unknown〉, typings, func, trans, env, types)), updateENV( envMap( CheckValueExprList( 〈first, second〉, 〈Unknown, Unknown〉, typings, func, trans, env, types)), et, trans), typesMap( CheckValueExprList( 〈first, second〉, 〈Unknown, Unknown〉, typings, func, trans, env, types))), ValuePrefixExpr(op, operand) → mk_BOOL_ENV_TYPES( bool( CheckValueExpr( operand, Unknown, typings, func, trans, env, types)), updateENV( envMap( CheckValueExpr( operand, Unknown, typings, func, trans, env, types)), et, trans), typesMap( CheckValueExpr( 327

APPENDIX D. SPECIFICATION OF TRANSFORMER IN RSL1<br />

vel,<br />

expTypeToExpTypeList(<br />

removeBrackets(et), lengthVE(vel)),<br />

typings, func, trans, env, types),<br />

Make_SetExpr(setExpr) →<br />

if<br />

containsTRANSName(<br />

getSetType(et), typings, domainTRANS(trans))<br />

then mk_BOOL_ENV_TYPES(false, env, types)<br />

else<br />

CheckSetExpr(<br />

setExpr, getSetType(et), typings, func,<br />

trans, env, types)<br />

end,<br />

Make_ListExpr(listExpr) →<br />

if<br />

containsTRANSName(<br />

getListType(et), typings,<br />

domainTRANS(trans))<br />

then mk_BOOL_ENV_TYPES(false, env, types)<br />

else<br />

CheckListExpr(<br />

listExpr, getListType(et), typings, func,<br />

trans, env, types)<br />

end,<br />

Make_MapExpr(mapExpr) →<br />

if<br />

or(containsTRANSName(<br />

tedom(getMapType(et)), typings,<br />

domainTRANS(trans)),<br />

containsTRANSName(<br />

terange(getMapType(et)), typings,<br />

domainTRANS(trans)))<br />

then mk_BOOL_ENV_TYPES(false, env, types)<br />

else<br />

CheckMapExpr(<br />

mapExpr, getMapType(et), typings, func,<br />

trans, env, types)<br />

end,<br />

ApplicationExpr(ave, vl) →<br />

CheckApplicationExpr(<br />

ave, vl, et, typings, func, trans, env, types),<br />

BracketedExpr(bve) →<br />

mk_BOOL_ENV_TYPES(<br />

326

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

Saved successfully!

Ooh no, something went wrong!