Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
CHAPTER 6. TRANSFORMATIONS ✄ end f3 : Int × T → T f3(i, x) ≡ gen2(i, x), gen1 : T → T gen1(x) ≡ x + 1, gen2 : Int × T → T gen2(i, x) ≡ i + x scheme I_SPEC = class type T = Int end variable t : T value f1 : Unit → read t write t Unit f1() ≡ gen1(), f2 : Int → read t write t Unit f2(i) ≡ gen1(t := i + 1), f3 : Int → read t write t Unit f3(i) ≡ gen2(let (pa_0, pa_1) = (i, t := t) in (pa_0) end), gen1 : Unit → read t write t Unit gen1() ≡ t := t + 1, gen2 : Int → read t write t Unit gen2(i) ≡ t := i + t List application expressions and map application expressions are tranformed by transforming the constituent value expressions. An example of the transformation of a list application can be found in Example 6.10. 44
6.4. TRANSFORMING EXPLICIT FUNCTION DEFINITIONS Example 6.10 – Transformation of a list application scheme A_SPEC = class type T = Int, LIST = Int ∗ ✄ end value f : T × LIST → Int f(x, l) ≡ l(g1(x)), g1 : T → T g1(x) ≡ x + 1 scheme I_SPEC = class type T = Int, LIST = Int ∗ end variable t : T value f : LIST → read t write t Int f(l) ≡ l((g1() ; t)), g1 : Unit → read t write t Unit g1() ≡ t := t + 1 Bracketed Expressions A bracketed expression has the following form: (value_expr) A bracketed expression is transformed by transforming the constituent value expression. 45
- Page 10 and 11: CONTENTS 6.4.3 Transforming Value E
- Page 12 and 13: CONTENTS 12.2.4 Interactive Transfo
- Page 14 and 15: xiv
- Page 16 and 17: LIST OF FIGURES xvi
- Page 18 and 19: CHAPTER 1. INTRODUCTION This stepwi
- Page 20 and 21: CHAPTER 1. INTRODUCTION 1. Formulat
- Page 22 and 23: CHAPTER 1. INTRODUCTION 1.7 Content
- Page 24 and 25: CHAPTER 2. GENERAL IDEA end value e
- Page 26 and 27: CHAPTER 2. GENERAL IDEA • In the
- Page 28 and 29: CHAPTER 2. GENERAL IDEA value incre
- Page 30 and 31: CHAPTER 3. TERMINOLOGY Expected Typ
- Page 32 and 33: CHAPTER 3. TERMINOLOGY Example 3.5
- Page 34 and 35: CHAPTER 3. TERMINOLOGY 18
- Page 36 and 37: CHAPTER 4. CONSTRAINTS further deve
- Page 38 and 39: CHAPTER 4. CONSTRAINTS of interest.
- Page 40 and 41: CHAPTER 4. CONSTRAINTS 24
- Page 42 and 43: CHAPTER 5. TRANSFORMABILITY scheme
- Page 44 and 45: CHAPTER 5. TRANSFORMABILITY 28
- Page 46 and 47: CHAPTER 6. TRANSFORMATIONS 6.2.1 Tr
- Page 48 and 49: CHAPTER 6. TRANSFORMATIONS Example
- Page 50 and 51: CHAPTER 6. TRANSFORMATIONS Applicat
- Page 52 and 53: CHAPTER 6. TRANSFORMATIONS object A
- Page 54 and 55: CHAPTER 6. TRANSFORMATIONS type T =
- Page 56 and 57: CHAPTER 6. TRANSFORMATIONS where ge
- Page 58 and 59: CHAPTER 6. TRANSFORMATIONS Ranged s
- Page 62 and 63: CHAPTER 6. TRANSFORMATIONS Value In
- Page 64 and 65: CHAPTER 6. TRANSFORMATIONS ✄ sche
- Page 66 and 67: CHAPTER 6. TRANSFORMATIONS A case e
- Page 68 and 69: CHAPTER 6. TRANSFORMATIONS is due t
- Page 70 and 71: CHAPTER 6. TRANSFORMATIONS 6.4.4 Tr
- Page 72 and 73: CHAPTER 6. TRANSFORMATIONS 56
- 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
CHAPTER 6. TRANSFORMATIONS<br />
✄<br />
end<br />
f3 : Int × T → T<br />
f3(i, x) ≡ gen2(i, x),<br />
gen1 : T → T<br />
gen1(x) ≡ x + 1,<br />
gen2 : Int × T → T<br />
gen2(i, x) ≡ i + x<br />
scheme I_SPEC =<br />
class<br />
type<br />
T = Int<br />
end<br />
variable<br />
t : T<br />
value<br />
f1 : Unit → read t write t Unit<br />
f1() ≡ gen1(),<br />
f2 : Int → read t write t Unit<br />
f2(i) ≡ gen1(t := i + 1),<br />
f3 : Int → read t write t Unit<br />
f3(i) ≡<br />
gen2(let (pa_0, pa_1) = (i, t := t) in (pa_0) end),<br />
gen1 : Unit → read t write t Unit<br />
gen1() ≡ t := t + 1,<br />
gen2 : Int → read t write t Unit<br />
gen2(i) ≡ t := i + t<br />
List application expressions and map application expressions are tranformed<br />
by transforming the constituent value expressions. An example <strong>of</strong><br />
the transformation <strong>of</strong> a list application can be found in Example 6.10.<br />
44