next up previous contents index
Next: Basic translation Up: Applying the simplify algorithm Previous: on statements   Contents   Index


at and overall statements

We consider the statement

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$at($$i$\verb$ = $$x$\verb$ [$$n$\verb$]) $$S$\end{tabbing}\end{minipage}\end{displaymath}

where $x$ and $n$ are expressions and $S$ is a statement.

Apply the simplify algorithm to the ordered list $[x, n]$ (in this case treating $x$ as a multiply reference value) and let the results be $\mbox{\it INITS}$ and $[x',n']$. If $\mbox{\it INITS}$ is empty the transformed version of our at statement is just

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$at($$i$\verb$ = $$x$\verb$ [$$n$\verb$]) $$S'$\end{tabbing}\end{minipage}\end{displaymath}

where $S'$ is the pre-translated version of $S$. Otherwise the transformed version is

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb${$ \\
...
... [$$n'$\verb$]) $$S'$ \\
\verb$}$
\end{tabbing}\end{minipage}\end{displaymath}

The overall statement follows the same pattern, if the triplet $t$ in

\begin{displaymath}
\begin{minipage}[t]{\linewidth}\begin{tabbing}
\verb$overall...
...b$ = $$x$\verb$ for $$t$\verb$) $$S$\end{tabbing}\end{minipage}\end{displaymath}

is treated as a generalized kind of expression.



Bryan Carpenter 2003-04-15