• No se han encontrado resultados

1.3 Línea base del Proyecto

1.3.2 Marco conceptual

1.3.2.5 Tipos de tratamiento de aguas residuales

The first transformation that will be defined is a transformation of regular classes. A class without any additional properties is considered a regular class. The Ecore model for defining a regular class is given in the following definition:

Example

(a)T mClasswithname=.Example

Example

(b)T GClasswithname=.Example

Figure 5.1: Visualisation of the transformation of regular classes

Definition 5.2.1(Type modelT mClass)

Let T mClass be the type model containing a regular class with identifiername. T mClass is defined as:

Class={name} Enum={} U serDataT ype={} F ield={} FieldSig ={} EnumV alue={} Inh={} P rop={} Constant={} ConstType ={}

Also see tmod_classin Ecore-GROOVE-Mapping-Library.ClassType

Theorem 5.2.2 (Correctness ofT mClass)

T mClass (Definition 5.2.1) is a consistent type model in the sense of Definition 3.2.11.

Also see tmod_class_correctin Ecore-GROOVE-Mapping-Library.ClassType

A visual representation ofT mClasswith identifier.Examplecan be seen in Figure 5.1a. The correctness

proof of T mClass is trivial, and therefore not included here. The proof can be found as part of the

Isabelle validated proofs.

In order to make composing transformation functions possible, T mClassshould be compatible with the

type model it is combined with.

Theorem 5.2.3 (Correctness ofcombine(T m, T mClass))

Assume a type model T m that is consistent in the sense of Definition 3.2.11. Then T m is compatible withT mClass (in the sense of Definition 4.3.13) if:

• The identifier of the class in T mClass is not yet an identifier for a class, enumeration type or user-defined data type inT m;

• The identifier of the class in T mClass is not in the namespace of any class, enumeration type or user-defined data type inT m;

• None of the identifiers in any class, enumeration type or user-defined data type in T m is in the namespace of the class in T mClass.

Also see tmod_class_combine_correctin Ecore-GROOVE-Mapping-Library.ClassType

Proof. Use Lemma 4.3.12. It is possible to show that all assumptions hold. Now we have shown that

combine(T m, T mClass)is consistent in the sense of Definition 3.2.11.

The definitions and theorems for a regular class within Ecore are now complete.

Encoding as node type

A possible encoding for regular classes in Ecore is using a node type in GROOVE. This node type will get a transformed identifier as name. The encoding corresponding toT mClass can then be represented

Definition 5.2.4(Type graphT GClass)

LetT GClassbe the type graph containing a single node type which encodes a regular classname. T GClass is defined as:

N T ={ns_to_list(name)}

ET ={}

⊑={(ns_to_list(name),ns_to_list(name))}

abs={}

mult ={}

contains={}

Also see tg_class_as_node_typein Ecore-GROOVE-Mapping-Library.ClassType

Theorem 5.2.5 (Correctness ofT GClass)

T GClass (Definition 5.2.4) is a valid type graph in the sense of Definition 3.3.5.

Also see tg_class_as_node_type_correctin Ecore-GROOVE-Mapping-Library.ClassType

A visual representation ofT GClass with identifier.Examplecan be seen in Figure 5.1b. The correctness

proof of T GClass is trivial, and therefore not included here. The proof can be found as part of the

Isabelle validated proofs.

In order to make composing transformation functions possible,T GClass should be compatible with the

type graph it is combined with.

Theorem 5.2.6 (Correctness ofcombine(T G, T GClass))

Assume a type graph T G that is valid in the sense of Definition 3.3.5. Then T G is compatible with T GClass (in the sense of Definition 4.3.24) if:

• The node type of the encoded class in T GClass is not a node type in T G.

Also see tg_class_as_node_type_combine_correct in

Ecore-GROOVE-Mapping-Library.ClassType

Proof. Use Lemma 4.3.23. It is possible to show that all assumptions hold. Now we have shown that

combine(T G, T GClass)is valid in the sense of Definition 3.3.5.

The next definitions define the transformation function fromT mClass toT GClass: Definition 5.2.7(Transformation functionfClass)

The transformation functionfClass(T m)is defined as:

N T ={ns_to_list(c)|c∈ClassT m} ET={}

⊑={(ns_to_list(c1),ns_to_list(c2))|c1∈ClassT m∧c2∈ClassT m} abs={}

mult ={}

contains={}

Also see tmod_class_to_tg_class_as_node_typein Ecore-GROOVE-Mapping-Library.ClassType

Theorem 5.2.8 (Correctness offClass)

fClass(T m)(Definition 5.2.7) is a valid transformation function in the sense of Definition 4.3.25 trans- formingT mClass intoT GClass.

Also see tmod_class_to_tg_class_as_node_type_funcin

Ecore-GROOVE-Mapping-Library.ClassType

The proof of the correctness offClasswill not be included here. Instead, it can be found in the validated

Isabelle theories.

Finally, to complete the transformation, the transformation function that transforms T GClass into T mClass is defined:

Definition 5.2.9(Transformation functionfClass′ )

The transformation functionfClass′ (T G)is defined as:

Class={list_to_ns(n)|n∈N TT G} Enum={} U serDataT ype={} F ield={} FieldSig ={} EnumV alue={} Inh={} P rop={} Constant={} ConstType ={}

Also see tg_class_as_node_type_to_tmod_classin Ecore-GROOVE-Mapping-Library.ClassType

Theorem 5.2.10 (Correctness offClass′ )

fClass′ (T G)(Definition 5.2.9) is a valid transformation function in the sense of Definition 4.3.30 trans- formingT GClass intoT mClass.

Also see tg_class_as_node_type_to_tmod_class_funcin

Ecore-GROOVE-Mapping-Library.ClassType

Once more, the correctness proof is not included here but can be found in the validated Isabelle proofs of this thesis.

Documento similar