DynBindModelExamples: Difference between revisions
| Line 86: | Line 86: | ||
\mbox{id} \left( \mbox{ran} \left( \beta_{ S_0 } \left( b \mapsto b \right) \ll \eta_{1, b} \right) \right) \right) | \mbox{id} \left( \mbox{ran} \left( \beta_{ S_0 } \left( b \mapsto b \right) \ll \eta_{1, b} \right) \right) \right) | ||
</math> | </math> | ||
We can forget about the right part of the union since <math>C_1\,</math> has no base classes. So we need to calculate: | We can forget about the right part of the union since <math>C_1\,</math> has no base classes. So we need to calculate: | ||
<math>\mbox{id} \left( \mbox{dom} \left( \tau_1 \right) \right)</math> | #<math>\mbox{id} \left( \mbox{dom} \left( \tau_1 \right) \right) </math> | ||
##<math> | |||
#<math> | |||
\tau_1 = \tau (C_1) = \left\{ f_1 \mapsto \underline{C_1.f_1}, g_1 \mapsto \underline{C_1.g_1} \right\} | \tau_1 = \tau (C_1) = \left\{ f_1 \mapsto \underline{C_1.f_1}, g_1 \mapsto \underline{C_1.g_1} \right\} | ||
</math> | </math> | ||
#<math> | ##<math> | ||
\mbox{dom} \left( \tau_1 \right) = \left\{ f_1, g_1 \right\} | \mbox{dom} \left( \tau_1 \right) = \left\{ f_1, g_1 \right\} | ||
</math> | </math> | ||
#<math> | ##<math> | ||
\mbox{id} \left( \mbox{dom} \left( \tau_1 \right) \right) = \left\{ f_1 \mapsto f_1, g_1 \mapsto g_1\right\} | \mbox{id} \left( \mbox{dom} \left( \tau_1 \right) \right) = \left\{ f_1 \mapsto f_1, g_1 \mapsto g_1\right\} | ||
</math> | </math> | ||
| Line 107: | Line 102: | ||
<math> | <math> | ||
\beta_{S_1}\left( C_1 \mapsto C_1 \right) = \left\{ f_1 \mapsto f_1, g_1 \mapsto g_1\right\} | \beta_{S_1}\left( C_1 \mapsto C_1 \right) = \left\{ f_1 \mapsto f_1, g_1 \mapsto g_1\right\} | ||
</math> | |||
And hence: | |||
<math> | |||
\beta_{S_1} = \left\{ \left( C_1 \mapsto C_1 \right) \mapsto | |||
\left\{ f_1 \mapsto f_1, g_1 \mapsto g_1 \right\} \right\} | |||
</math> | </math> | ||
Revision as of 23:17, 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 f2 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 .
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:
So we get:
And hence:
Calculating
We show the calculation of the different (four) parts of the function in separate sections:
Calculate
According to the definition:
Calculate
According to the definition:
Calculate
According to the definition:
Lets calculate the left part first:
And now the right part:
So we get:
Calculate
According to the definition:
Where:
And:
Here are the steps taken to compute the part:
So we get:
Putting the parts together:
We can know show the complete total function:
|
|
|
|
| |
|
| |
|
|
Calculating
We will not show the complete construction of but restrict our self to the most interesting parts.
Calculate
According to the definition:
Where:
And:
Note that we can ommit from the formulas since it is always empty.
So we get:
The complete naming function
|
|
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
The dynamic binding function
To calculate the dynamic binding function, we need to get . We will again calculate it incrementaly:
Calculating
According to the definition:
Since is empty this simplifies to:
So we get: