\paragraph{Normalize the model:} Although our previous treatment
handles the general model as specified in previous section, the 19
parameter model makes the illustration clumsy. We could, without loss
of generality, perform the following {\em normalization} procedure
at the beginning. Here is a step by step derivation:

\begin{enumerate}
\item
Normalize the lower bound of X to 1.

Consider a mapping from index space of X: $i \longmapsto i-l_x+1$

If we want to keep the left hand side of assignment as X(i), then 
i=l:u:s maps to $i=(l-l_x+1):(u-l_x+1):s$.

To be referencing the same elements of Y, consider an index expression
for Y, $a' \cdot i + b'$. We need to solve

\begin{equation}
\left\{
\begin{array}{l l l} \\
a' \cdot (l-l_x+1) + b' & = & a \cdot + b \\
a' \cdot (l-l_x+1+s) + b' & = & a \cdot (l+s) + b \\
\end{array}
\right.
\end{equation}

and get $a' = a$, $b' = a \cdot l_x - a + b$.

\item
Normalize Y: $i \longmapsto i-l_x+1$.

$a' \cdot i + b' = a' \cdot (i-l_y+1) + b'$. Thus we end up with

$a" \cdot i + b"$, where $a" = a' = a$ and 
$b" = a+b'-a \cdot l_y = a \cdot l_x - a \cdot l_y + b$.

\end{enumerate}

Thus, set
$x = u_x - l_x + 1, y = u_y - l_y + 1,$ and

$l = l - l_x + 1, u = u- l_x + 1, b = a \cdot (l_x - l_y) + b$

\begin{verbatim}
      DIMENSION X(1:x), Y(1:y)
      FORALL (i=l:u:s) X(i) = Y(a*i+b)
\end{verbatim}
will be semantically equivalent to 
\begin{verbatim}
      DIMENSION X(lx:ux), Y(ly:uy)
      FORALL (i=l:u:s) X(i) = Y(a*i+b)
\end{verbatim}
before the transformation.

We need to further consider the effect of templates.

Set $b_x = b_x - a_x \cdot (l_x-1)$ and
$b_y = b_y - a_y \cdot (l_y-1)$ 

will maintain the original aliagnment position.

We can also normalize the templates bounds, by

Set $t_x = u_{tx} - l_{tx} + 1$ and 
$t_y = u_{ty} - l_{ty} + 1$. And further adjust $b_x$ and $b_y$ by

Set $b_x = b_x - (l_{tx}-1)$ and
$b_y = b_y - (l_{ty}-1)$ 

In summary, if we have a general situation as in the Model section,
we can always transform it into

\begin{verbatim}
      DIMENSION X(1:x), Y(1:y)
      TEMPLATE Tx(1:tx),Ty(1:ty)
      ALIGN X(i) WITH Tx(ax*i+bx)
      ALIGN Y(i) WITH Ty(ay*i+by)
      FORALL (i=l:u:s) X(i) = Y(a*i+b)
\end{verbatim}

by setting

\begin{equation}
\begin{array}{r c l}
x & = & u_x - l_x + 1 \\
y & = & u_y - l_y + 1 \\
t_x & = & u_{tx} - l_{tx} + 1 \\  
t_y & = & u_{ty} - l_{ty} + 1 \\
b_x & = & b_x - a_x \cdot (l_x-1) - (l_{tx}-1) \\
b_y & = & b_y - a_y \cdot (l_y-1) - (l_{tx}-1) \\
l & = & l - l_x + 1 \\
u & = & u- l_x + 1 \\ 
b & = & a \cdot (l_x - l_y) + b 
\end{array}
\end{equation}

Then our previous discussion would be cleaner.
