Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
APPENDIX C. FORMAL SPECIFICATIONS OF TRANSFORMATIONS FunctionTypeExpr(arg, fa, res) → getNonTOIReturnsList( type_expr(res), trans) = 〈〉 end, → true end, → case et of Known(te) → case te of TypeName(tn) → ∼ (tn ∈ dom trans), TypeExprProduct(tel) → getNonTOIReturnsList(te, trans) = 〈〉, FunctionTypeExpr(arg, fa, res) → getNonTOIReturnsList( type_expr(res), trans) = 〈〉, → true end, Unknown → true end end, /∗Gets a list of types that are not of a type of interest from a type expression.∗/ /∗ Arguments: ======= te: the type expression Result: ======= TypeExpr_list: the list of types that are not of a type of interest ∗/ getNonTOIReturnsList : TypeExpr × TRANS → TypeExpr ∗ getNonTOIReturnsList(te, trans) ≡ case te of TypeLiteral(literal) → 〈te〉, TypeName(id) → if (id ∈ dom trans) then 〈〉 else 〈te〉 end, TypeExprProduct(tep) → getNonTOIProduct(tep, trans), TypeExprSet(tes) → 〈te〉, TypeExprList(tel) → 〈te〉, 242
C.1. FORMAL SPECIFICATION OF THE TRANSFORMER TypeExprMap(tem) → 〈te〉, FunctionTypeExpr(arg, fa, res) → getNonTOIReturnsList(type_expr(res), trans), BracketedTypeExpr(bte) → getNonTOIReturnsList(bte, trans) end, /∗Gets a list of types that are not of a type of interest from a type expression list.∗/ /∗ Arguments: ======= tel: the type expression list Result: ======= TypeExpr_list: the list of types that are not of a type of interest ∗/ getNonTOIProduct : TypeExpr ∗ × TRANS → TypeExpr ∗ getNonTOIProduct(tel, trans) ≡ if tel = 〈〉 then 〈〉 else getNonTOIReturnsList(hd tel, trans) getNonTOIProduct(tl tel, trans) end, /∗Gets the variables corresponding to the type expression.∗/ /∗ Arguments: ======= te: the type expression Result: ======= ValueExpr_list: the return values ∗/ getTOIReturnsList : TypeExpr × TRANS → ValueExpr ∗ getTOIReturnsList(te, trans) ≡ case te of TypeLiteral(literal) → 〈〉, TypeName(id) → if id ∈ dom trans 243
- Page 208 and 209: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 210 and 211: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 212 and 213: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 214 and 215: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 216 and 217: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 218 and 219: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 220 and 221: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 222 and 223: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 224 and 225: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 226 and 227: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 228 and 229: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 230 and 231: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 232 and 233: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 234 and 235: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 236 and 237: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 238 and 239: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 240 and 241: APPENDIX C. FORMAL SPECIFICATIONS O
- 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 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 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
C.1. FORMAL SPECIFICATION OF THE TRANSFORMER<br />
TypeExprMap(tem) → 〈te〉,<br />
FunctionTypeExpr(arg, fa, res) →<br />
getNonTOIReturnsList(type_expr(res), trans),<br />
BracketedTypeExpr(bte) →<br />
getNonTOIReturnsList(bte, trans)<br />
end,<br />
/∗Gets a list <strong>of</strong> types that are not <strong>of</strong> a type<br />
<strong>of</strong> interest from a type expression list.∗/<br />
/∗<br />
Arguments:<br />
=======<br />
tel: the type expression list<br />
Result:<br />
=======<br />
TypeExpr_list: the list <strong>of</strong> types that are not<br />
<strong>of</strong> a type <strong>of</strong> interest<br />
∗/<br />
getNonTOIProduct :<br />
TypeExpr ∗ × TRANS → TypeExpr ∗<br />
getNonTOIProduct(tel, trans) ≡<br />
if tel = 〈〉 then 〈〉<br />
else<br />
getNonTOIReturnsList(hd tel, trans) <br />
getNonTOIProduct(tl tel, trans)<br />
end,<br />
/∗Gets the variables corresponding to the type<br />
expression.∗/<br />
/∗<br />
Arguments:<br />
=======<br />
te: the type expression<br />
Result:<br />
=======<br />
ValueExpr_list: the return values<br />
∗/<br />
getTOIReturnsList :<br />
TypeExpr × TRANS → ValueExpr ∗<br />
getTOIReturnsList(te, trans) ≡<br />
case te <strong>of</strong><br />
TypeLiteral(literal) → 〈〉,<br />
TypeName(id) →<br />
if id ∈ dom trans<br />
243