Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX D. SPECIFICATION OF TRANSFORMER IN RSL1 makeValueExprList( tl vel, tl etl, tl vl, trans, func) else 〈hd vl〉 makeValueExprList( tl vel, tl etl, tl vl, trans, func) end end, makeSequencingExpr : ValueExpr × TypeExpr × ExpType × TRANS × FUNC → ValueExpr makeSequencingExpr(ve, te, et, trans, func) ≡ if and( and( isGen(ve, et, trans, func), not(returnsNonTOI(ve, et, trans, func))), not(equalsType(te, et))) then BracketedExpr( SequencingExpr( ve, toValueExpr(getTOIReturnsList(te, trans)))) else ve end, /∗**** ValueExpr end ****∗/ /∗**** Generators and observers ****∗/ containsGen : ValueExpr ∗ × ExpType ∗ × TRANS × FUNC → Bool containsGen(vel, etl, trans, func) ≡ if vel = 〈〉 then false else if and( isGen(hd vel, hd etl, trans, func), not( returnsNonTOI(hd vel, hd etl, trans, func)) ) then true 416
D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 else containsGen(tl vel, tl etl, trans, func) end end, isGen : ValueExpr × ExpType × TRANS × FUNC → Bool isGen(ve, et, trans, func) ≡ case ve of ApplicationExpr(vea, vel) → case vea of Make_ValueOrVariableName(vn) → not( lengthAccess( write_list( getMapValueFUNC(func, id(vn)))) = 0), → false end, → case et of Known(te) → case te of TypeName(tn) → isinId(tn, domainTRANS(trans)), TypeExprProduct(tel) → isGenProduct(ve, tel, trans, func), FunctionTypeExpr(arg, fa, res) → isGen( ve, Known(type_expr(res)), trans, func ), BracketedTypeExpr(bte) → isGen(ve, Known(bte), trans, func), → false end, Unknown → false end end, isGenProduct : ValueExpr × TypeExpr ∗ × TRANS × FUNC → Bool isGenProduct(ve, tel, trans, func) ≡ if tel = 〈〉 then false else if isGen(ve, Known(hd tel), trans, func) then true else isGenProduct(ve, tl tel, trans, func) end 417
- Page 382 and 383: APPENDIX D. SPECIFICATION OF TRANSF
- Page 384 and 385: APPENDIX D. SPECIFICATION OF TRANSF
- Page 386 and 387: APPENDIX D. SPECIFICATION OF TRANSF
- Page 388 and 389: APPENDIX D. SPECIFICATION OF TRANSF
- Page 390 and 391: APPENDIX D. SPECIFICATION OF TRANSF
- Page 392 and 393: APPENDIX D. SPECIFICATION OF TRANSF
- Page 394 and 395: APPENDIX D. SPECIFICATION OF TRANSF
- Page 396 and 397: APPENDIX D. SPECIFICATION OF TRANSF
- Page 398 and 399: APPENDIX D. SPECIFICATION OF TRANSF
- Page 400 and 401: APPENDIX D. SPECIFICATION OF TRANSF
- Page 402 and 403: APPENDIX D. SPECIFICATION OF TRANSF
- Page 404 and 405: APPENDIX D. SPECIFICATION OF TRANSF
- Page 406 and 407: APPENDIX D. SPECIFICATION OF TRANSF
- Page 408 and 409: APPENDIX D. SPECIFICATION OF TRANSF
- Page 410 and 411: APPENDIX D. SPECIFICATION OF TRANSF
- Page 412 and 413: APPENDIX D. SPECIFICATION OF TRANSF
- Page 414 and 415: APPENDIX D. SPECIFICATION OF TRANSF
- Page 416 and 417: APPENDIX D. SPECIFICATION OF TRANSF
- Page 418 and 419: APPENDIX D. SPECIFICATION OF TRANSF
- Page 420 and 421: APPENDIX D. SPECIFICATION OF TRANSF
- Page 422 and 423: APPENDIX D. SPECIFICATION OF TRANSF
- Page 424 and 425: APPENDIX D. SPECIFICATION OF TRANSF
- Page 426 and 427: APPENDIX D. SPECIFICATION OF TRANSF
- Page 428 and 429: APPENDIX D. SPECIFICATION OF TRANSF
- Page 430 and 431: APPENDIX D. SPECIFICATION OF TRANSF
- Page 434 and 435: APPENDIX D. SPECIFICATION OF TRANSF
- Page 436 and 437: APPENDIX D. SPECIFICATION OF TRANSF
- Page 438 and 439: APPENDIX D. SPECIFICATION OF TRANSF
- Page 440 and 441: APPENDIX D. SPECIFICATION OF TRANSF
- Page 442 and 443: APPENDIX D. SPECIFICATION OF TRANSF
- Page 444 and 445: APPENDIX D. SPECIFICATION OF TRANSF
- Page 446 and 447: APPENDIX D. SPECIFICATION OF TRANSF
- Page 448 and 449: APPENDIX D. SPECIFICATION OF TRANSF
- Page 450 and 451: APPENDIX D. SPECIFICATION OF TRANSF
- Page 452 and 453: APPENDIX D. SPECIFICATION OF TRANSF
- Page 454 and 455: APPENDIX D. SPECIFICATION OF TRANSF
- Page 456 and 457: APPENDIX D. SPECIFICATION OF TRANSF
- Page 458 and 459: APPENDIX D. SPECIFICATION OF TRANSF
- Page 460 and 461: APPENDIX D. SPECIFICATION OF TRANSF
- Page 462 and 463: APPENDIX D. SPECIFICATION OF TRANSF
- Page 464 and 465: APPENDIX D. SPECIFICATION OF TRANSF
- Page 466 and 467: APPENDIX D. SPECIFICATION OF TRANSF
- Page 468 and 469: APPENDIX D. SPECIFICATION OF TRANSF
- Page 470 and 471: APPENDIX D. SPECIFICATION OF TRANSF
- Page 472 and 473: APPENDIX D. SPECIFICATION OF TRANSF
- Page 474 and 475: APPENDIX D. SPECIFICATION OF TRANSF
- Page 476 and 477: APPENDIX D. SPECIFICATION OF TRANSF
- Page 478 and 479: APPENDIX D. SPECIFICATION OF TRANSF
- Page 480 and 481: APPENDIX D. SPECIFICATION OF TRANSF
D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1<br />
else containsGen(tl vel, tl etl, trans, func)<br />
end<br />
end,<br />
isGen : ValueExpr × ExpType × TRANS × FUNC → Bool<br />
isGen(ve, et, trans, func) ≡<br />
case ve <strong>of</strong><br />
ApplicationExpr(vea, vel) →<br />
case vea <strong>of</strong><br />
Make_ValueOrVariableName(vn) →<br />
not(<br />
lengthAccess(<br />
write_list(<br />
getMapValueFUNC(func, id(vn)))) = 0),<br />
→ false<br />
end,<br />
→<br />
case et <strong>of</strong><br />
Known(te) →<br />
case te <strong>of</strong><br />
TypeName(tn) →<br />
isinId(tn, domainTRANS(trans)),<br />
TypeExprProduct(tel) →<br />
isGenProduct(ve, tel, trans, func),<br />
FunctionTypeExpr(arg, fa, res) →<br />
isGen(<br />
ve, Known(type_expr(res)), trans, func<br />
),<br />
BracketedTypeExpr(bte) →<br />
isGen(ve, Known(bte), trans, func),<br />
→ false<br />
end,<br />
Unknown → false<br />
end<br />
end,<br />
isGenProduct :<br />
ValueExpr × TypeExpr ∗ × TRANS × FUNC → Bool<br />
isGenProduct(ve, tel, trans, func) ≡<br />
if tel = 〈〉 then false<br />
else<br />
if isGen(ve, Known(hd tel), trans, func) then true<br />
else isGenProduct(ve, tl tel, trans, func)<br />
end<br />
417