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 end, or, Known(TypeLiteral(BOOL)), typings, func, trans, envMap( CheckValueExpr( ve, et, typings, func, trans, env, types)), typesMap( CheckValueExpr( ve, et, typings, func, trans, env, types))))) CheckListExpr : ListExpr × ExpType × TYPINGS × FUNC × TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckListExpr(le, et, typings, func, trans, env, types) ≡ case le of RangedListExpr(fve, sve) → CheckValueExprList( 〈fve, sve〉, 〈et, et〉, typings, func, trans, env, types), EnumeratedListExpr(ovel) → CheckOptValueExprList( ovel, et, typings, func, trans, env, types), ComprehendedListExpr(ve1, b, ve2, or) → mk_BOOL_ENV_TYPES( and( and( bool( CheckValueExpr( ve1, et, typings, func, trans, env, types)), bool( CheckValueExpr( ve2, et, typings, func, trans, envMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)), typesMap( CheckValueExpr( ve1, et, typings, func, trans, env, types))))), 332

D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 bool( CheckOptRestriction( or, Known(TypeLiteral(BOOL)), typings, func, trans, envMap( CheckValueExpr( ve2, et, typings, func, trans, envMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)), typesMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)))), typesMap( CheckValueExpr( ve2, et, typings, func, trans, envMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)), typesMap( CheckValueExpr( ve1, et, typings, func, trans, env, types))))))), envMap( CheckOptRestriction( or, Known(TypeLiteral(BOOL)), typings, func, trans, envMap( CheckValueExpr( ve2, et, typings, func, trans, envMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)), typesMap( CheckValueExpr( ve1, et, typings, func, trans, env, types)))), typesMap( CheckValueExpr( ve2, et, typings, func, trans, 333

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

end,<br />

or, Known(TypeLiteral(BOOL)), typings,<br />

func, trans,<br />

envMap(<br />

CheckValueExpr(<br />

ve, et, typings, func, trans,<br />

env, types)),<br />

typesMap(<br />

CheckValueExpr(<br />

ve, et, typings, func, trans,<br />

env, types)))))<br />

CheckListExpr :<br />

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

ENV × TYPES →<br />

BOOL_ENV_TYPES<br />

CheckListExpr(le, et, typings, func, trans, env, types) ≡<br />

case le <strong>of</strong><br />

RangedListExpr(fve, sve) →<br />

CheckValueExprList(<br />

〈fve, sve〉, 〈et, et〉, typings, func,<br />

trans, env, types),<br />

EnumeratedListExpr(ovel) →<br />

CheckOptValueExprList(<br />

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

ComprehendedListExpr(ve1, b, ve2, or) →<br />

mk_BOOL_ENV_TYPES(<br />

and(<br />

and(<br />

bool(<br />

CheckValueExpr(<br />

ve1, et, typings, func, trans,<br />

env, types)),<br />

bool(<br />

CheckValueExpr(<br />

ve2, et, typings, func, trans,<br />

envMap(<br />

CheckValueExpr(<br />

ve1, et, typings, func,<br />

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

typesMap(<br />

CheckValueExpr(<br />

ve1, et, typings, func,<br />

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

332

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

Saved successfully!

Ooh no, something went wrong!