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, ))) envMap( CheckValueExprList( 〈first(vep), second(vep)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types)), typesMap( CheckValueExprList( 〈first(vep), second(vep)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types)) CheckOptValueExprList : OptionalValueExprList × ExpType × TYPINGS × FUNC × TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckOptValueExprList( ovel, et, typings, func, trans, env, types) ≡ case ovel of ValueExprList(vel) → CheckValueExprList( vel, toExpTypeList(et, lengthVE(vel)), typings, func, trans, env, types), NoValueExprList → mk_BOOL_ENV_TYPES(true, env, types) end, CheckOptValueExprPairList : OptionalValueExprPairList × MapType × TYPINGS × FUNC × TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckOptValueExprPairList( ovel, et, typings, func, trans, env, types) ≡ case ovel of ValueExprPairList(vel) → CheckValueExprPairList( vel, et, typings, func, trans, env, types), NoValueExprPairList → mk_BOOL_ENV_TYPES(true, env, types) end, CheckValueExprPairList : ValueExprPair ∗ × MapType × TYPINGS × FUNC × 336

D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 TRANS × ENV × TYPES → BOOL_ENV_TYPES CheckValueExprPairList( vel, et, typings, func, trans, env, types) ≡ if vel = 〈〉 then mk_BOOL_ENV_TYPES(true, env, types) else if not( bool( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types))) then mk_BOOL_ENV_TYPES( bool( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types)), envMap( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types)), typesMap( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types))) else CheckValueExprPairList( tl vel, et, typings, func, trans, envMap( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types)), typesMap( CheckValueExprList( 〈first(hd vel), second(hd vel)〉, 〈tedom(et), terange(et)〉, typings, func, trans, env, types))) 337

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

TRANS × ENV × TYPES →<br />

BOOL_ENV_TYPES<br />

CheckValueExprPairList(<br />

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

if vel = 〈〉<br />

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

else<br />

if<br />

not(<br />

bool(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

then<br />

mk_BOOL_ENV_TYPES(<br />

bool(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

envMap(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

typesMap(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

else<br />

CheckValueExprPairList(<br />

tl vel, et, typings, func, trans,<br />

envMap(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

typesMap(<br />

CheckValueExprList(<br />

〈first(hd vel), second(hd vel)〉,<br />

〈tedom(et), terange(et)〉, typings,<br />

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

337

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

Saved successfully!

Ooh no, something went wrong!