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 DL_not_transformable → Class_not_transformable end, → Class_not_transformable end, TRDeclList : Decl ∗ × TYPINGS × FUNC × TRANS × Decl ∗ → DLResult TRDeclList(dl, typings, func, trans, dlres) ≡ if dl = 〈〉 then DL_transformable(dlres) else case TRDecl(hd dl, typings, func, trans) of Decl_transformable(decl) → TRDeclList( tl dl, typings, func, trans, dlres 〈decl〉), Decl_not_transformable → DL_not_transformable end end, TRDecl : Decl × TYPINGS × FUNC × TRANS → DeclResult TRDecl(d, typings, func, trans) ≡ case d of TypeDecl(tdl) → case TRTypeDecl(tdl, typings, func, trans) of Transformable(decl) → Decl_transformable(decl), Not_transformable → Decl_not_transformable end, ValueDecl(vd) → case TRValueDecl(vd, typings, func, trans) of Transformable(decl) → Decl_transformable(decl), Not_transformable → Decl_not_transformable end, → Decl_not_transformable end, makeVariables : Decl ∗ × TRANS → Decl ∗ makeVariables(decl, trans) ≡ if decl = 〈〉 then 〈VariableDecl(makeVariableDeclList(trans))〉 else 312
D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1 case hd decl of TypeDecl(tdl) → 〈hd decl〉 makeVariables(tl decl, trans), ValueDecl(vdl) → 〈VariableDecl(makeVariableDeclList(trans))〉 decl end end, makeVariableDeclList : TRANS → VariableDef ∗ makeVariableDeclList(trans) ≡ if getTRANSMapEntranceList(trans) = 〈〉 then 〈〉 else 〈makeVariableDef( first(getHeadTRANS(trans)), trans)〉 makeVariableDeclList( removeTRANS(trans, first(getHeadTRANS(trans)))) end, makeVariableDef : Id × TRANS → VariableDef makeVariableDef(typename, trans) ≡ SingleVariableDef( getMapValueTRANS(trans, typename), TypeName(typename), NoInitialisation), TRTypeDecl : TypeDef ∗ × TYPINGS × FUNC × TRANS → DResult TRTypeDecl(tdl, typings, func, trans) ≡ if CheckTypeDefList(tdl, typings, func, trans) then Transformable(TypeDecl(tdl)) else Not_transformable end, CheckTypeDefList : TypeDef ∗ × TYPINGS × FUNC × TRANS → Bool CheckTypeDefList(tdl, typings, func, trans) ≡ if tdl = 〈〉 then true else and( CheckTypeDef(hd tdl, typings, func, trans), CheckTypeDefList(tl tdl, typings, func, trans)) end, CheckTypeDef : 313
- Page 278 and 279: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 280 and 281: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 282 and 283: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 284 and 285: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 286 and 287: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 288 and 289: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 290 and 291: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 292 and 293: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 294 and 295: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 296 and 297: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 298 and 299: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 300 and 301: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 302 and 303: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 304 and 305: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 306 and 307: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 308 and 309: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 310 and 311: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 312 and 313: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 314 and 315: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 316 and 317: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 318 and 319: APPENDIX D. SPECIFICATION OF TRANSF
- Page 320 and 321: APPENDIX D. SPECIFICATION OF TRANSF
- Page 322 and 323: APPENDIX D. SPECIFICATION OF TRANSF
- Page 324 and 325: APPENDIX D. SPECIFICATION OF TRANSF
- Page 326 and 327: APPENDIX D. SPECIFICATION OF TRANSF
- Page 330 and 331: APPENDIX D. SPECIFICATION OF TRANSF
- Page 332 and 333: APPENDIX D. SPECIFICATION OF TRANSF
- Page 334 and 335: APPENDIX D. SPECIFICATION OF TRANSF
- Page 336 and 337: APPENDIX D. SPECIFICATION OF TRANSF
- Page 338 and 339: APPENDIX D. SPECIFICATION OF TRANSF
- Page 340 and 341: APPENDIX D. SPECIFICATION OF TRANSF
- Page 342 and 343: APPENDIX D. SPECIFICATION OF TRANSF
- Page 344 and 345: APPENDIX D. SPECIFICATION OF TRANSF
- Page 346 and 347: APPENDIX D. SPECIFICATION OF TRANSF
- Page 348 and 349: APPENDIX D. SPECIFICATION OF TRANSF
- Page 350 and 351: APPENDIX D. SPECIFICATION OF TRANSF
- Page 352 and 353: APPENDIX D. SPECIFICATION OF TRANSF
- Page 354 and 355: APPENDIX D. SPECIFICATION OF TRANSF
- Page 356 and 357: APPENDIX D. SPECIFICATION OF TRANSF
- Page 358 and 359: APPENDIX D. SPECIFICATION OF TRANSF
- Page 360 and 361: APPENDIX D. SPECIFICATION OF TRANSF
- Page 362 and 363: APPENDIX D. SPECIFICATION OF TRANSF
- Page 364 and 365: APPENDIX D. SPECIFICATION OF TRANSF
- Page 366 and 367: APPENDIX D. SPECIFICATION OF TRANSF
- Page 368 and 369: APPENDIX D. SPECIFICATION OF TRANSF
- Page 370 and 371: APPENDIX D. SPECIFICATION OF TRANSF
- Page 372 and 373: APPENDIX D. SPECIFICATION OF TRANSF
- Page 374 and 375: APPENDIX D. SPECIFICATION OF TRANSF
- Page 376 and 377: APPENDIX D. SPECIFICATION OF TRANSF
D.2. FORMAL SPECIFICATION OF THE TRANSFORMER IN RSL1<br />
case hd decl <strong>of</strong><br />
TypeDecl(tdl) →<br />
〈hd decl〉 makeVariables(tl decl, trans),<br />
ValueDecl(vdl) →<br />
〈VariableDecl(makeVariableDeclList(trans))〉 <br />
decl<br />
end<br />
end,<br />
makeVariableDeclList : TRANS → VariableDef ∗<br />
makeVariableDeclList(trans) ≡<br />
if getTRANSMapEntranceList(trans) = 〈〉 then 〈〉<br />
else<br />
〈makeVariableDef(<br />
first(getHeadTRANS(trans)), trans)〉 <br />
makeVariableDeclList(<br />
removeTRANS(trans, first(getHeadTRANS(trans))))<br />
end,<br />
makeVariableDef : Id × TRANS → VariableDef<br />
makeVariableDef(typename, trans) ≡<br />
SingleVariableDef(<br />
getMapValueTRANS(trans, typename),<br />
TypeName(typename), NoInitialisation),<br />
TRTypeDecl :<br />
TypeDef ∗ × TYPINGS × FUNC × TRANS → DResult<br />
TRTypeDecl(tdl, typings, func, trans) ≡<br />
if CheckTypeDefList(tdl, typings, func, trans)<br />
then Transformable(TypeDecl(tdl))<br />
else Not_transformable<br />
end,<br />
CheckTypeDefList :<br />
TypeDef ∗ × TYPINGS × FUNC × TRANS → Bool<br />
CheckTypeDefList(tdl, typings, func, trans) ≡<br />
if tdl = 〈〉 then true<br />
else<br />
and(<br />
CheckTypeDef(hd tdl, typings, func, trans),<br />
CheckTypeDefList(tl tdl, typings, func, trans))<br />
end,<br />
CheckTypeDef :<br />
313