Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
CHAPTER 9. IMPLEMENTATION OF THE TRANSFORMER • Set expressions (ranged, enumerated, comprehended). • List expressions (ranged, enumerated, comprehended). • Map expressions (enumerated, comprehended). • Application expressions (function, list, map). • Bracketed expressions. • Value infix expressions. • Value prefix expressions. • Let expressions. • If expressions. • Case expressions. • Value literal patterns. • Name patterns. • Wildcard patterns. • Product patterns. • Record patterns. • List patterns. 9.8.5 Pretty Printing The resulting specification of a transformation is not pretty printed. No focus is put on that aspect as the RSL pretty printer can be used for that purpose. 108
Chapter 10 Examples of Transformations In order to give an idea of how the transformer works a couple of examples of transformations are given in this chapter. The first example just shows an example of applying the transformer to an applicative specification. The second example shows the development process from initial specification to imperative specification emphasizing the use of the transformer in the development process. 10.1 The Stack The stack example given in Chapter 2 is transformed by hand. In order to show that the automatic transformation done by the transformer follows the principles given in that chapter, the stack specification has been transformed using the transformer. The result can be seen in Example 10.1. For easy reference the applicative version of the stack specification is repeated here. Example 10.1 – Automatic transformation of the stack example scheme A_STACK = class type Stack = Element ∗ , Element value empty : Stack = 〈〉, is_empty : Stack → Bool is_empty(stack) ≡ stack = 〈〉, 109
- Page 74 and 75: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 76 and 77: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 78 and 79: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 80 and 81: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 82 and 83: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 84 and 85: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 86 and 87: CHAPTER 7. CORRECTNESS OF TRANSFORM
- Page 88 and 89: CHAPTER 8. SPECIFICATIONS The rewri
- 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 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 140 and 141: CHAPTER 12. POSSIBLE EXTENSIONS OF
- 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
CHAPTER 9. IMPLEMENTATION OF THE TRANSFORMER<br />
• Set expressions (ranged, enumerated, comprehended).<br />
• List expressions (ranged, enumerated, comprehended).<br />
• Map expressions (enumerated, comprehended).<br />
• Application expressions (function, list, map).<br />
• Bracketed expressions.<br />
• Value infix expressions.<br />
• Value prefix expressions.<br />
• Let expressions.<br />
• If expressions.<br />
• Case expressions.<br />
• Value literal patterns.<br />
• Name patterns.<br />
• Wildcard patterns.<br />
• Product patterns.<br />
• Record patterns.<br />
• List patterns.<br />
9.8.5 Pretty Printing<br />
The resulting specification <strong>of</strong> a transformation is not pretty printed. No<br />
focus is put on that aspect as the RSL pretty printer can be used for that<br />
purpose.<br />
108