DynBindModelExamples: Difference between revisions
| Line 75: | Line 75: | ||
===Some operators=== | ===Some operators=== | ||
We will give some rather informal definitions for the set-theoretic operators used here. | We will give some rather informal definitions for the set-theoretic operators used here. | ||
====Operator: identity ==== | ====Operator: identity ==== | ||
<math> | <math> | ||
\mbox{id}\left( \left\{ e_1, \ldots, e_n \right\} \right)\ = \left\{ e_1 \mapsto e_1, \ldots, e_n \mapsto e_n \right\} | \mbox{id}\left( \left\{ e_1, \ldots, e_n \right\} \right)\ = \left\{ e_1 \mapsto e_1, \ldots, e_n \mapsto e_n \right\} | ||
</math> | </math> | ||
====Operator: domain==== | ====Operator: domain==== | ||
<math> | <math> | ||
\mbox{dom}\left(\left\{ l_1 \mapsto r_1, \ldots, l_n \mapsto r_n \right\}\right) = \left\{ l_1, \ldots, l_n \right\} | \mbox{dom}\left(\left\{ l_1 \mapsto r_1, \ldots, l_n \mapsto r_n \right\}\right) = \left\{ l_1, \ldots, l_n \right\} | ||
</math> | </math> | ||
====Operator: range==== | ====Operator: range==== | ||
<math> | <math> | ||
\mbox{ran}\left(\left\{ l_1 \mapsto r_1, \ldots, l_n \mapsto r_n \right\}\right) = \left\{ r_1, \ldots, r_n \right\} | \mbox{ran}\left(\left\{ l_1 \mapsto r_1, \ldots, l_n \mapsto r_n \right\}\right) = \left\{ r_1, \ldots, r_n \right\} | ||
</math> | </math> | ||
====Operator: override==== | |||
<math>E \mapsto F \in p \ll q</math> | |||
is equivalent to: | |||
<math>E \mapsto F \in q \,\lor\, \left( E \mapsto F \in p \,\land\, E \not\in \mbox{dom}\left( p \right) \right)</math> | |||
Example: | |||
====Operator <math>\ | <math> | ||
<math> | \left\{ 1 \mapsto 2, 2 \mapsto 3 \right\} \,\ll\, \left\{ 1 \mapsto 4, 3 \mapsto 6 \right\} | ||
= | |||
\left\{ 1 \mapsto 4, 2 \mapsto 3, 3 \mapsto 6 \right\} | |||
</math> | |||
====Operator: union==== | |||
<math>E \in \mbox{UNION} \ x \cdot \left(x \in S \ |\ T \right)</math> | |||
is equivalent to: | |||
<math>\exists x \cdot \left(x \in S \ \land\ E \in T \right)</math> | |||
Example: | |||
<math>\mbox{UNION} \ x \cdot \left(x \in \left\{ 1, 2, 3\right\} \ |\ \left\{ x, x^2 \right\} \right)</math> | |||
is equivalent to: | |||
<math>\left\{ 1, 2, 3, 4, 9\right\}</math> | |||
===Calculating <math>\beta_{S_1}</math>=== | ===Calculating <math>\beta_{S_1}</math>=== | ||
Revision as of 16:23, 9 October 2006
This page shows
Example 1
The system
In this example we are studying a symple system with three classes that contains both renaming and selects:
class C1 feature f1 do ... end g1 do ... end end |
class C2 inherit B rename f1 as f2, g1 as g2 redefine f2, g2 end feature f2 do ... end g2 do ... end end |
class C3 inherit C2 select f1 end C1 redefine f1, g1 select g1 end feature f1 do ... end g1 do ... end end |
This system is defined by:
The naming function
We proceed by calculating the naming function. According to its definition we have to do that incrementaly. Meaning that we first calculate then and finally .
Some operators
We will give some rather informal definitions for the set-theoretic operators used here.
Operator: identity
Operator: domain
Operator: range
Operator: override
is equivalent to:
Example:
Operator: union
is equivalent to:
Example:
is equivalent to:
Calculating
Since contains only one class it is sufficient to define . According to the definition:
We can forget about the right part of the union since has no base classes. So we need to calculate: . To do so we give a little reminder on the identity and domain operators:
This done we calculate:
So we get:
Calculating
Lets calculate the easy part first:
The next least difficult thing we can calculate is:
We now calculate: