Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS b: the binding Results: ===== Text: the text of the binding ∗/ getTextBinding : Binding → Text getTextBinding(b) ≡ case b of IdBinding(id) → getText(id) end, /∗**** Bindings end ****∗/ /∗**** TRANS ****∗/ /∗Checks if the id of the expected type is in the Idset.∗/ /∗ Arguments: ======= et: the expected type of the value expression idset: the set of ids, either the domain or range of TRANS Results: ===== Bool: true if the expected type is in the idset, false otherwise ∗/ checkTRANS : ExpType × Id-set → Bool checkTRANS(et, idset) ≡ case et of Known(te) → case te of TypeName(tn) → tn ∈ idset, → false end, Unknown → false end, /∗Checks if the ids of the expected type is in the Idset.∗/ /∗ Arguments: ======= 276
C.1. FORMAL SPECIFICATION OF THE TRANSFORMER et: the expected type of the value expression idset: the set of ids, either the domain or range of TRANS Results: ===== Bool: true if the expected type is in the idset, false otherwise ∗/ containsTRANSName : ExpType × TYPINGS × Id-set → Bool containsTRANSName(et, typings, idset) ≡ case et of Known(te) → case te of TypeLiteral(tn) → false, TypeName(tn) → tn ∈ idset ∨ (idset ∩ elems typings(tn)) = {}, TypeExprProduct(tel) → containsTRANSNameList(tel, typings, idset), TypeExprSet(tes) → case tes of FiniteSetTypeExpr(fte) → containsTRANSName( Known(fte), typings, idset), InfiniteSetTypeExpr(ite) → containsTRANSName( Known(ite), typings, idset) end, TypeExprList(tel) → case tel of FiniteListTypeExpr(fte) → containsTRANSName( Known(fte), typings, idset), InfiniteListTypeExpr(ite) → containsTRANSName( Known(ite), typings, idset) end, TypeExprMap(tem) → case tem of FiniteMapTypeExpr(tedom, terange) → containsTRANSName( Known(tedom), typings, idset) ∨ containsTRANSName( 277
- Page 242 and 243: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 244 and 245: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 246 and 247: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 248 and 249: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 250 and 251: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 252 and 253: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 254 and 255: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 256 and 257: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 258 and 259: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 260 and 261: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 262 and 263: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 264 and 265: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 266 and 267: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 268 and 269: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 270 and 271: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 272 and 273: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 274 and 275: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 276 and 277: APPENDIX C. FORMAL SPECIFICATIONS O
- 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 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 328 and 329: 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
APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS<br />
b: the binding<br />
Results:<br />
=====<br />
Text: the text <strong>of</strong> the binding<br />
∗/<br />
getTextBinding : Binding → Text<br />
getTextBinding(b) ≡<br />
case b <strong>of</strong><br />
IdBinding(id) → getText(id)<br />
end,<br />
/∗**** Bindings end ****∗/<br />
/∗**** TRANS ****∗/<br />
/∗Checks if the id <strong>of</strong> the expected type is in<br />
the Idset.∗/<br />
/∗<br />
Arguments:<br />
=======<br />
et: the expected type <strong>of</strong> the value expression<br />
idset: the set <strong>of</strong> ids, either the domain or range<br />
<strong>of</strong> TRANS<br />
Results:<br />
=====<br />
Bool: true if the expected type is in the idset,<br />
false otherwise<br />
∗/<br />
checkTRANS : ExpType × Id-set → Bool<br />
checkTRANS(et, idset) ≡<br />
case et <strong>of</strong><br />
Known(te) →<br />
case te <strong>of</strong><br />
TypeName(tn) → tn ∈ idset,<br />
→ false<br />
end,<br />
Unknown → false<br />
end,<br />
/∗Checks if the ids <strong>of</strong> the expected type is in<br />
the Idset.∗/<br />
/∗<br />
Arguments:<br />
=======<br />
276