MOMENT: a Formal Framework for Model Managemment by Artur Boronat
Total Page:16
File Type:pdf, Size:1020Kb
MOMENT: A Formal Framework for MOdel managemMENT by Artur Boronat Submitted to the Department of Information Systems and Computation in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science and Engineering at the Universitat Polit`ecnicade Val`encia June 2007 Supervisors: Jos´eMeseguer, Isidro Ramos and Jos´e A.´ Cars´ı Table of Contents Chapter 1: Introduction ..................................... 3 Introduction ............................................ 3 1.1 Structure of the Document . 4 I Foundations 5 Chapter 2: Presentation of the Problem .......................... 7 2.1 The MOF Modeling Framework . 7 2.2 Discussion on the Current MOF Standard . 9 2.3 OCL Constraints in MOF Metamodels . 11 2.3.1 A Brief Overview of OCL . 11 2.3.2 Context of OCL Expressions . 12 2.3.3 OCL Constraint Satisfaction . 13 2.4 Open Problems . 14 Chapter 3: Related Work .................................... 17 3.1 Formal Semantics of Concepts in Model-Driven Development . 17 3.1.1 Model . 17 3.1.2 Metamodel . 18 3.2 Formal Metamodeling Approaches . 19 3.2.1 Formal UML Modeling Environments: The MOVA Framework . 20 3.2.2 Graph-based Metamodeling Frameworks . 21 AGG......................................... 21 AToM3 ....................................... 21 VIATRA2 . 22 3.2.3 Model Checking Graph Transformations . 22 3.2.4 Discussion: Motivating our Approach . 22 3.3 Antecedents . 25 Chapter 4: Preliminary Concepts ............................... 27 4.1 Membership Equational Logic . 27 4.2 Reflection . 28 4.3 Maude . 28 4.3.1 Parameterized programming . 30 II A Formal MOF Framework 33 Chapter 5: A High-Level View of the MOF Algebraic Semantics ........... 35 5.1 Informal Semantics of MOF . 35 5.2 A High-Level View of the MOF Metamodel Algebraic Semantics . 36 5.3 Formalization of the MOF Reflection support . 38 5.4 Discussion about the Algebraic Semantics of MOF Metamodels . 39 Chapter 6: An Algebraic Structural Conformance Relation .............. 43 6.1 A Generic Infrastructure of Parameterized Theories . 45 6.1.1 Primitive Type Theories . 45 6.1.2 OCL Collection Types . 46 Undefined Values . 48 6.1.3 The OCL-DATATYPE-COLLECTIONS theory . 49 6.1.4 The MODEL theory.................................. 49 6.1.5 The EXT-MODEL theory . 51 6.2 Algebraic Semantics of the MOF Metamodel . 51 6.2.1 Algebraic Semantics of MOF Object Types . 53 NamedElement .................................. 54 Type ........................................ 54 Class ........................................ 55 Property ..................................... 55 DataType ..................................... 57 PrimitiveType .................................. 57 Enumeration and EnumerationLiteral ................... 58 Package ...................................... 59 6.2.2 Algebraic Semantics of MOF Model Types . 60 6.2.3 Structure of a Metamodel Definition . 60 Graph structure . 61 Tree structure . 64 Type Definitions in MOF ............................. 68 The Specialization Relation s .......................... 68 Additional Semantics . 69 6.2.4 Graphical Representation of MOF Metamodel Definitions M . 71 6.3 Algebraic Semantics of MOF Metamodels Static Structure . 72 6.3.1 Generic Semantics of any Metamodel Definition M . 73 Graph Structure . 74 Tree structure . 75 Structure Definition . 78 6.3.2 Specific Semantics of a Metamodel Definition M . 83 Package . 84 Enumeration Types . 86 Primitive Types . 87 Object Types . 87 Algebraic Semantics of Object Types OT .................... 89 Object Type Names . 89 Object Type Identifiers . 90 Object Type Properties . 91 Object Type Specialization Relation s ..................... 93 Algebraic Semantics of the Specialization Relation s . 94 6.3.3 Name Strategy . 94 6.4 Reflecting the Algebraic Semantics: the Reflect Operator. 95 6.5 Reifying the Algebraic Semantics: the Inverse Step. 96 6.6 Summary . 96 Chapter 7: Algebraic Constrained Conformance Relation ............... 99 7.1 Algebraic Semantics of the OCL Metamodel . 100 7.1.1 Abstract Syntax of the OCL Language . 101 7.2 Algebraic Semantics of OCL Predefined Operators . 103 7.2.1 Primitive Type Theories . 104 7.2.2 The ENVIRONMENT Theory . 107 7.2.3 The OCL-COLLECTIONS{T :: TRIV} Theory . 108 Common Operators . 109 Regular Collection Operators . 109 Iterator Operators . 110 Iterate Operator . 114 7.2.4 The MODEL{OBJ :: TH-OBJECT} Theory . 116 Common Operations . 116 User-defined Operations . 117 OclAny . 118 OclType . 119 7.3 Algebraic Semantics of the reflect Function . 120 7.3.1 Preliminary concepts and functions . 121 7.3.2 User-Defined OCL Type Operators: getExpTheory . 125 IfExp . 126 IterateExp . 126 IteratorExp . 127 LetExp . 129 LiteralExp . 130 OperationCallExp . 130 PropertyCallExp . 130 VariableExp . 132 TypeExp . 132 7.3.3 Algebraic Semantics of OCL Expressions: getExpT erm . 132 IfExp . 133 IterateExp . 133 IteratorExp . 135 LetExp . 135 LiteralExp . 135 OperationCallExp . 138 PropertyCallExp . 145 VariableExp . 145 TypeExp . 145 7.3.4 Name Strategy . 146 7.3.5 Complete Example . 146 7.4 Algebraic Semantics of the Constrained Conformance Relation . 148 7.4.1 Discussion: Non-Determinism in OCL Expressions . 149 7.4.2 Unspecified Part of the OCL Language . 150 Chapter 8: Formalizing the MOF Reflection Facilities .................. 153 8.1 Informal Introduction to the MOF Reflective Facilities . 154 8.1.1 Discussion on the MOF Reflective Facilities . ..