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 end, else /∗The let definition is a list ot map application. ∗/ CheckValueExpr( value_expr(ld), Unknown, typings, func, trans, env, overrideTYPES( types, makeTYPES( binding(ld), Unknown, trans))) end, → CheckValueExpr( value_expr(ld), Unknown, typings, func, trans, env, overrideTYPES( types, makeTYPES( binding(ld), Unknown, trans))) end, → CheckValueExpr( value_expr(ld), Unknown, typings, func, trans, env, overrideTYPES( types, makeTYPES(binding(ld), Unknown, trans))) CheckLetBinding : LetBinding × TYPINGS × FUNC × TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckLetBinding(lb, typings, func, trans, env, types) ≡ case lb of MakeBinding(b) → mk_BOOL_ENV_TYPES(true, env, types), MakeRecordPattern(vn, pl) → CheckPatternList(pl, func, trans, env, types), MakeListPatternLet(lp) → CheckListPattern(lp, func, trans, env, types) end, 344

D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 CheckIfExpr : IfExpr × ExpType × TYPINGS × FUNC × TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckIfExpr(ie, et, typings, func, trans, env, types) ≡ mk_BOOL_ENV_TYPES( and( and( and( bool( CheckValueExpr( condition(ie), Known(TypeLiteral(BOOL)), typings, func, trans, env, types)), bool( CheckValueExpr( if_case(ie), et, typings, func, trans, envMap( CheckValueExpr( condition(ie), Known(TypeLiteral(BOOL)), typings, func, trans, env, types)), typesMap( CheckValueExpr( condition(ie), Known(TypeLiteral(BOOL)), typings, func, trans, env, types))))), bool( CheckElsif( elsif_list(ie), et, typings, func, trans, envMap( CheckValueExpr( condition(ie), Known(TypeLiteral(BOOL)), typings, func, trans, env, types )), typesMap( CheckValueExpr( if_case(ie), et, typings, func, trans, 345

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

CheckIfExpr :<br />

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

ENV × TYPES →<br />

BOOL_ENV_TYPES<br />

CheckIfExpr(ie, et, typings, func, trans, env, types) ≡<br />

mk_BOOL_ENV_TYPES(<br />

and(<br />

and(<br />

and(<br />

bool(<br />

CheckValueExpr(<br />

condition(ie),<br />

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

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

bool(<br />

CheckValueExpr(<br />

if_case(ie), et, typings, func,<br />

trans,<br />

envMap(<br />

CheckValueExpr(<br />

condition(ie),<br />

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

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

types)),<br />

typesMap(<br />

CheckValueExpr(<br />

condition(ie),<br />

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

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

types))))),<br />

bool(<br />

CheckElsif(<br />

elsif_list(ie), et, typings, func,<br />

trans,<br />

envMap(<br />

CheckValueExpr(<br />

condition(ie),<br />

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

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

)),<br />

typesMap(<br />

CheckValueExpr(<br />

if_case(ie), et, typings, func,<br />

trans,<br />

345

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

Saved successfully!

Ooh no, something went wrong!