Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
CHAPTER 12. POSSIBLE EXTENSIONS OF THE TRANSFORMER 12.1.4 Renaming Class Expressions When transforming a renaming class expression the names of the defined items in the list are transformed into their counterparts in the imperative specification and then the class expression is transformed. 12.1.5 Infinite Map Type Expressions Infinite map type expressions are of the form: type_expr1 ∼ →m type_expr2 An infinite map type expression is transformed by transforming the constituent type expressions. 12.1.6 Single Typings of Higher Order Functions The idea behind transforming single typings of higher order functions is similar to the idea behind transforming single typings of normal functions, which is explained in Section 6.4.1. Examples of transformations of single typings of higher order functions are given in Table 12.1. Applicative single typing ✄ Imperative single typing T → (U → V) ✄ Unit → read t (U → V) (U → V) → T ✄ (U → V) → write t Unit (T → U) → V ✄ (Unit → read t U) → V (U → T) → V ✄ (U → write t Unit) → V U → (T → V) ✄ U → (Unit → read t V) U → (V → T) ✄ U → (V → write t Unit) Table 12.1: Transformation of single typings of higher order functions. T is a type of interest with associated variable t, U and V are not types of interest. 12.1.7 Disambiguation Expressions A disambiguation expression has the following form: value_expr : type_expr A disambiguation expression can be transformed by transforming the constituent value and type expressions. 124
12.1. TRANSFORMATIONS OF CONSTRUCTS OUTSIDE RSLA 12.1.8 Axioms Axioms can be transformed almost as value definitions since value definitions are a short way of writing axioms. The extension should therefore be almost straight forward. It is necessary to consider quantified expressions though. 12.1.9 Quantified Expressions Quantified expressions are of the form: quantifier typing1, ..., typingn • value_expr A quantified expression is transformed by transforming the constituent value expression. If the typings contain types of interest the corresponding variables must be assigned the values of the value names in the typing. Due to side effects an equivalence expression must be established, for example: ∃ x : T • obs(x) ✄ ∃ x : T • ( t := x ; obs() ≡ t := x ; true ) where T is a type of interest and t is the corresponding variable. If the quantified expression contains universal quantification over a type of interest this is replaced by the always combinator ✷, see Example 12.1. Example 12.1 – Transformation of a quantified expression type T = Int value f : T → Int axiom ∀ x : T • f(x) > x ✄ type T = Int variable t : T value f : Unit → read t Int axiom ✷ f() > t 125
- Page 90 and 91: CHAPTER 8. SPECIFICATIONS RSL speci
- Page 92 and 93: CHAPTER 8. SPECIFICATIONS The FUNC
- Page 94 and 95: CHAPTER 8. SPECIFICATIONS out, that
- Page 96 and 97: CHAPTER 8. SPECIFICATIONS construct
- Page 98 and 99: CHAPTER 8. SPECIFICATIONS 8.4.1 Mor
- Page 100 and 101: CHAPTER 8. SPECIFICATIONS PRECOND_T
- Page 102 and 103: CHAPTER 8. SPECIFICATIONS if length
- Page 104 and 105: CHAPTER 8. SPECIFICATIONS subtypes.
- Page 106 and 107: CHAPTER 8. SPECIFICATIONS 8.5.2 Cha
- Page 108 and 109: CHAPTER 8. SPECIFICATIONS axiom [ m
- Page 110 and 111: CHAPTER 8. SPECIFICATIONS Specifica
- Page 112 and 113: CHAPTER 8. SPECIFICATIONS the lack
- Page 114 and 115: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 116 and 117: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 118 and 119: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 120 and 121: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 122 and 123: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 124 and 125: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 126 and 127: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 128 and 129: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 130 and 131: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 132 and 133: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 134 and 135: CHAPTER 10. EXAMPLES OF TRANSFORMAT
- Page 136 and 137: CHAPTER 11. TEST 11.1.1 Lexer and P
- Page 138 and 139: CHAPTER 11. TEST An overview of the
- Page 142 and 143: CHAPTER 12. POSSIBLE EXTENSIONS OF
- Page 144 and 145: CHAPTER 12. POSSIBLE EXTENSIONS OF
- Page 146 and 147: CHAPTER 13. CONCLUSION RSL AST and
- Page 148 and 149: CHAPTER 13. CONCLUSION 132
- Page 150 and 151: BIBLIOGRAPHY [ST02] Donald Sannello
- Page 152 and 153: APPENDIX A. USING AND EXTENDING THE
- Page 154 and 155: APPENDIX A. USING AND EXTENDING THE
- Page 156 and 157: APPENDIX B. CONTENTS OF CD-ROM 140
- Page 158 and 159: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 160 and 161: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 162 and 163: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 164 and 165: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 166 and 167: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 168 and 169: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 170 and 171: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 172 and 173: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 174 and 175: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 176 and 177: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 178 and 179: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 180 and 181: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 182 and 183: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 184 and 185: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 186 and 187: APPENDIX C. FORMAL SPECIFICATIONS O
- Page 188 and 189: APPENDIX C. FORMAL SPECIFICATIONS O
CHAPTER 12. POSSIBLE EXTENSIONS OF THE TRANSFORMER<br />
12.1.4 Renaming Class Expressions<br />
When transforming a renaming class expression the names <strong>of</strong> the defined<br />
items in the list are transformed <strong>into</strong> their counterparts in the imperative<br />
specification and then the class expression is transformed.<br />
12.1.5 Infinite Map Type Expressions<br />
Infinite map type expressions are <strong>of</strong> the form:<br />
type_expr1 ∼ →m type_expr2<br />
An infinite map type expression is transformed by transforming the constituent<br />
type expressions.<br />
12.1.6 Single Typings <strong>of</strong> Higher Order Functions<br />
The idea behind transforming single typings <strong>of</strong> higher order functions is<br />
similar to the idea behind transforming single typings <strong>of</strong> normal functions,<br />
which is explained in Section 6.4.1. Examples <strong>of</strong> transformations <strong>of</strong> single<br />
typings <strong>of</strong> higher order functions are given in Table 12.1.<br />
<strong>Applicative</strong> single typing ✄ <strong>Imperative</strong> single typing<br />
T → (U → V) ✄ Unit → read t (U → V)<br />
(U → V) → T ✄ (U → V) → write t Unit<br />
(T → U) → V ✄ (Unit → read t U) → V<br />
(U → T) → V ✄ (U → write t Unit) → V<br />
U → (T → V) ✄ U → (Unit → read t V)<br />
U → (V → T) ✄ U → (V → write t Unit)<br />
Table 12.1: <strong>Transformation</strong> <strong>of</strong> single typings <strong>of</strong> higher order functions. T is a<br />
type <strong>of</strong> interest with associated variable t, U and V are not types <strong>of</strong> interest.<br />
12.1.7 Disambiguation Expressions<br />
A disambiguation expression has the following form:<br />
value_expr : type_expr<br />
A disambiguation expression can be transformed by transforming the<br />
constituent value and type expressions.<br />
124