Spezifikationsmodule - Software and Systems Engineering - TUM
Spezifikationsmodule - Software and Systems Engineering - TUM
Spezifikationsmodule - Software and Systems Engineering - TUM
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
Abschließend erzeugen wir die Konstruktoren, wobei wir hier darauf verzichten<br />
die nicht-unifizierten Konstruktoren in den neuen Datentyp zu kopieren und<br />
die Änderungen im Modell vorzunehmen.<br />
)<br />
exists newConMap: map orig:constructorMap<br />
to copy:new Constructor . (<br />
forall ncm1:newConMap . forall ncm2:newConMap . (<br />
ncm1.orig = ncm2.orig equiv ncm1.copy = ncm2.copy<br />
) <strong>and</strong><br />
forall nc:newConMap . (<br />
/* create new constructors */<br />
result has Name(nc.copy,<br />
concat(nc.orig.one.Name, nc.orig.two.Name)) <strong>and</strong><br />
result has DataDef(nc.copy, nd) <strong>and</strong><br />
/* replace old constructors with the unified ones */<br />
...<br />
)<br />
) <strong>and</strong><br />
/* copy constructors not unified <strong>and</strong> replace old references */<br />
...<br />
Im Folgenden wollen wir nun noch die Selektoren mitberücksichtigen. In<br />
diesem Fall muss es möglich sein mehrere Datendefinitionen gleichzeitig zu unifizieren,<br />
da Selektoren nur unifziert werden können, wenn sie den selben Ergebnistyp<br />
haben oder die Ergebnistypen ebenfalls vereinigt werden. Letzteres<br />
bedeutet, dass die entsprechenden Datendefinitionen vereinigt werden müssen.<br />
context datadefTupel:{<br />
tupel:(datadefMap : set (one:DataDef, two:DataDef),<br />
constructorMap : set (one:Constructor, two:Constructor),<br />
selectorMap : set (one:Selector, two:Selector)<br />
) |<br />
forall sme:(tupel.selectorMap) . (<br />
/* constructor dependency */<br />
exists sme_con:(tupel.constructorMap) . (<br />
sme.one.Constructor = sme_con.one <strong>and</strong><br />
sme.two.Constructor = sme_con.two<br />
) <strong>and</strong> (<br />
/* selector types are equal */<br />
call selectorTypeEqual(sme.one, sme.two) or<br />
/* their datadefs are unified */<br />
exists sme_dd:(tupel.datadefMap) . (<br />
call testSelectorType(sme.one, sme_dd.one.TConst) <strong>and</strong><br />
call testSelectorType(sme.two, sme_dd.two.TConst)<br />
)<br />
)<br />
) <strong>and</strong><br />
forall cme:(tupel.constructorMap) . (<br />
/* datadef dependency */<br />
exists cme_dd:(tupel.datadefMap) . (<br />
28