Transformation of Applicative Specifications into Imperative ...
Transformation of Applicative Specifications into Imperative ... Transformation of Applicative Specifications into Imperative ...
CHAPTER 7. CORRECTNESS OF TRANSFORMATION RULES 7.4 An Institution for RSLI In [Lin04] and [LH04] an institution for mRSL is defined. As mentioned above mRSL is an applicative subset of RSL. It is in the following outlined how an institution for the imperative subset RSLI can be defined and in that way an outline of a verification of the transformation rules is given. To simplify matters sort definitions, variant definitions and short record definitions are not considered, nor are hidden and implicit observers or hidden and implicit generators. In a proper definition they must be included. Furthermore, only maximal type expressions are considered. Signatures An RSLI signature is a triple Σ = 〈A, OP, V 〉 where • A = Id →m T (A, V ) is a map, which represents a set of non-cyclic abbreviation definitions. It maps type identifiers to the type expressions they abbreviate. • OP = Id →m T (A, V ) is a map, which represents a set of value declarations. It maps value identifiers to their declared type expressions. • V = Id →m T (A, V ) is a map, which represents a set of variable definitions. It maps variable identifiers to the corresponding type expressions. such that dom A, dom OP and dom V are disjoint. T (A, V ) is a set of RSL type expressions referring to type identifiers in dom A and variable identifers in dom V . A signature is said to be applicative if V = [ ], since there are no variable declarations in the applicative case. Signature Morphisms An RSLI signature morphism σ : Σ → Σ ′ is defined as the transformation from the transformable specification SP to the specification SP ′ such that Sign(SP ) = Σ and Sign(SP ′ ) = Σ ′ . Composition is defined in the obvious way and the identities are defined such that a signature is mapped to itself. Recalling the definition of the transformation rules, note that for a signature morphism σ : Σ → Σ ′ , where Σ = 〈A, OP, V 〉 and Σ ′ = 〈A ′ , OP ′ , V ′ 〉: • A = A ′ , since the abbreviation definitions are the same • dom OP = dom OP ′ , since the value declarations are transformed into value declarations of the same names • dom V ⊆ dom V ′ , since variables cannot be removed, only added 62
Sentences 7.4. AN INSTITUTION FOR RSLI An RSLI Σ-sentence is a boolean value expression, which is well-formed according to the static semantics of RSL and is within the subset of RSLI. Sentence Morphisms As a specification represents a signature and a collection of sentences, the transformation rules do not only define a transformation between the signatures of the specifications but also a transformation between sentences. An RSLI sentence morphism Sen(σ) : Sen(Σ) → Sen(Σ ′ ) should be defined such that it respects the defined transformation rules for sentences. Sentence Functor The functor Sen : Sign → Set is a functor that maps signatures Σ in Sign to the set Sen(Σ) of Σ-sentences and maps each signature morphism σ : Σ → Σ ′ in Sign to the sentence morphism Sen(σ) : Sen(Σ) → Sen(Σ ′ ) as described above. Models Let Σ = 〈A, OP, V 〉 be a signature. An RSLI Σ-model is a triple m = 〈mA, mOP , sinit〉 where where • mA : Id →m Types, such that dom mA = dom A and mA(a) = M(A ∗ (a)). That is mA maps type identifiers into the types their abbreviations denote. • mOP : Id →m Values, such that dom mOP = dom OP and mOP (op) ∈ M(OP (op)). That is mOP maps value identifiers into the values they denote. These values must be in the types denoted by their type expressions. • sinit ∈ Store. That is sinit denotes the initial store that maps variable identifiers to their initial values. • A ∗ is a function that takes a type expression to its canonical form, i.e. a type expression not referring to any type identifiers, by recursively expanding type identifiers according to their abbreviations. • M : T (A, V ) → Types is a meaning function mapping type expressions into the types they denote: M(t) = Value A ∗ (t). A type is a set of values, also known as a value domain. Valuet denotes the value domain for a type expression t ∈ T (∅, V ), e.g.: 63
- 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 60 and 61: CHAPTER 6. TRANSFORMATIONS ✄ end
- 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 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 124 and 125: CHAPTER 9. IMPLEMENTATION OF THE TR
- Page 126 and 127: CHAPTER 10. EXAMPLES OF TRANSFORMAT
CHAPTER 7. CORRECTNESS OF TRANSFORMATION RULES<br />
7.4 An Institution for RSLI<br />
In [Lin04] and [LH04] an institution for mRSL is defined. As mentioned<br />
above mRSL is an applicative subset <strong>of</strong> RSL. It is in the following outlined<br />
how an institution for the imperative subset RSLI can be defined and in that<br />
way an outline <strong>of</strong> a verification <strong>of</strong> the transformation rules is given. To simplify<br />
matters sort definitions, variant definitions and short record definitions<br />
are not considered, nor are hidden and implicit observers or hidden and implicit<br />
generators. In a proper definition they must be included. Furthermore,<br />
only maximal type expressions are considered.<br />
Signatures<br />
An RSLI signature is a triple Σ = 〈A, OP, V 〉 where<br />
• A = Id →m T (A, V ) is a map, which represents a set <strong>of</strong> non-cyclic abbreviation<br />
definitions. It maps type identifiers to the type expressions<br />
they abbreviate.<br />
• OP = Id →m T (A, V ) is a map, which represents a set <strong>of</strong> value declarations.<br />
It maps value identifiers to their declared type expressions.<br />
• V = Id →m T (A, V ) is a map, which represents a set <strong>of</strong> variable definitions.<br />
It maps variable identifiers to the corresponding type expressions.<br />
such that dom A, dom OP and dom V are disjoint.<br />
T (A, V ) is a set <strong>of</strong> RSL type expressions referring to type identifiers in<br />
dom A and variable identifers in dom V .<br />
A signature is said to be applicative if V = [ ], since there are no variable<br />
declarations in the applicative case.<br />
Signature Morphisms<br />
An RSLI signature morphism σ : Σ → Σ ′ is defined as the transformation<br />
from the transformable specification SP to the specification SP ′ such that<br />
Sign(SP ) = Σ and Sign(SP ′ ) = Σ ′ . Composition is defined in the obvious<br />
way and the identities are defined such that a signature is mapped to itself.<br />
Recalling the definition <strong>of</strong> the transformation rules, note that for a signature<br />
morphism σ : Σ → Σ ′ , where Σ = 〈A, OP, V 〉 and Σ ′ = 〈A ′ , OP ′ , V ′ 〉:<br />
• A = A ′ , since the abbreviation definitions are the same<br />
• dom OP = dom OP ′ , since the value declarations are transformed<br />
<strong>into</strong> value declarations <strong>of</strong> the same names<br />
• dom V ⊆ dom V ′ , since variables cannot be removed, only added<br />
62